[gnome-software/wip/kalev/gnome-3-22: 59/96] trivial: Reduce debug spew when updating flatpak apps



commit 61c3081b61b0aabfe00ddbde0b55385a10dcedab
Author: Richard Hughes <richard hughsie com>
Date:   Mon Feb 20 14:24:02 2017 +0000

    trivial: Reduce debug spew when updating flatpak apps

 src/gs-plugin-loader.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 3a8fefe..1b6b961 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -47,6 +47,7 @@ typedef struct
        AsProfile               *profile;
        SoupSession             *soup_session;
        GPtrArray               *auth_array;
+       GsPluginStatus           global_status_last;
 
        GMutex                   pending_apps_mutex;
        GPtrArray               *pending_apps;
@@ -3477,13 +3478,18 @@ gs_plugin_loader_status_changed_cb (GsPlugin *plugin,
                                    GsPluginStatus status,
                                    GsPluginLoader *plugin_loader)
 {
+       GsPluginLoaderPrivate *priv = gs_plugin_loader_get_instance_private (plugin_loader);
+
        /* nothing specific */
        if (gs_app_get_id (app) == NULL) {
-               g_debug ("emitting global %s",
-                        gs_plugin_status_to_string (status));
-               g_signal_emit (plugin_loader,
-                              signals[SIGNAL_STATUS_CHANGED],
-                              0, app, status);
+               if (priv->global_status_last != status) {
+                       g_debug ("emitting global %s",
+                                gs_plugin_status_to_string (status));
+                       g_signal_emit (plugin_loader,
+                                      signals[SIGNAL_STATUS_CHANGED],
+                                      0, app, status);
+                       priv->global_status_last = status;
+               }
                return;
        }
 


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