mpyne created this revision. Restricted Application added a project: Frameworks.
REVISION SUMMARY As reported in bug 310674, the Desktop Entry spec says that whitespace surrounding the = sign that separates the key and value in .desktop files should be ignored when interpreting the key and value portions. That is, all four of these lines should be equivalent: Type=Application Type =Application Type= Application Type = Application DesktopFileParser handles this for most key/value entries already (e.g. at src/lib/plugin/desktopfileparser.cpp:266), but there is a specific function to handle reading `Type=` entries from desktop files which doesn't handle spaces (and even has a TODO asking whether it should). This patch implements the spec here by using `QRegularExpression` to match the part of the string after `=\s*`. TEST PLAN Existing autotests have been modified to include spaces around some of the `Type=` entries, and the updated autotests now pass. REPOSITORY R244 KCoreAddons REVISION DETAIL https://phabricator.kde.org/D7170 AFFECTED FILES autotests/desktoptojsontest.cpp src/lib/plugin/desktopfileparser.cpp To: mpyne, #frameworks, arichardson