Just made a desktop entry file and discovered that spaces around the equals sign may prevent KDE from running the launcher: Type=Application (works) Type =Application (works) Type= Application (doesn't work) Type = Application (doesn't work) The Desktop Entry Specification standard clearly states: "Space before and after the equals sign should be ignored; the = sign is the actual delimiter" http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html Reproducible: Always
Confirmed. desktopfileparser.cpp still has this comment: // TODO: should we also have to accept spaces around equals here?
This also affects KF5::KConfig. In fact given the wording of the bug I believe it is actually that Framework that is seeing the bug, KCoreAddons only handles desktop entry code for plugins. Regardless I will submit a patch for both to Phabricator.
Git commit 11ee92d92b1e9875a2707848324012fe881bf893 by Michael Pyne. Committed on 09/08/2017 at 03:40. Pushed by mpyne into branch 'master'. kconfigini: Strip leading whitespace when reading entry values. As per the Desktop Entry spec, we strip trailing whitespace from the key when we split an entry into a key/value pair at the '='. Now we also strip leading whitespace from the resulting value like we should. Differential Revision: https://phabricator.kde.org/D7169 M +3 -3 autotests/kdesktopfiletest.cpp M +1 -0 src/core/kconfigini.cpp https://commits.kde.org/kconfig/11ee92d92b1e9875a2707848324012fe881bf893
Git commit 077ef6797eb63df9c875ee1bc719d677ef594360 by Michael Pyne. Committed on 09/08/2017 at 03:46. Pushed by mpyne into branch 'master'. desktopfileparser: Fix non-compliant key/value parsing. The Desktop Entry spec says we should ignore the spaces surrounding the '=' delimiter in a Key=Value pair. But we only do this sometimes (all cases except the Type= entry which is handled specially). This change fixes Type entries to ignore whitespace as well. FIXED-IN:5.38.0 Differential Revision: https://phabricator.kde.org/D7170 M +2 -2 autotests/desktoptojsontest.cpp M +8 -3 src/lib/plugin/desktopfileparser.cpp https://commits.kde.org/kcoreaddons/077ef6797eb63df9c875ee1bc719d677ef594360