Alacarte should avoid retaining unneeded files in ~/.local/share/applications
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:/
The extra .desktop file created by Alacarte was left behind in ~/.local/
https:/
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.
Changed in alacarte (Ubuntu): | |
importance: | Undecided → Wishlist |
Changed in alacarte: | |
status: | Unknown → New |
Changed in alacarte: | |
importance: | Unknown → Wishlist |
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.