[gnome-builder/gnome-builder-3-26] workbench: delay loading preferences until project selected



commit 322283b655e54fced934615bd8ef9753de33be73
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 19 01:47:33 2017 -0700

    workbench: delay loading preferences until project selected
    
    We don't want to waste time loading preferences while the greeter is about
    to be displayed. So this delays that work until we start loading the
    project and have a context set.

 libide/workbench/ide-workbench.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/libide/workbench/ide-workbench.c b/libide/workbench/ide-workbench.c
index 9589238..fdde2db 100644
--- a/libide/workbench/ide-workbench.c
+++ b/libide/workbench/ide-workbench.c
@@ -235,11 +235,6 @@ ide_workbench_constructed (GObject *object)
 
   gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (self), FALSE);
 
-  ide_workbench_add_perspective (self,
-                                 g_object_new (IDE_TYPE_PREFERENCES_PERSPECTIVE,
-                                               "visible", TRUE,
-                                               NULL));
-
   if (self->disable_greeter == FALSE)
     {
       ide_workbench_add_perspective (self,
@@ -677,6 +672,14 @@ ide_workbench_set_context (IdeWorkbench *self,
 
   peas_extension_set_foreach (self->addins, ide_workbench_addin_added, self);
 
+  /* We wait to add the preferences perspective until we have a valid
+   * IdeContext for them to potentially use.
+   */
+  ide_workbench_add_perspective (self,
+                                 g_object_new (IDE_TYPE_PREFERENCES_PERSPECTIVE,
+                                               "visible", TRUE,
+                                               NULL));
+
   g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CONTEXT]);
 
   /*


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