Bug 494542 - Option "Add to Favorites" is not available to put a app icon in Application Menu as favorite after uninstalling and reinstalling the application
Summary: Option "Add to Favorites" is not available to put a app icon in Application M...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) widget (other bugs)
Version First Reported In: 6.2.0
Platform: Other Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-11 15:03 UTC by toni_rocha
Modified: 2026-05-26 22:31 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.8.0
Sentry Crash Report:


Attachments
Example using Shotwell application (1.33 MB, video/webm)
2024-10-11 15:03 UTC, toni_rocha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description toni_rocha 2024-10-11 15:03:06 UTC
Created attachment 174696 [details]
Example using Shotwell application

SUMMARY

  When an application that was previously added like a "favorite" in 'Application Menu' is removed, the icon disappears from "Favorites". It's ok.
  But when I reinstall the same application and try to put it as a "favorite" again with the right mouse button, it just gives the option to "Remove from Favorites". I need to log in again for the "Add to Favorites" option to be available.

STEPS TO REPRODUCE
1. Add an application as "favorite" in Application Menu by menu bar;
2. Remove the application (by terminal, for example - it correctly is removed from Favorites, too);
3. Reinstall the same application;
4. Try add the application again to favorites in Application Menu. The unique option is "Remove from favorites", but is is not in favorites.
5. Logout and login again to show the "Add to favorites" again in Application Menu.

OBSERVED RESULT

. After remove and reinstall an application, the option "Add to Favorites" doesn't appear using right mouse button in the application on menu bar.

EXPECTED RESULT

.  The option "Add to Favorites" should appear using right mouse button in the application on menu bar, not  "Remove from Favorites".

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.2
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.8.0-45-generic (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-9700 CPU @ 3.00GHz
Memory: 23.3 GiB of RAM
Graphics Processor: NV106
Comment 1 Nate Graham 2024-10-11 17:09:28 UTC
Can reproduce the issue as described in the steps to reproduce and depicted in the screen recording.
Comment 2 daforlynx 2026-01-18 00:01:38 UTC
I was about to create a duplicate issue, but I found this.
Here's the bug report I was writing:

SUMMARY
I've noticed that when uninstalling a favorited application, it is removed from the favorites menu visually; however, if the app is reinstalled, it is not added back to the favorites, but it is also impossible to add it back manually, as it will always show "Remove from Favorites" in the context menu, which does not do anything and does not change.

STEPS TO REPRODUCE
1. Add an application to the favorites menu by right clicking it in the launcher and selecting "Add to Favorites"
2. Uninstall the application.
3. Reinstall the application.

OBSERVED RESULT
Right click the application in the launcher and observe that "Add to Favorites" is not available, but "Remove from Favorites" is. "Remove from Favorites" does not actually do anything, but does not change back to "Add to Favorites" until the computer (or maybe just the environment) is restarted.

EXPECTED RESULT
Uninstalling an application removes it from Favorites automatically, as expected. However, it is expected that if it is not added back automatically upon reinstalling, it should be able to be added back manually.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.14.0-rt3-arch1-6-rt (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700G with Radeon Graphics
Memory: 32 GiB of RAM (31.2 GiB usable)
Graphics Processor: AMD Radeon RX 6650 XT
Comment 3 Bug Janitor Service 2026-05-13 10:09:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6582
Comment 4 Bug Janitor Service 2026-05-13 19:16:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6586
Comment 5 cwo 2026-05-18 08:30:08 UTC
Git commit 9c30f7d107ff0fe139dffefacbb913a39d397feb by Christoph Wolk.
Committed on 18/05/2026 at 07:46.
Pushed by cwo into branch 'master'.

applets/kicker: refresh kastatsfavoritesmodel after ksycoca change

KAStatsFavoritesModel listens to ksycoca changes, so that any
uninstalled applications can be removed from the local data structure.
(Albeit with an error that makes it only remove some of the cache
entries). The problem is that this is not enough; the Activities
database maintains entries after they are removed, so if an uninstalled
favorite is reinstalled, it should immediately show up in the
favoritesmodel again (as it will after restarting or switching
activities). This is particularly important as some online updates may
be registered as a sequence of uninstallations and reinstallations of
the software, so an update may (temporarily) remove it from the
favorites.

Instead, let's just regenerate the internal model when the installed
apps change - we'd need to do much of the work anyway, and this is a
lot simpler than manually re-establishing the sync. We also do a reset
for the AppsModel in such cases (which typically has a lot more entries)
and do a similar reset whenever the activity changes so adding even more
complexity to this case to save a small amount of extra work does not
seem necessary.
Related: bug 517167, bug 503912

See also https://invent.kde.org/plasma/plasma-workspace/-/work_items/184

M  +12   -23   applets/kicker/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/9c30f7d107ff0fe139dffefacbb913a39d397feb
Comment 6 Anthony Fieroni 2026-05-23 05:16:30 UTC
Bugfix still has to be backported to non-released version i.e. 6.7
Comment 7 cwo 2026-05-23 06:45:44 UTC
(In reply to Anthony Fieroni from comment #6)
> Bugfix still has to be backported to non-released version i.e. 6.7

So it does, thanks!
Comment 8 cwo 2026-05-26 22:31:17 UTC
Git commit cfeabb4bf121b2819a2c46e86cc0544bcd518952 by Christoph Wolk.
Committed on 26/05/2026 at 19:51.
Pushed by cwo into branch 'Plasma/6.7'.

applets/kicker: refresh kastatsfavoritesmodel after ksycoca change

KAStatsFavoritesModel listens to ksycoca changes, so that any
uninstalled applications can be removed from the local data structure.
(Albeit with an error that makes it only remove some of the cache
entries). The problem is that this is not enough; the Activities
database maintains entries after they are removed, so if an uninstalled
favorite is reinstalled, it should immediately show up in the
favoritesmodel again (as it will after restarting or switching
activities). This is particularly important as some online updates may
be registered as a sequence of uninstallations and reinstallations of
the software, so an update may (temporarily) remove it from the
favorites.

Instead, let's just regenerate the internal model when the installed
apps change - we'd need to do much of the work anyway, and this is a
lot simpler than manually re-establishing the sync. We also do a reset
for the AppsModel in such cases (which typically has a lot more entries)
and do a similar reset whenever the activity changes so adding even more
complexity to this case to save a small amount of extra work does not
seem necessary.
Related: bug 517167, bug 503912

See also https://invent.kde.org/plasma/plasma-workspace/-/work_items/184


(cherry picked from commit 9c30f7d107ff0fe139dffefacbb913a39d397feb)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +12   -23   applets/kicker/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/cfeabb4bf121b2819a2c46e86cc0544bcd518952