[gnome-software] Do not refresh all appliation state when a shell extension changes



commit fa9ec240c781ab45e60aaf6c58a0088b87335ed6
Author: Richard Hughes <richard hughsie com>
Date:   Sun Jun 12 09:16:15 2016 +0100

    Do not refresh all appliation state when a shell extension changes

 src/plugins/gs-plugin-shell-extensions.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-shell-extensions.c b/src/plugins/gs-plugin-shell-extensions.c
index 104cde4..801584b 100644
--- a/src/plugins/gs-plugin-shell-extensions.c
+++ b/src/plugins/gs-plugin-shell-extensions.c
@@ -221,8 +221,33 @@ gs_plugin_shell_extensions_changed_cb (GDBusProxy *proxy,
                                       GsPlugin *plugin)
 {
        if (g_strcmp0 (signal_name, "ExtensionStatusChanged") == 0) {
-               /* FIXME: we want to only reload specific GsApps */
-               gs_plugin_reload (plugin);
+               AsAppState st;
+               GsApp *app;
+               const gchar *error_str;
+               const gchar *uuid;
+               guint state;
+
+               /* get what changed */
+               g_variant_get (parameters, "(&si&s)",
+                              &uuid, &state, &error_str);
+
+               /* find it in the cache; do we care? */
+               app = gs_plugin_cache_lookup (plugin, uuid);
+               if (app == NULL) {
+                       g_warning ("no app for changed %s", uuid);
+                       return;
+               }
+
+               /* set the new state in the UI */
+               st = gs_plugin_shell_extensions_convert_state (state);
+               gs_app_set_state (app, st);
+
+               /* not sure what to do here */
+               if (error_str != NULL) {
+                       g_warning ("%s has error: %s",
+                                  gs_app_get_id (app),
+                                  error_str);
+               }
        }
 }
 


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