[goobox] removed main_application



commit 245154a1930840adac911407bc4f375f8aeadfc3
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Jun 2 21:39:53 2012 +0200

    removed main_application
    
    g_application_get_default serves the same purpose

 src/gth-window.c |    2 --
 src/main.c       |    5 ++---
 src/main.h       |    5 ++---
 3 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/gth-window.c b/src/gth-window.c
index a281521..09ba410 100644
--- a/src/gth-window.c
+++ b/src/gth-window.c
@@ -127,8 +127,6 @@ gth_window_finalize (GObject *object)
 	g_free (window->priv->toolbars);
 	g_free (window->priv->contents);
 
-	gtk_application_remove_window (main_application, GTK_WINDOW (window));
-
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
diff --git a/src/main.c b/src/main.c
index 3e40c64..bd2d483 100644
--- a/src/main.c
+++ b/src/main.c
@@ -52,7 +52,6 @@ gboolean                   notification_supports_actions = FALSE;
 /* -- command line arguments -- */
 
 
-GtkApplication        *main_application = NULL;
 int                    arg_auto_play = FALSE;
 int                    arg_toggle_visibility = FALSE;
 static int             arg_toggle_play = FALSE;
@@ -514,7 +513,7 @@ main (int argc, char *argv[])
 
 	/* run the main application */
 
-	application = main_application = goo_application_new ();
+	application = goo_application_new ();
 	gdk_threads_enter ();
 	status = g_application_run (G_APPLICATION (application), argc, argv);
 	gdk_threads_leave ();
@@ -535,7 +534,7 @@ main_get_window_from_device (const char *device)
 	if (device == NULL)
 		return NULL;
 
-	for (scan = gtk_application_get_windows (main_application); scan; scan = scan->next) {
+	for (scan = gtk_application_get_windows (GTK_APPLICATION (g_application_get_default ())); scan; scan = scan->next) {
 		GooWindow *window = scan->data;
 
 		if (g_strcmp0 (goo_player_get_device (goo_window_get_player (window)), device) == 0)
diff --git a/src/main.h b/src/main.h
index b329ec4..ec6f572 100644
--- a/src/main.h
+++ b/src/main.h
@@ -27,9 +27,8 @@
 #include "goo-player.h"
 #include "goo-window.h"
 
-extern GtkApplication *main_application;
-extern int             arg_auto_play;
-extern int             arg_toggle_visibility;
+extern int arg_auto_play;
+extern int arg_toggle_visibility;
 
 GtkWidget *     main_get_window_from_device  (const char      *device);
 BraseroDrive *  main_get_most_likely_drive   (void);



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