Bug 402820 - Unable to remove/unpin documents/apps from Application Menu after deleting the document/app from system
Summary: Unable to remove/unpin documents/apps from Application Menu after deleting th...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Menu (Kicker) widget (other bugs)
Version First Reported In: 5.14.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-03 13:26 UTC by Ivar Erikson
Modified: 2025-06-23 20:38 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivar Erikson 2019-01-03 13:26:12 UTC
SUMMARY

# First: I'm very unsure of where to file this bug. Please assign the correct Product, since I'm very likely in the wrong place. Thanks<3

# Issue:
When pinning an app to the Application Menu's Favourites sidebar, there's no simple "Unpin" option.
The only available is Right click > Show in favourites > unselect all checked activities

If you have an app or document pinned, then uninstall/delete said app/doc, it stays in the favourite bar, with no apparant way to remove it. Right click > Show in favourites > will show every activity unchecked.

With a deleted app I could "re-add" it to an activity, e.g. Default. Right click > Show in favourites > Select an activity (none are currently selected when deleted). Then Right click > Show in favourites > Un-check the activity and it's gone.

With a document, there's no such way. No matter what you click, this workaround won't work. You're stuck with the deleted document in your favourites bar.
The only way I found to circumvent this was to create a document with the same name in the same location, sort of tricking the shortcut in Favourites to think it wasn't deleted.


STEPS TO REPRODUCE
1. Pin document/app to Favourites in Application Menu
2. Delete document/app from the system
3. Try to remove the pinned document/app from Applications Menu > Favourites


OBSERVED RESULT
You can't unpin the document/app from Favourites.


EXPECTED RESULT
To be able to unpin.


SOFTWARE/OS VERSIONS
Operating System: Kubuntu 18.10
KDE Plasma Version: 5.14.4
Qt Version: 5.11.1
KDE Frameworks Version: 5.52.0
Kernel Version: 4.18.0-13-generic
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6600K CPU @ 3.50GHz
Memory: 31,4 GiB of RAM
Comment 1 Patrick Silva 2019-03-26 21:09:42 UTC
Confirmed here.

1. open a png file
2. open kicker > hover over "recent documents" 
3. right click on the file used in the step 1
4. click "Add to favorites"
5. delete the file used in the step 1
6. open kicker, right click on the favorite created in the step 4
7. click "Remove from favorites"

Result: the favorite is not removed

Operating System: Arch Linux 
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Comment 2 Nate Graham 2022-06-25 19:44:54 UTC
Can confirm with current git master.
Comment 3 Mark Fraser 2024-01-27 07:43:43 UTC
Still there in KDE Plasma Version: 5.27.10.
Only way to delete it is to manually edit
.config/kactivitymanagerd-statsrc
Log out and then log back in again.
Comment 4 Bug Janitor Service 2025-06-13 20:11:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5595
Comment 5 cwo 2025-06-23 19:58:52 UTC
Git commit da244b8764cde5509598965f24804bbaa5e0939f by Christoph Wolk.
Committed on 23/06/2025 at 19:13.
Pushed by cwo into branch 'master'.

applets/kicker: resolve non-existing files to their url

Kicker's PAStats-based favorites do some normalization to, among others,
resolve symlinked files to their resolved path to reduce duplicates.
However, if the file doesn't exist, it essentially just gives up. This
is a problem when trying to remove favorites that were deleted: while
the un-favoriting in PAStats succeeds, kicker can't remove it from its
own model because it can't identify the file by its url if it doesn't
exist. So removed favorites confusingly stick around until the next
plasmashell restart.

Instead, we take the base url in that case - as the entries already have
gone through the process, the url is their real url anyway.
FIXED-IN: 6.4.1

M  +2    -0    applets/kicker/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/da244b8764cde5509598965f24804bbaa5e0939f
Comment 6 cwo 2025-06-23 20:38:57 UTC
Git commit d1896f5ac7367a96d710afcd84278760678f36f0 by Christoph Wolk.
Committed on 23/06/2025 at 20:03.
Pushed by cwo into branch 'Plasma/6.4'.

applets/kicker: resolve non-existing files to their url

Kicker's PAStats-based favorites do some normalization to, among others,
resolve symlinked files to their resolved path to reduce duplicates.
However, if the file doesn't exist, it essentially just gives up. This
is a problem when trying to remove favorites that were deleted: while
the un-favoriting in PAStats succeeds, kicker can't remove it from its
own model because it can't identify the file by its url if it doesn't
exist. So removed favorites confusingly stick around until the next
plasmashell restart.

Instead, we take the base url in that case - as the entries already have
gone through the process, the url is their real url anyway.
FIXED-IN: 6.4.1


(cherry picked from commit da244b8764cde5509598965f24804bbaa5e0939f)

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

M  +2    -0    applets/kicker/kastatsfavoritesmodel.cpp

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