Bug 491811 - Edited desktop application file should be removed or hidden after uninstalling its program
Summary: Edited desktop application file should be removed or hidden after uninstallin...
Status: CONFIRMED
Alias: None
Product: frameworks-kservice
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.5.0
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2024-08-17 09:17 UTC by Fabio S. Reszko Jr.
Modified: 2024-08-20 18:51 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio S. Reszko Jr. 2024-08-17 09:17:31 UTC
SUMMARY
Edited desktop application files are not removed after uninstalling its program

STEPS TO REPRODUCE
1. Install an app (like firefox, librewolf, etc.) that has a .desktop file on /usr/share/applications
2. Edit it using KDE's dialog enough to make it different from the original file
3. Uninstall the program

OBSERVED RESULT
The program still shows as installed even though it is not.

EXPECTED RESULT
The program should not show as an option when you search for it.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-8565U CPU @ 1.80GHz
Memory: 11.6 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620

ADDITIONAL INFORMATION
When you edit a desktop application, KDE creates a copy of it on $HOME/.local/share/applications that is not deleted after the program is uninstalled.
Comment 1 Antonio Rojas 2024-08-17 09:19:14 UTC
How are you installing and unistalling the application?
Comment 2 Nate Graham 2024-08-20 17:39:33 UTC
Can reproduce. The issue here is that anything that removes apps (distro package manager, Discover, some other random PackageKit implementation) doesn't necessarily know about the existence of custom desktop files here. Teaching all of them is probably infeasible, though I guess we would probably make Discover do it. But that wouldn't result in full coverage.

Another option is to have ksycoca scan desktop files for executables that don't exist, and either delete them, or suppress displaying them in the UI by adding NoDisplay=True to them.
Comment 3 Fabio S. Reszko Jr. 2024-08-20 17:42:51 UTC
(In reply to Antonio Rojas from comment #1)
> How are you installing and unistalling the application?

Installing with `pacman -S` and uninstalling with `pacman -R`. Though I don't think this is of too much significance, as I tested with flatpak and the issue persists. The problem relies on editing the desktop application, independently of the way it was installed.