[gnome-software] Introduce a flag to get historical data



commit 7b75e96fa4f3f72af159c287c78b0f527c991f3b
Author: Richard Hughes <richard hughsie com>
Date:   Thu Sep 12 14:58:37 2013 +0100

    Introduce a flag to get historical data
    
    We'll use this to get the offline update review window.

 src/gs-plugin-loader.c |    6 +++++-
 src/gs-plugin-loader.h |    1 +
 src/gs-shell-updates.c |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 1441986..afd684f 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -475,13 +475,17 @@ cd_plugin_loader_get_updates_thread_cb (GSimpleAsyncResult *res,
                                        GObject *object,
                                        GCancellable *cancellable)
 {
+       const gchar *method_name = "gs_plugin_add_updates";
        GError *error = NULL;
        GsPluginLoaderAsyncState *state = (GsPluginLoaderAsyncState *) g_object_get_data (G_OBJECT 
(cancellable), "state");
        GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (object);
 
        /* do things that would block */
+       if ((state->flags & GS_PLUGIN_LOADER_FLAGS_USE_HISTORY) > 0)
+               method_name = "gs_plugin_add_updates_historical";
+
        state->list = gs_plugin_loader_run_results (plugin_loader,
-                                                   "gs_plugin_add_updates",
+                                                   method_name,
                                                    cancellable,
                                                    &error);
        if (state->list == NULL) {
diff --git a/src/gs-plugin-loader.h b/src/gs-plugin-loader.h
index 12a800a..57ea470 100644
--- a/src/gs-plugin-loader.h
+++ b/src/gs-plugin-loader.h
@@ -63,6 +63,7 @@ typedef enum
 
 typedef enum {
        GS_PLUGIN_LOADER_FLAGS_NONE = 0,
+       GS_PLUGIN_LOADER_FLAGS_USE_HISTORY = 1,
        GS_PLUGIN_LOADER_FLAGS_LAST
 } GsPluginLoaderFlags;
 
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index f4390a7..144239c 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -172,7 +172,7 @@ gs_shell_updates_refresh (GsShellUpdates *shell_updates,
        gs_container_remove_all (GTK_CONTAINER (priv->list_box_updates));
 
        gs_plugin_loader_get_updates_async (priv->plugin_loader,
-                                           GS_PLUGIN_LOADER_FLAGS_NONE,
+                                           show_historical ? GS_PLUGIN_LOADER_FLAGS_USE_HISTORY : 
GS_PLUGIN_LOADER_FLAGS_NONE,
                                            priv->cancellable,
                                            (GAsyncReadyCallback) gs_shell_updates_get_updates_cb,
                                            shell_updates);


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