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



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

    trivial: Mocve the 'OS Update' virtual app creation

 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 bbcd4e0..41d835c 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -735,8 +735,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,
                              GsPluginAction action,
@@ -825,19 +823,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);
 }
 
@@ -1257,6 +1242,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)
@@ -1273,6 +1259,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]