Bug 393380

Summary: When an app is uninstalled, its icon should be removed from favorites list immediately
Product: [Plasma] plasmashell Reporter: Patrick Silva <bugseforuns>
Component: Application Menu (Kicker)Assignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED FIXED    
Severity: wishlist CC: alexander.lohnau, alexkde, kde, med.medin.2014, nate, ncqm3qdz, plasma-bugs, postix, qydwhotmail
Priority: NOR    
Version: 5.27.80   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 6.0.1
Attachments: screenshot showing the error message

Description Patrick Silva 2018-04-21 22:45:57 UTC
Created attachment 112159 [details]
screenshot showing the error message

plasma 5.12.4 on Arch Linux

add your default web browser icon to kicker favorites list
(right click your default web browser icon > "Add to favorites")
uninstall the browser: its icon remains in favorites list
when icon is clicked, I get an error: "this will start the program <path to executable> If you do not trust this program click Cancel"
restart plasma: now the icon was gone

ps: tested with chromium from Arch Linux repositories
Comment 1 Kai Uwe Broulik 2018-04-22 08:23:53 UTC
That happens with all applications, doesn't it?
Comment 2 Patrick Silva 2018-04-22 15:12:04 UTC
(In reply to Kai Uwe Broulik from comment #1)
> That happens with all applications, doesn't it?

You are right. I think that this behavior is not correct.
When an app is uninstalled, its icon should be removed from favorites list immediately. I have edited report summary.
Comment 3 Patrick Silva 2018-04-22 15:37:44 UTC
Kickoff is also affected, ancient report: bug 280949

Dashboard is also affected on my system but I did not find any related report.
Comment 4 alexkde 2018-10-27 16:39:36 UTC
I can confirm this bug at Plasma 5.14.2.
Comment 5 Alexander Lohnau 2020-07-11 19:03:21 UTC
This is still an issue.
Comment 6 medin 2021-06-19 22:20:05 UTC
Even the new launcher in 5.21.5 is affected.
Comment 7 Patrick Silva 2021-11-21 04:29:44 UTC
*** Bug 445843 has been marked as a duplicate of this bug. ***
Comment 8 Alexander Lohnau 2022-09-16 19:47:15 UTC
I will look into fixing this by using the KSycoca::databaseChanged signal.
Comment 9 Bug Janitor Service 2022-09-17 07:11:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2132
Comment 10 Alexander Lohnau 2022-09-24 05:53:02 UTC
Git commit 6853365755fa40e2199b4856e2838735a1b1add4 by Alexander Lohnau.
Committed on 24/09/2022 at 05:46.
Pushed by alex into branch 'master'.

Remove entries from favorites when desktop file was deleted

When the KSycoca database changes, we re-evaluate if our app still exists and update the internal service.
The model checks the validity of each of the entires and removes ones that became invalid.

Based on my testing it seemed like one had to type any query to make sure that the databaseChanged signal is emitted.

Test Plan:
`printf "[Desktop Entry]\nIcon=firefox\nName=DelmeFirefox\nExec=notify-send bla bla" >~/.local/share/applications/delmefirefox.desktop`
Add the entry to the favourites
`rm ~/.local/share/applications/delmefirefox.desktop`
Make sure it does not appear in the search
Make sure the favorite is removed
FIXED-IN: 5.26

M  +18   -10   applets/kicker/plugin/appentry.cpp
M  +16   -0    applets/kicker/plugin/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/6853365755fa40e2199b4856e2838735a1b1add4
Comment 11 Patrick Silva 2022-10-05 11:34:11 UTC
It's still reproducible on neon unstable.

1. uninstall an app present in the favorites list of Kickoff
2. open Kickoff


Result: the uninstalled app is still present in the favorites list of Kickoff
Comment 12 Fushan Wen 2022-10-05 15:01:47 UTC
Git commit 2de230ffd6f842a95c03ede081dd71941929eb38 by Fushan Wen.
Committed on 05/10/2022 at 14:59.
Pushed by fusionfuture into branch 'master'.

applets/kicker: use `removeResult` to remove item

This fixes ghost items after desktop entries were removed from the disk.
FIXED-IN: 5.27

M  +1    -3    applets/kicker/plugin/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/2de230ffd6f842a95c03ede081dd71941929eb38
Comment 13 Patrick Silva 2022-10-19 11:46:09 UTC
it's still reproducible on neon unstable. The icon of the uninstalled app remains in the favorites list until I do logout and login or remove it manually. Tested with KolourPaint from neon repos and Gparted from Ubuntu 22.04 repos.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.26.80
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.6
Graphics Platform: Wayland
Comment 14 Alexander Lohnau 2022-12-18 16:16:32 UTC
Can you please check if it works when you launch a query in KRunner or Kicker?
I think an architectural limitation is that KSycoca only emits the signal that the cache changed when a query is launched and the cache is recreated.

A solution could be to add a filewatcher for all the apps (though kindof ugly) or to check if KService can be adjusted. Though the latter might be more difficult.
Comment 15 Patrick Silva 2022-12-26 10:38:32 UTC
kicker does not find the uninstalled app (tested KolourPaint), krunner does. The uninstalled app remains in the favorites list of kicker.
Comment 16 Nate Graham 2024-03-18 18:12:24 UTC
It appears that this was fixed by the fix for Bug 481855.