[gnome-software/gnome-3-22] trivial: Mocve the 'OS Update' virtual app creation



commit 9182bd73d4fdeb964261acef83463b8da1e68943
Author: Richard Hughes <richard hughsie com>
Date:   Fri Oct 21 16:33:40 2016 +0100

    trivial: Mocve the 'OS Update' virtual app creation
    
    (cherry picked from commit c8ca0c44d12f6c124a8c27771f4b9ede0604502e)

 src/gs-plugin-loader.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 37d4953..5011da1 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -640,8 +640,6 @@ out:
        return ret;
 }
 
-static void gs_plugin_loader_add_os_update_item (GsAppList *list);
-
 static GsAppList *
 gs_plugin_loader_run_results (GsPluginLoader *plugin_loader,
                              const gchar *function_name,
@@ -723,19 +721,6 @@ gs_plugin_loader_run_results (GsPluginLoader *plugin_loader,
        if (!ret)
                return NULL;
 
-       /* coalesce all packages down into one os-update */
-       if (g_strcmp0 (function_name, "gs_plugin_add_updates") == 0) {
-               gs_plugin_loader_add_os_update_item (list);
-               ret = gs_plugin_loader_run_refine (plugin_loader,
-                                                  function_name,
-                                                  list,
-                                                  GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
-                                                  cancellable,
-                                                  error);
-               if (!ret)
-                       return NULL;
-       }
-
        return g_steal_pointer (&list);
 }
 
@@ -1149,6 +1134,7 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
        GsPluginLoaderAsyncState *state = (GsPluginLoaderAsyncState *) task_data;
        GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (object);
        GError *error = NULL;
+       gboolean ret;
 
        /* do things that would block */
        if ((state->flags & GS_PLUGIN_REFINE_FLAGS_USE_HISTORY) > 0)
@@ -1164,6 +1150,19 @@ gs_plugin_loader_get_updates_thread_cb (GTask *task,
                return;
        }
 
+       /* add OS Update item if required */
+       gs_plugin_loader_add_os_update_item (state->list);
+       ret = gs_plugin_loader_run_refine (plugin_loader,
+                                          "gs_plugin_add_updates_*",
+                                          state->list,
+                                          GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
+                                          cancellable,
+                                          &error);
+       if (!ret) {
+               g_task_return_error (task, error);
+               return;
+       }
+
        /* remove any apps that are not proper applications or OS updates */
        gs_app_list_filter (state->list,
                            gs_plugin_loader_app_is_valid_updatable, state);


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