Properly read the X-Flatpak-RenamedFrom string list from desktop files
ClosedPublic

Authored by apol on Mar 9 2020, 5:56 PM.

Details

Summary

If we know that a field is X-Flatpak-RenamedFrom, read it with the XDG string list specific codepath.
Otherwise we get something such as QStringList("potato;potatoe") which is not really helpful.

Test Plan

At the moment we don't get anymore X-Flatpak-RenamedFrom as
QVariant(QStringList, ("vlc.desktop;"))

Diff Detail

Repository
R309 KService
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
apol created this revision.Mar 9 2020, 5:56 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 9 2020, 5:56 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
apol requested review of this revision.Mar 9 2020, 5:56 PM
dfaure requested changes to this revision.Mar 11 2020, 10:09 PM
dfaure added a subscriber: dfaure.

This sounds wrong. The XDG-mandated entries use XDG separators, but the KDE entries don't (for instance, grepping my installed desktop files I can see those: X-Plasma-RequiredExtensions, X-Plasma-DropMimeTypes, X-KDE-FormFactors, X-KIPI-PluginCategories, X-KDE-ParentComponents in kdepim, they all use a comma separator).

Yes it's a mess. KDE1 had ';', the XDG standard picked that up, then KDE2 switched to ',' and now we have a mix. The way we handle this mess is that, in KConfig and in KService, the default is ',' and we specifically use readXdgListEntry for XDG entries.

I think this means the correct fix here is to specifically hardcode X-Flatpak-RenamedFrom instead of testing the property type.

This revision now requires changes to proceed.Mar 11 2020, 10:09 PM

Do we have a task to clean that mix up for kf6 on the work board?

How? You think we should change all our config files to use ';'? Welcome to migration hell.

(I looked at the KConfig history, and in fact the separator was initially a method argument which defaulted to comma, I was wrong about it being ';' initially. No idea how we ended up with ';' in XDG then)

apol updated this revision to Diff 77467.Mar 11 2020, 11:02 PM

Fix as suggested

apol retitled this revision from Properly read string lists from desktop files when parsing the files to Properly read the X-Flatpak-RenamedFrom string list from desktop files.Mar 11 2020, 11:03 PM
apol edited the summary of this revision. (Show Details)

How? You think we should change all our config files to use ';'? Welcome to migration hell.

(I looked at the KConfig history, and in fact the separator was initially a method argument which defaulted to comma, I was wrong about it being ';' initially. No idea how we ended up with ';' in XDG then)

I think it's worth doing, at least for desktop files.

dfaure accepted this revision.Mar 12 2020, 1:28 AM
This revision is now accepted and ready to land.Mar 12 2020, 1:28 AM
This revision was automatically updated to reflect the committed changes.