[gnome-software/gnome-3-30] Have shell go to LOADING state by itself



commit 1cc875314aa66c20965f3eade64601b8930d5529
Author: Robert McQueen <rob endlessm com>
Date:   Wed Oct 10 15:30:15 2018 +0100

    Have shell go to LOADING state by itself
    
    There isn't any reason to have the shell sit in the UNKNOWN state at setup and
    rely on the GsApplication to initialise it correctly. At the end of setup, have
    the shell start the initial refresh by itself.

 src/gs-application.c | 12 ++++--------
 src/gs-shell.c       |  3 +++
 2 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 9408885a..bfd91f32 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -277,16 +277,12 @@ gs_application_initialize_ui (GsApplication *app)
        app->shell = gs_shell_new ();
        app->cancellable = g_cancellable_new ();
 
+       app->shell_loaded_handler_id = g_signal_connect (app->shell, "loaded",
+                                                        G_CALLBACK (gs_application_shell_loaded_cb),
+                                                        app);
+
        gs_shell_setup (app->shell, app->plugin_loader, app->cancellable);
        gtk_application_add_window (GTK_APPLICATION (app), gs_shell_get_window (app->shell));
-
-        app->shell_loaded_handler_id = g_signal_connect (app->shell, "loaded",
-                                                         G_CALLBACK (gs_application_shell_loaded_cb),
-                                                         app);
-
-       /* it's very important to set the loading as the first mode because it will
-        * make the plugins load all their needed initial catalogs/information */
-       gs_shell_set_mode (app->shell, GS_SHELL_MODE_LOADING);
 }
 
 static void
diff --git a/src/gs-shell.c b/src/gs-shell.c
index e785cab8..8fb4ec28 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -2134,6 +2134,9 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
 
        /* coldplug */
        gs_shell_rescan_events (shell);
+
+       /* show loading page, which triggers the initial refresh */
+       gs_shell_change_mode (shell, GS_SHELL_MODE_LOADING, NULL, TRUE);
 }
 
 void


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