[gnome-software] trivial: Correctly show the installed status of shell extensions



commit ac7b9bd21351ae03174d0ba1b1a38865ece895c8
Author: Richard Hughes <richard hughsie com>
Date:   Sun Jun 12 09:27:20 2016 +0100

    trivial: Correctly show the installed status of shell extensions

 src/plugins/gs-plugin-shell-extensions.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-shell-extensions.c b/src/plugins/gs-plugin-shell-extensions.c
index 801584b..c1ec33d 100644
--- a/src/plugins/gs-plugin-shell-extensions.c
+++ b/src/plugins/gs-plugin-shell-extensions.c
@@ -341,6 +341,8 @@ gs_plugin_refine_app (GsPlugin *plugin,
                      GCancellable *cancellable,
                      GError **error)
 {
+       const gchar *uuid;
+
        /* only process this these kinds */
        if (gs_app_get_kind (app) != AS_APP_KIND_SHELL_EXTENSION)
                return TRUE;
@@ -349,6 +351,17 @@ gs_plugin_refine_app (GsPlugin *plugin,
        if (gs_app_get_management_plugin (app) == NULL)
                gs_app_set_management_plugin (app, gs_plugin_get_name (plugin));
 
+       /* can we get the AppStream-created app state using the cache */
+       uuid = gs_app_get_metadata_item (app, "shell-extensions::uuid");
+       if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN) {
+               GsApp *app_cache = gs_plugin_cache_lookup (plugin, uuid);
+               if (app_cache != NULL) {
+                       g_debug ("copy cached state for %s",
+                                gs_app_get_id (app));
+                       gs_app_set_state (app, gs_app_get_state (app_cache));
+               }
+       }
+
        /* assume apps are available if they exist in AppStream metadata */
        if (gs_app_get_state (app) == AS_APP_STATE_UNKNOWN)
                gs_app_set_state (app, AS_APP_STATE_AVAILABLE);


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