[gnome-software: 1/20] gs-application: Move a callback method to a more logical position




commit f3d9f6a55d58b0affc2752c168a20dfc909cc2f2
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Mar 7 13:19:35 2022 +0000

    gs-application: Move a callback method to a more logical position
    
    So its code can be read directly after the code from the function which
    schedules it.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>
    
    Helps: #1670

 src/gs-application.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index b7e8d0439..ab1f2439b 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -401,20 +401,6 @@ reboot_failed_cb (GObject *source, GAsyncResult *res, gpointer user_data)
                                            app);
 }
 
-static void
-offline_update_cb (GsPluginLoader *plugin_loader,
-                  GAsyncResult *res,
-                  GsApplication *app)
-{
-       g_autoptr(GError) error = NULL;
-       if (!gs_plugin_loader_job_action_finish (plugin_loader, res, &error)) {
-               g_warning ("Failed to trigger offline update: %s", error->message);
-               return;
-       }
-
-       gs_utils_invoke_reboot_async (NULL, reboot_failed_cb, app);
-}
-
 static void
 reboot_activated (GSimpleAction *action,
                   GVariant      *parameter,
@@ -432,6 +418,10 @@ shutdown_activated (GSimpleAction *action,
        g_application_quit (G_APPLICATION (app));
 }
 
+static void offline_update_cb (GsPluginLoader *plugin_loader,
+                               GAsyncResult   *res,
+                               GsApplication  *app);
+
 static void
 reboot_and_install (GSimpleAction *action,
                    GVariant      *parameter,
@@ -447,6 +437,20 @@ reboot_and_install (GSimpleAction *action,
                                            app);
 }
 
+static void
+offline_update_cb (GsPluginLoader *plugin_loader,
+                  GAsyncResult *res,
+                  GsApplication *app)
+{
+       g_autoptr(GError) error = NULL;
+       if (!gs_plugin_loader_job_action_finish (plugin_loader, res, &error)) {
+               g_warning ("Failed to trigger offline update: %s", error->message);
+               return;
+       }
+
+       gs_utils_invoke_reboot_async (NULL, reboot_failed_cb, app);
+}
+
 static void
 quit_activated (GSimpleAction *action,
                GVariant      *parameter,


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