[gnome-software/wip/rancell/ubuntu-3-20-1: 55/72] Add a separate flag for refreshing just the UI



commit 6afede787bc504b392a9f0cf779240480870e9fa
Author: William Hua <william hua canonical com>
Date:   Wed Apr 20 07:33:40 2016 -0400

    Add a separate flag for refreshing just the UI

 src/gs-application.c              |    4 ++--
 src/gs-plugin.h                   |    1 +
 src/plugins/gs-plugin-appstream.c |    8 +++++---
 3 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 09c7459..8cd6ccb 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -254,7 +254,7 @@ refreshed_cb (GObject      *source_object,
        if (gs_plugin_loader_refresh_finish (loader, res, NULL)) {
                gs_plugin_loader_refresh_async (loader,
                                                0,
-                                               GS_PLUGIN_REFRESH_FLAGS_UPDATES,
+                                               GS_PLUGIN_REFRESH_FLAGS_UPDATES | GS_PLUGIN_REFRESH_FLAGS_UI,
                                                NULL,
                                                NULL,
                                                NULL);
@@ -270,7 +270,7 @@ start_refresh (GsApplication *app)
 
        gs_plugin_loader_refresh_async (gs_application_get_plugin_loader (app),
                                        0,
-                                       GS_PLUGIN_REFRESH_FLAGS_UPDATES,
+                                       GS_PLUGIN_REFRESH_FLAGS_UPDATES | GS_PLUGIN_REFRESH_FLAGS_UI,
                                        NULL,
                                        refreshed_cb,
                                        app);
diff --git a/src/gs-plugin.h b/src/gs-plugin.h
index 066f04a..7633f6e 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -119,6 +119,7 @@ typedef enum {
 
 typedef enum {
        GS_PLUGIN_REFRESH_FLAGS_UPDATES                 = 1 << 0,
+       GS_PLUGIN_REFRESH_FLAGS_UI                      = 1 << 1,
        GS_PLUGIN_REFRESH_FLAGS_LAST
 } GsPluginRefreshFlags;
 
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 87a613c..5e35e82 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -77,9 +77,11 @@ gs_plugin_refresh (GsPlugin              *plugin,
                   GCancellable          *cancellable,
                   GError               **error)
 {
-       plugin->priv->done_init = FALSE;
-       gs_plugin_appstream_startup (plugin, NULL);
-       gs_plugin_updates_changed (plugin);
+       if (flags & GS_PLUGIN_REFRESH_FLAGS_UI) {
+               plugin->priv->done_init = FALSE;
+               gs_plugin_appstream_startup (plugin, NULL);
+               gs_plugin_updates_changed (plugin);
+       }
 
        return TRUE;
 }


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