Bug 485105

Summary: Application launcher is not updated when .desktop file is changed
Product: [Frameworks and Libraries] frameworks-kservice Reporter: equeim
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: fanzhuyifan, kdelibs-bugs-null, mikel5764, nate, noahadvs, sbobber
Priority: NOR    
Version First Reported In: 6.2.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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?