[gnome-media] Don't go single-instance when in debug mode



commit 0d079ba863d8cc0d2fcdb8c664681f15a8ea2702
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Aug 13 12:15:32 2009 +0100

    Don't go single-instance when in debug mode
    
    Makes it easier to debug the applet.

 gnome-volume-control/src/applet-main.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/gnome-volume-control/src/applet-main.c b/gnome-volume-control/src/applet-main.c
index b64c01a..c7d7b6e 100644
--- a/gnome-volume-control/src/applet-main.c
+++ b/gnome-volume-control/src/applet-main.c
@@ -44,7 +44,7 @@ main (int argc, char **argv)
 {
         GError             *error;
         GvcApplet          *applet;
-        UniqueApp          *app;
+        UniqueApp          *app = NULL;
         static GOptionEntry entries[] = {
                 { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
                 { "version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_("Version of this application"), NULL },
@@ -55,7 +55,7 @@ main (int argc, char **argv)
         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
         textdomain (GETTEXT_PACKAGE);
 
-	gvc_log_init ();
+        gvc_log_init ();
 
         error = NULL;
         gtk_init_with_args (&argc, &argv,
@@ -73,12 +73,14 @@ main (int argc, char **argv)
                 exit (1);
         }
 
-	gvc_log_set_debug (debug);
+        gvc_log_set_debug (debug);
 
-        app = unique_app_new (GVCA_DBUS_NAME, NULL);
-        if (unique_app_is_running (app)) {
-                g_warning ("Applet is already running, exiting");
-                return 0;
+        if (debug == FALSE) {
+                app = unique_app_new (GVCA_DBUS_NAME, NULL);
+                if (unique_app_is_running (app)) {
+                        g_warning ("Applet is already running, exiting");
+                        return 0;
+                }
         }
 
         gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
@@ -92,6 +94,9 @@ main (int argc, char **argv)
         if (applet != NULL) {
                 g_object_unref (applet);
         }
+        if (app != NULL) {
+                g_object_unref (app);
+        }
 
         return 0;
 }



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