[gitg] Move code to startup



commit a6d5fcf49ae1b6c956253fefc50400dc1dcb3e26
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Feb 20 20:24:30 2013 +0100

    Move code to startup

 gitg/gitg-application.vala |   39 ++++++++++++++-------------------------
 1 files changed, 14 insertions(+), 25 deletions(-)
---
diff --git a/gitg/gitg-application.vala b/gitg/gitg-application.vala
index 072c996..66cc0df 100644
--- a/gitg/gitg-application.vala
+++ b/gitg/gitg-application.vala
@@ -41,7 +41,6 @@ public class Application : Gtk.Application
        {
                public static bool quit = false;
                public static string view;
-               public static bool startup = false;
                public static bool no_wd = false;
                public static ApplicationCommandLine command_line;
 
@@ -148,12 +147,6 @@ public class Application : Gtk.Application
 
                Options.command_line = cmd;
 
-               if (Options.startup)
-               {
-                       app_init();
-                       Options.startup = false;
-               }
-
                if (argv.length > 1)
                {
                        File[] files = new File[argv.length - 1];
@@ -286,13 +279,24 @@ public class Application : Gtk.Application
 
        protected override void startup()
        {
+               base.startup();
+
                d_state_settings = new Settings("org.gnome.gitg.state.window");
                d_state_settings.delay();
 
-               Options.startup = true;
-               base.startup();
-
                setup_menus();
+
+               Gtk.CssProvider? provider = Resource.load_css("style.css");
+
+               if (provider != null)
+               {
+                       Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
+                                                                provider,
+                                                                600);
+               }
+
+               var theme = Gtk.IconTheme.get_default();
+               theme.prepend_search_path(Path.build_filename(Config.GITG_DATADIR, "icons"));
        }
 
        protected override void shutdown()
@@ -401,21 +405,6 @@ public class Application : Gtk.Application
                }
        }
 
-       private void app_init()
-       {
-               Gtk.CssProvider? provider = Resource.load_css("style.css");
-
-               if (provider != null)
-               {
-                       Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
-                                                                provider,
-                                                                600);
-               }
-
-               var theme = Gtk.IconTheme.get_default();
-               theme.prepend_search_path(Path.build_filename(Config.GITG_DATADIR, "icons"));
-       }
-
        private void new_window(Repository? repo = null, string? hint = null)
        {
                Window.create_new(this, repo, hint);


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