[gnome-software] Allow specifing the plugin to use in the local AppStream cache



commit b4440ae46a5f031fac130e880daa52e696bd405c
Author: Richard Hughes <richard hughsie com>
Date:   Wed Mar 23 12:37:37 2016 +0000

    Allow specifing the plugin to use in the local AppStream cache

 src/plugins/gs-appstream.c    |    7 +++++++
 src/plugins/gs-plugin-steam.c |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-appstream.c b/src/plugins/gs-appstream.c
index 6c598e9..d7132d1 100644
--- a/src/plugins/gs-appstream.c
+++ b/src/plugins/gs-appstream.c
@@ -319,6 +319,13 @@ gs_refine_item_management_plugin (GsApp *app, AsApp *item)
        const gchar *runtime = NULL;
        guint i;
 
+       /* allow override */
+       management_plugin = as_app_get_metadata_item (item, "GnomeSoftware::Plugin");
+       if (management_plugin != NULL) {
+               gs_app_set_management_plugin (app, management_plugin);
+               return;
+       }
+
        /* find the default bundle kind */
        bundles = as_app_get_bundles (item);
        for (i = 0; i < bundles->len; i++) {
diff --git a/src/plugins/gs-plugin-steam.c b/src/plugins/gs-plugin-steam.c
index cd11f1d..46f0494 100644
--- a/src/plugins/gs-plugin-steam.c
+++ b/src/plugins/gs-plugin-steam.c
@@ -562,6 +562,7 @@ gs_plugin_steam_update_store_app (GsPlugin *plugin,
        /* this is for the GNOME Software plugin */
        gameid_str = g_strdup_printf ("%" G_GUINT32_FORMAT, gameid);
        as_app_add_metadata (item, "X-Steam-GameID", gameid_str);
+       as_app_add_metadata (item, "GnomeSoftware::Plugin", "steam");
 
        /* ban certains apps based on the name */
        if (g_strstr_len (name, -1, "Dedicated Server") != NULL)


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