[gnome-software/wip/iainl/ubuntu-xenial] Add a separate flag for refreshing just the UI
- From: William Hua <williamhua src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/iainl/ubuntu-xenial] Add a separate flag for refreshing just the UI
- Date: Wed, 20 Apr 2016 11:41:09 +0000 (UTC)
commit ca63436b045f3928538c5d83b745022498f7d641
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 fc07453..035b348 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/gs-plugin.h b/src/gs-plugin.h
index 71bd19f..731a219 100644
--- a/src/gs-plugin.h
+++ b/src/gs-plugin.h
@@ -118,6 +118,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 5c5f258..159f0a4 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -78,9 +78,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]