Improve how we set up the flatpak backend
ClosedPublic

Authored by apol on Apr 19 2017, 2:50 PM.

Details

Summary

Remove the scope semantic and make the installation part of each resource.

Diff Detail

Repository
R134 Discover Software Store
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.Apr 19 2017, 2:50 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 19 2017, 2:50 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
jgrulich edited edge metadata.Apr 20 2017, 8:07 AM

Overall looks good to me, I also now understand why you don't use appScope as part of the unique id, hovewer I've been suggested by Alex to use flatpak_installation_get_display_name() or flatpak_installation_get_id(), which would result into a more readable unique id.

apol added a comment.Apr 20 2017, 10:18 AM

Overall looks good to me, I also now understand why you don't use appScope as part of the unique id, hovewer I've been suggested by Alex to use flatpak_installation_get_display_name() or flatpak_installation_get_id(), which would result into a more readable unique id.

I wanted to do that, but they don't seem very reliable. See:
qDebug() << "ggggg" << flatpakInstallation << g_file_get_path(file) << "." << flatpak_installation_get_id(flatpakInstallation) << "." << flatpak_installation_get_display_name(flatpakInstallation);

$ plasma-discover --backends flatpak-backend |& grep ggg | sort -u
discover(3265)/(default) FlatpakResource::installationPath: ggggg 0x7f5170009160 /var/lib/flatpak . default . Default system directory
discover(3265)/(default) FlatpakResource::installationPath: ggggg 0x7f51700092b0 /home/apol/.local/share/flatpak .  . 

These identifiers don't seem to be very reliable, at least on my system. Using _get_id was actually my first approach.

jgrulich accepted this revision.Apr 20 2017, 10:29 AM

If we cannot realy on id or display name for flatpak installation then we can stick with installation path :)

This revision is now accepted and ready to land.Apr 20 2017, 10:29 AM
This revision was automatically updated to reflect the committed changes.