Use flatpak_installation_list_installed_refs for listing installed flatpaks
ClosedPublic

Authored by apol on Sep 13 2017, 10:26 AM.

Details

Summary

Instead of going through a directory. This allows us to have the
FlatpakInstalledRef* tuple for each of the resources being able to fully
populate the resources with architecture, branch and origin.

This is also useful because since we have all of the information we get
to use these tuples to generate a uniqueId so they can be lookedup by
comparing it. Therefore, we remove the fallbacks on getInstalledRefForApp
and getAppForInstalledRef.

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.Sep 13 2017, 10:26 AM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 13 2017, 10:26 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
jgrulich requested changes to this revision.Sep 13 2017, 1:43 PM
jgrulich added inline comments.
libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
614–615

This will break for apps which .desktop file name doesn't match flatpak ref name. Also you can filter out runtimes and .Locale resources before you get here to avoid errors.

This revision now requires changes to proceed.Sep 13 2017, 1:43 PM
apol added a comment.Sep 13 2017, 2:36 PM

Here's an issue related to the next version of the patch: https://github.com/flatpak/flatpak/issues/1014

apol updated this revision to Diff 19486.Sep 13 2017, 2:38 PM
apol edited edge metadata.

Use flatpak_installed_ref_load_metadata to read the metadata

jgrulich accepted this revision.Sep 14 2017, 6:44 AM

Looks good now. I haven't tried it yet, but I understand what you did and it should work.

This revision is now accepted and ready to land.Sep 14 2017, 6:44 AM
This revision was automatically updated to reflect the committed changes.