Bug 485105 - Application launcher is not updated when .desktop file is changed
Summary: Application launcher is not updated when .desktop file is changed
Status: CONFIRMED
Alias: None
Product: frameworks-kservice
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.2.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-05 20:44 UTC by equeim
Modified: 2024-05-14 22:58 UTC (History)
5 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 equeim 2024-04-05 20:44:18 UTC
SUMMARY
When existing desktop file in ~/.local/share/applications is changed (not added or removed, but changed), its application launcher item is not updated.

STEPS TO REPRODUCE
1. Change desktop file in ~/.local/share/applications in a visible way, e.g. by changing its Name
2. Open application launcher

OBSERVED RESULT
App's name is not updated.

EXPECTED RESULT
App's name is updated.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed
KDE Plasma Version: 6.0.3
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.3

ADDITIONAL INFORMATION
A bit of debugging leads me to believe that the cause of the issue is KSycoca class in KService library.
KSycoca database is updated when either checkDirectoriesTimestamps or checkFilesTimestamps functions return true: https://invent.kde.org/frameworks/kservice/-/blob/master/src/sycoca/ksycoca.cpp?ref_type=heads#L581

However checkDirectoriesTimestamps works based on directories' mtime, which is changed only when file is created or deleted, and checkFilesTimestamps only checks ~/.config/mimeapps.list and /usr/share/applications/kde-mimeapps.list files.
Comment 1 Nate Graham 2024-05-14 22:58:58 UTC
Yep, seems like you found the issue. Wanna submit a patch to fix it?