Skip to content

Locate desktop files more carefully

Vlad Zahorodnii requested to merge work/cherry-pick-f3f2a338 into Plasma/6.2

It may happen that the specified app id is a file path to a binary file. In which case, the findDesktopFile() function will return that file path and KConfig will try to parse a binary file.

On other hand, the findDesktopFile() function should ideally always append the ".desktop" suffix. If there's no file with such a file name, nothing should be returned. But due to some Qt applications providing app ids with the ".desktop" suffix, the findDesktopFile() function also tries to find a desktop file without appending the ".desktop" suffix. However, the fallback code doesn't actually try to verify that the desktop file name contains the ".desktop" suffix, which can result in the findDesktopFile() function providing values that it shouldn't. In this case, returning the file path to a binary executable.

BUG: 492584

(cherry picked from commit f3f2a338)

Co-authored-by: Vlad Zahorodnii vlad.zahorodnii@kde.org

Merge request reports