[gnome-software/wip/temp/ubuntu-xenial-rebased: 288/329] Add a separate flag for refreshing just the UI



commit 065cfaafa8bb87cc19243742300017342543adfb
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/plugins/gs-plugin-appstream.c |    8 +++++---
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index cad567f..ce13352 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -252,7 +252,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);
@@ -268,7 +268,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/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index 8d3dfe5..ffc9241 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -76,9 +76,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]