[gnome-software/wip/setup-shell-only-after-plugin-loader-is-setup: 62/62] gs-application: Setup the shell only after the plugin loader is setup




commit 25930c5f79f3a3d96d26ea47bec7d67e2918a808
Author: Milan Crha <mcrha redhat com>
Date:   Wed May 25 12:07:35 2022 +0200

    gs-application: Setup the shell only after the plugin loader is setup
    
    Setup the shell only after the plugin loader finished its setup,
    thus all plugins are loaded and ready for the jobs.

 src/gs-application.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-application.c b/src/gs-application.c
index 684bb3e2c..83aea790a 100644
--- a/src/gs-application.c
+++ b/src/gs-application.c
@@ -1048,12 +1048,9 @@ gs_application_startup (GApplication *application)
                                                         G_CALLBACK (gs_application_shell_loaded_cb),
                                                         app);
 
-       gs_shell_setup (app->shell, app->plugin_loader, app->cancellable);
        app->main_window = GTK_WINDOW (app->shell);
        gtk_application_add_window (GTK_APPLICATION (app), app->main_window);
 
-       app->update_monitor = gs_update_monitor_new (app, app->plugin_loader);
-
        gs_application_update_software_sources_presence (application);
 
        /* Remove possibly obsolete notifications */
@@ -1079,6 +1076,7 @@ startup_cb (GObject      *source_object,
             GAsyncResult *result,
             gpointer      user_data)
 {
+       GsApplication *app = GS_APPLICATION (user_data);
        GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
        g_autoptr(GError) local_error = NULL;
 
@@ -1091,6 +1089,11 @@ startup_cb (GObject      *source_object,
 
        /* show the priority of each plugin */
        gs_plugin_loader_dump_state (plugin_loader);
+
+       /* Setup the shell only after the plugin loader finished its setup,
+          thus all plugins are loaded and ready for the jobs. */
+       gs_shell_setup (app->shell, app->plugin_loader, app->cancellable);
+       app->update_monitor = gs_update_monitor_new (app, app->plugin_loader);
 }
 
 static void


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