[gnome-software/misc-patches: 3/3] lib: Set GnomeSoftware::Creator metadata more




commit e0c768b25baad28296422db7377dd7f989e421ca
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Tue Mar 22 17:41:55 2022 -0700

    lib: Set GnomeSoftware::Creator metadata more
    
    This is already set elsewhere, just set it on one more code path. This
    change is not specifically needed for anything.

 lib/gs-appstream.c                 | 5 ++++-
 lib/gs-appstream.h                 | 3 ++-
 plugins/core/gs-plugin-appstream.c | 3 ++-
 plugins/flatpak/gs-flatpak.c       | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
index 4188c8581..b0aea1f3e 100644
--- a/lib/gs-appstream.c
+++ b/lib/gs-appstream.c
@@ -1444,7 +1444,8 @@ gs_appstream_search (GsPlugin *plugin,
 }
 
 gboolean
-gs_appstream_add_category_apps (XbSilo *silo,
+gs_appstream_add_category_apps (GsPlugin *plugin,
+                               XbSilo *silo,
                                GsCategory *category,
                                GsAppList *list,
                                GCancellable *cancellable,
@@ -1493,6 +1494,8 @@ gs_appstream_add_category_apps (XbSilo *silo,
                        if (id == NULL)
                                continue;
                        app = gs_app_new (id);
+                       gs_app_set_metadata (app, "GnomeSoftware::Creator",
+                                            gs_plugin_get_name (plugin));
                        gs_app_add_quirk (app, GS_APP_QUIRK_IS_WILDCARD);
                        gs_app_list_add (list, app);
                }
diff --git a/lib/gs-appstream.h b/lib/gs-appstream.h
index fbc68a1a4..2900a0c64 100644
--- a/lib/gs-appstream.h
+++ b/lib/gs-appstream.h
@@ -33,7 +33,8 @@ gboolean       gs_appstream_add_categories            (XbSilo         *silo,
                                                         GPtrArray      *list,
                                                         GCancellable   *cancellable,
                                                         GError         **error);
-gboolean        gs_appstream_add_category_apps         (XbSilo         *silo,
+gboolean        gs_appstream_add_category_apps         (GsPlugin       *plugin,
+                                                        XbSilo         *silo,
                                                         GsCategory     *category,
                                                         GsAppList      *list,
                                                         GCancellable   *cancellable,
diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
index e3ae50965..77f3cbc7e 100644
--- a/plugins/core/gs-plugin-appstream.c
+++ b/plugins/core/gs-plugin-appstream.c
@@ -1340,7 +1340,8 @@ gs_plugin_add_category_apps (GsPlugin *plugin,
                return FALSE;
 
        locker = g_rw_lock_reader_locker_new (&self->silo_lock);
-       return gs_appstream_add_category_apps (self->silo,
+       return gs_appstream_add_category_apps (plugin,
+                                              self->silo,
                                               category,
                                               list,
                                               cancellable,
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 0dcd211f1..b67bc91e9 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -3985,7 +3985,7 @@ gs_flatpak_add_category_apps (GsFlatpak *self,
                return FALSE;
 
        locker = g_rw_lock_reader_locker_new (&self->silo_lock);
-       return gs_appstream_add_category_apps (self->silo,
+       return gs_appstream_add_category_apps (self->plugin, self->silo,
                                               category, list,
                                               cancellable, error);
 }


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