[gnome-bluetooth] applet: Port to latest GApplication



commit 256e5dfe41bfa7a66e5d73941d44557c3ed58710
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 27 17:28:07 2010 +0100

    applet: Port to latest GApplication

 applet/main.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/applet/main.c b/applet/main.c
index c131a7e..85f9b92 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -958,7 +958,7 @@ static GOptionEntry options[] = {
 
 int main(int argc, char *argv[])
 {
-	GtkApplication *app;
+	GApplication *app;
 	GtkStatusIcon *statusicon;
 	GtkWidget *menu;
 	GOptionContext *context;
@@ -983,10 +983,18 @@ int main(int argc, char *argv[])
 	}
 
 	if (option_debug == FALSE) {
-		app = gtk_application_new ("org.gnome.Bluetooth.applet",
-					   &argc, &argv);
-		if (g_application_is_remote (G_APPLICATION (app))) {
-			gdk_notify_startup_complete ();
+		GError *error = NULL;
+
+		app = g_application_new ("org.gnome.Bluetooth.applet",
+					 G_APPLICATION_FLAGS_NONE);
+		if (!g_application_register (app, NULL, &error)) {
+			g_object_unref (app);
+			g_warning ("%s", error->message);
+			g_error_free (error);
+			return 1;
+		}
+		if (g_application_get_is_remote (app)) {
+			g_object_unref (app);
 			g_warning ("Applet is already running, exiting");
 			return 0;
 		}



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