Bug 512332

Summary: App cannot be opened from Favorites until plasmashell restarts after overriding .desktop file
Product: [Plasma] plasmashell Reporter: Alex <48priory.volcano>
Component: Application Launcher (Kickoff) widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: mikel5764, nate, noahadvs
Priority: HI    
Version First Reported In: 6.3.6   
Target Milestone: 1.0   
Platform: Debian stable   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=510287
Latest Commit: Version Fixed/Implemented In: 6.6.0
Sentry Crash Report:

Description Alex 2025-11-19 06:24:00 UTC
SUMMARY
App cannot be opened from Favorites until plasmashell restart after overriding .desktop file

STEPS TO REPRODUCE
1. Add any application to Favorites that does not have an overriding .desktop file in ~/.local/share/applications/
2. Create an overriding .desktop file in ~/.local/share/applications/ (for example, using the KDE Menu Editor)
3. Click the app icon in the Favorites folder

OBSERVED RESULT
Nothing happens; neither the app nor an error dialog opens

EXPECTED RESULT
App opens normally

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian 13 Stable, Linux 6.12.57
KDE Plasma Version: 6.3.6
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
The same behavior is observed in the Application Dashboard and Application Menu as well.
Running the app from KRunner, the Task Manager widget, or directly from Dolphin works as expected.
Also tested on KDE Neon Testing (neon-testing-20251118-0031.iso) in a virtual machine; the same behavior was observed.
The problem disappears after restarting plasmashell or changing the widget using the "Show Alternatives" button in the current session.
Running kbuildsycoca6 --noincremental has no effect.
dbus-monitor --session and plasmashell --replace with QT_LOGGING_RULES="org.kde.plasma.*=true" output no logs when trying to run the app.
Comment 1 Bug Janitor Service 2025-11-19 06:33:48 UTC
Thank you for the bug report!

Debian advises users to not submit bugs upstream (https://www.debian.org/Bugs/Reporting), and Plasma 6.3.6 is no longer eligible for support or maintenance from KDE. It's possible that the issue exists only in Debian at this point.

Could you report the bug to Debian using the report bug utility (https://packages.debian.org/stable/utils/reportbug)? If necessary, the maintainer of the package will forward the bug upstream.
Thanks for understanding!

Thanks again!
Comment 2 Alex 2025-11-19 12:49:04 UTC
This issue exists not only in Debian, but also in the latest KDE Neon Testing (as specified in the first message) and in Manjaro.
Comment 3 Nate Graham 2025-12-08 17:21:06 UTC
Indeed, I can reproduce this issue as well, exactly as written.
Comment 4 Bug Janitor Service 2026-01-27 21:39:53 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6234
Comment 5 Bug Janitor Service 2026-01-27 21:39:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6234
Comment 6 Nate Graham 2026-02-09 15:00:55 UTC
Git commit 23bd030b2051b4d5d5a74ad23e3487fcde26e443 by Nate Graham, on behalf of Alexey Rochev.
Committed on 09/02/2026 at 15:00.
Pushed by ngraham into branch 'master'.

KAStatsFavoritesModel: retrieve launched entry by normalized id from m_items list


The problem with m_itemEntries map is that entries are stored there several times
with different keys: normalized id, url and path.

When desktop entry is overriden in user directory, and ksycoca is updated, entry
is reloaded but is still stored in m_itemEntries with the old keys.

This is not a problem for normalized id, but url and path keys will become
incorrect in this case.

Then in trigger() we will get a url of entry found via its normalized id (which
didn't change) and try to find it again using that url. Which doesn't work
because entry->url() returns new url for overridden desktop entry, but
m_itemEntries contains key with the old url.

This change sidesteps this issue by always operating on an entry found via
normalized id, which is simpler and more efficient anyway.
FIXED-IN: 6.6.0

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

https://invent.kde.org/plasma/plasma-workspace/-/commit/23bd030b2051b4d5d5a74ad23e3487fcde26e443
Comment 7 Nate Graham 2026-02-09 15:29:41 UTC
Git commit c5672b660a5dd45f7f34a328773452a975dcbcfe by Nate Graham.
Committed on 09/02/2026 at 15:02.
Pushed by ngraham into branch 'Plasma/6.6'.

KAStatsFavoritesModel: retrieve launched entry by normalized id from m_items list


The problem with m_itemEntries map is that entries are stored there several times
with different keys: normalized id, url and path.

When desktop entry is overriden in user directory, and ksycoca is updated, entry
is reloaded but is still stored in m_itemEntries with the old keys.

This is not a problem for normalized id, but url and path keys will become
incorrect in this case.

Then in trigger() we will get a url of entry found via its normalized id (which
didn't change) and try to find it again using that url. Which doesn't work
because entry->url() returns new url for overridden desktop entry, but
m_itemEntries contains key with the old url.

This change sidesteps this issue by always operating on an entry found via
normalized id, which is simpler and more efficient anyway.
FIXED-IN: 6.6.0


(cherry picked from commit 23bd030b2051b4d5d5a74ad23e3487fcde26e443)

8b43c518 KAStatsFavoritesModel: when launching entry, always retrieve entry by its...

Co-authored-by: Alexey Rochev <arochevdev@gmail.com>

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

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