Alacarte should avoid retaining unneeded files in ~/.local/share/applications

Bug #340285 reported by Alex Ruddick
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Alacarte Menu Editor
New
Wishlist
alacarte (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

Binary package hint: alacarte

I ran into some unexpected behaviour when uninstalling a package, reported as a bug here:
https://bugs.launchpad.net/ubuntu/+source/usb-creator/+bug/340162

The extra .desktop file created by Alacarte was left behind in ~/.local/share/applications. I realize that Alacarte cannot know when the package is removed that that file should be deleted.
https://bugs.launchpad.net/ubuntu/+source/alacarte/+bug/55853

However, Alacarte /can/ somtimes realize when the ~/.local copy is no longer needed. For me a common action is checking/unchecking items to show/hide them in the menus. When unchecked, alacarte creates the local copy to override the system one and hide the application. This can lead to the unexpected behaviour that #33853 mentioned, but it should be the package manager's job to get rid of the old file. When the item is rechecked, however, the local copy is no longer needed. If alacarte were smart about this, it would realize that the local copy is now identical to the system one, and delete the local copy. (This could happen with other modifications, too, but seems less likely).

I've never written a patch before, and only know just enough Python to be dangerous, but I'm going to take a look at the source.

Revision history for this message
Alex Ruddick (alexrudd0) wrote :

Well, as I said I've never done this before so here goes nothing.

I've tried to attach a patch that applies to MenuEditor.py. I started from alacarte-0.11.9 obtained from apt-get source alacarte.

The patch contains a function checkDuplicate(item) that checks whether the current item already exists system-wide. I imagined it being called when a .desktop file in ~/.local was going to be edited. If the local file to be written was the same as the system version, the local version should be deleted.

Daniel T Chen (crimsun)
Changed in alacarte (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thanks for your bug report. This bug has been reported to the developers of the software. You can track it and make comments here: http://bugzilla.gnome.org/show_bug.cgi?id=576079

Changed in alacarte (Ubuntu):
status: New → Triaged
Changed in alacarte:
status: Unknown → New
Changed in alacarte:
importance: Unknown → Wishlist
Revision history for this message
Daniel Dietrich (shaddowy2) wrote :

It would be nice if that issue could be solved, as even a patch was already written and is attached.
It can be lead to bugs like the one others & I experienced: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/742045

Revision history for this message
Alex Ruddick (alexrudd0) wrote :

The patch doesn't actually do anything.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.