[gnome-software/1754-improve-the-sources-dropdown] flatpak: Set app packaging information for origin popover rows



commit dcaedbc7356deeb992acf5c3fc7ba54136f0f2e7
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 3 16:04:55 2022 +0200

    flatpak: Set app packaging information for origin popover rows

 plugins/flatpak/gs-flatpak-utils.c | 12 +++++++++++-
 plugins/flatpak/gs-flatpak-utils.h |  1 +
 plugins/flatpak/gs-flatpak.c       |  2 +-
 3 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/plugins/flatpak/gs-flatpak-utils.c b/plugins/flatpak/gs-flatpak-utils.c
index 4e3adee89..0bf0a7ffa 100644
--- a/plugins/flatpak/gs-flatpak-utils.c
+++ b/plugins/flatpak/gs-flatpak-utils.c
@@ -86,7 +86,7 @@ gs_flatpak_app_new_from_remote (GsPlugin *plugin,
                         flatpak_remote_get_name (xremote));
        gs_app_set_size_download (app, GS_SIZE_TYPE_UNKNOWABLE, 0);
        gs_app_set_management_plugin (app, plugin);
-       gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_FLATPAK);
+       gs_flatpak_app_set_packaging_info (app);
        gs_app_set_scope (app, is_user ? AS_COMPONENT_SCOPE_USER : AS_COMPONENT_SCOPE_SYSTEM);
 
        gs_app_set_metadata (app, "GnomeSoftware::SortKey", "100");
@@ -259,3 +259,13 @@ gs_flatpak_app_new_from_repo_file (GFile *file,
        /* success */
        return g_steal_pointer (&app);
 }
+
+void
+gs_flatpak_app_set_packaging_info (GsApp *app)
+{
+       g_return_if_fail (GS_IS_APP (app));
+
+       gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_FLATPAK);
+       gs_app_set_metadata (app, "GnomeSoftware::PackagingBaseCssColor", "accent_bg_color");
+       gs_app_set_metadata (app, "GnomeSoftware::PackagingIcon", "flatpak-symbolic");
+}
diff --git a/plugins/flatpak/gs-flatpak-utils.h b/plugins/flatpak/gs-flatpak-utils.h
index 1f1fa3689..8275828af 100644
--- a/plugins/flatpak/gs-flatpak-utils.h
+++ b/plugins/flatpak/gs-flatpak-utils.h
@@ -19,5 +19,6 @@ GsApp         *gs_flatpak_app_new_from_remote         (GsPlugin       *plugin,
 GsApp          *gs_flatpak_app_new_from_repo_file      (GFile          *file,
                                                         GCancellable   *cancellable,
                                                         GError         **error);
+void            gs_flatpak_app_set_packaging_info      (GsApp          *app);
 
 G_END_DECLS
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 15118c7c1..619eab041 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -80,7 +80,7 @@ gs_flatpak_claim_app (GsFlatpak *self, GsApp *app)
                return;
 
        gs_app_set_management_plugin (app, self->plugin);
-       gs_app_set_bundle_kind (app, AS_BUNDLE_KIND_FLATPAK);
+       gs_flatpak_app_set_packaging_info (app);
 
        /* only when we have a non-temp object */
        if ((self->flags & GS_FLATPAK_FLAG_IS_TEMPORARY) == 0) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]