[gthumb] set the application in the browser constructor



commit e15abd30e8c665274d8f6ef3bd0a089faa4cf160
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Oct 27 20:04:03 2011 +0200

    set the application in the browser constructor

 gthumb/gth-browser.c |    1 +
 gthumb/main.c        |   14 +++++---------
 gthumb/main.h        |    2 ++
 3 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 1f69e5c..2380f59 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -4613,6 +4613,7 @@ gth_browser_new (GFile *location)
 					      "n-pages", GTH_BROWSER_N_PAGES,
 					      NULL);
 	_gth_browser_construct (browser, location);
+	gtk_window_set_application (GTK_WINDOW (browser), GThumb_Application);
 	browser_list = g_list_prepend (browser_list, browser);
 
 	return (GtkWidget*) browser;
diff --git a/gthumb/main.c b/gthumb/main.c
index 5d19d0b..96b6206 100644
--- a/gthumb/main.c
+++ b/gthumb/main.c
@@ -49,11 +49,11 @@ int      ClutterInitResult = CLUTTER_INIT_ERROR_UNKNOWN;
 #endif
 
 
-static GtkApplication  *gthumb_application;
-static char           **remaining_args;
-static const char      *program_argv0; /* argv[0] from main(); used as the command to restart the program */
-static gboolean         Restart = FALSE;
-static gboolean         version = FALSE;
+GtkApplication     *GThumb_Application;
+static char       **remaining_args;
+static const char  *program_argv0; /* argv[0] from main(); used as the command to restart the program */
+static gboolean     Restart = FALSE;
+static gboolean     version = FALSE;
 
 
 static const GOptionEntry options[] = {
@@ -245,7 +245,6 @@ gth_restore_session (EggSMClient *client)
 
 		file = g_file_new_for_uri (location);
 		window = gth_browser_new (file);
-		gtk_window_set_application (GTK_WINDOW (window), gthumb_application);
 		gtk_widget_show (window);
 
 		g_object_unref (file);
@@ -271,7 +270,6 @@ gthumb_application_activate_cb (GApplication *application,
 	}
 	else {
 		window = gth_browser_new (NULL);
-		gtk_window_set_application (GTK_WINDOW (window), GTK_APPLICATION (application));
 		gtk_widget_show (window);
 	}
 }
@@ -284,7 +282,6 @@ open_browser_window (GFile *location,
 	GtkWidget *window;
 
 	window = gth_browser_new (location);
-	gtk_window_set_application (GTK_WINDOW (window), gthumb_application);
 	if (! StartSlideshow)
 		gtk_window_present (GTK_WINDOW (window));
 }
@@ -296,7 +293,6 @@ import_photos_from_location (GFile *location)
 	GtkWidget *window;
 
 	window = gth_browser_new (NULL);
-	gtk_window_set_application (GTK_WINDOW (window), gthumb_application);
 	gth_hook_invoke ("import-photos", window, location, NULL);
 }
 
diff --git a/gthumb/main.h b/gthumb/main.h
index 68067ea..0f7c061 100644
--- a/gthumb/main.h
+++ b/gthumb/main.h
@@ -33,6 +33,8 @@ extern gboolean ImportPhotos;
 extern int ClutterInitResult;
 #endif
 
+extern GtkApplication *GThumb_Application;
+
 void gth_quit (gboolean restart);
 
 G_END_DECLS



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