[sound-juicer] Move all initialization to startup_cb



commit e35f42d5b008c226b87b3b980647e07ce30ebe6e
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Wed Jan 25 18:38:50 2017 +0000

    Move all initialization to startup_cb
    
    Move as much initialization as possible to startup_cb() so it is only
    performed when necessary.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777785

 src/sj-main.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/sj-main.c b/src/sj-main.c
index a0801c7..d1f3abf 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -1788,6 +1788,12 @@ startup_cb (GApplication *app, gpointer user_data)
   GtkTreeSelection *selection;
   GError *error = NULL;
 
+  g_setenv ("PULSE_PROP_media.role", "music", TRUE);
+
+  sj_debug_init ();
+
+  gtk_window_set_default_icon_name ("sound-juicer");
+
   brasero_media_library_start ();
 
   metadata = sj_metadata_getter_new ();
@@ -2135,7 +2141,6 @@ int main (int argc, char **argv)
   textdomain (PACKAGE);
 
   g_set_application_name (_("Sound Juicer"));
-  g_setenv ("PULSE_PROP_media.role", "music", TRUE);
 
   ctx = g_option_context_new (N_("- Extract music from your CDs"));
   g_option_context_add_main_entries (ctx, entries, PACKAGE);
@@ -2152,10 +2157,6 @@ int main (int argc, char **argv)
   }
   g_option_context_free (ctx);
 
-  sj_debug_init ();
-
-  gtk_window_set_default_icon_name ("sound-juicer");
-
   app = gtk_application_new ("org.gnome.sound-juicer",
                              G_APPLICATION_FLAGS_NONE);
 


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