[gnome-builder/wip/greeter] app: use new greeter window



commit 9045d4a3c08ac7c3cb6d923efa49cff5afb57414
Author: Christian Hergert <christian hergert me>
Date:   Sun May 10 16:46:15 2015 -0700

    app: use new greeter window

 src/app/gb-application-private.h |    2 ++
 src/app/gb-application.c         |   20 +++++++++-----------
 2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/app/gb-application-private.h b/src/app/gb-application-private.h
index 7a77eb3..c4b9e0d 100644
--- a/src/app/gb-application-private.h
+++ b/src/app/gb-application-private.h
@@ -21,6 +21,7 @@
 
 #include <gtk/gtk.h>
 #include <gio/gio.h>
+#include <ide.h>
 
 #include "gb-keybindings.h"
 #include "gb-preferences-window.h"
@@ -34,6 +35,7 @@ struct _GbApplication
   GDateTime           *started_at;
   GbKeybindings       *keybindings;
   GbPreferencesWindow *preferences_window;
+  IdeRecentProjects   *recent_projects;
 };
 
 
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 938469e..a0a74fc 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -439,25 +439,22 @@ gb_application_show_projects_window (GbApplication *self)
 
   for (; windows; windows = windows->next)
     {
-      if (GB_IS_PROJECTS_DIALOG (windows->data))
+      if (GB_IS_GREETER_WINDOW (windows->data))
         {
           gtk_window_present (windows->data);
           return;
         }
     }
 
-#if 1
-  IdeRecentProjects *projects = ide_recent_projects_new ();
-  window = g_object_new (GB_TYPE_GREETER_WINDOW,
-                         "application", self,
-                         "recent-projects", projects,
-                         NULL);
-  gtk_window_present (GTK_WINDOW (window));
-  ide_recent_projects_discover_async (projects, NULL, NULL, NULL);
-#endif
+  if (self->recent_projects == NULL)
+    {
+      self->recent_projects = ide_recent_projects_new ();
+      ide_recent_projects_discover_async (self->recent_projects, NULL, NULL, NULL);
+    }
 
-  window = g_object_new (GB_TYPE_PROJECTS_DIALOG,
+  window = g_object_new (GB_TYPE_GREETER_WINDOW,
                          "application", self,
+                         "recent-projects", self->recent_projects,
                          NULL);
   gtk_window_present (GTK_WINDOW (window));
 }
@@ -534,6 +531,7 @@ gb_application_finalize (GObject *object)
 
   g_clear_pointer (&self->started_at, g_date_time_unref);
   g_clear_object (&self->keybindings);
+  g_clear_object (&self->recent_projects);
 
   G_OBJECT_CLASS (gb_application_parent_class)->finalize (object);
 


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