Fix the result of KDesktopFile::sortOrder()
ClosedPublic

Authored by volkov on Nov 7 2017, 10:57 AM.

Details

Summary

KDesktopFile::sortOrder() returns the value of SortOrder key
as a string whithout parsing it as a list.
But according to Desktop Entry Specification
https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
it's type is "string(s)", i.e. the same type as the type of
Actions and MimeType keys, and thus it should be read the same way.

Diff Detail

Repository
R237 KConfig
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
volkov created this revision.Nov 7 2017, 10:57 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 7 2017, 10:57 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
dfaure added a subscriber: dfaure.Dec 2 2017, 3:43 PM

This looks correct, but did you find the KDE code that writes out this key?
A quick LXR search doesn't find anything relevant; do we use this feature at all?

https://lxr.kde.org/search?_filestring=&_string=%22SortOrder%22&_casesensitive=1

Well, at first I was planning to use this method in my project, but since it's not used in KDE
and besides the SortOrder key is deprecated, I guess that KDesktopFile::sortOrder() should be
marked as deprecated.
The question is whether to fix it first?

dfaure accepted this revision.Dec 5 2017, 9:58 PM

I don't really mind/care if it's fixed or not, if it's deprecated and unused :-)

Want to submit a patch to deprecate it?

This revision is now accepted and ready to land.Dec 5 2017, 9:58 PM
This revision was automatically updated to reflect the committed changes.