evince r3386 - in trunk: . shell



Author: chpe
Date: Mon Jan 26 20:30:48 2009
New Revision: 3386
URL: http://svn.gnome.org/viewvc/evince?rev=3386&view=rev

Log:
	* shell/ev-application.c: (ev_application_register_service),
	(ev_application_shutdown):
	* shell/main.c: (main): Move metadata manager initialisation and
	shutdown into EvApplication. Follow-up from bug #569120.

Modified:
   trunk/ChangeLog
   trunk/shell/ev-application.c
   trunk/shell/main.c

Modified: trunk/shell/ev-application.c
==============================================================================
--- trunk/shell/ev-application.c	(original)
+++ trunk/shell/ev-application.c	Mon Jan 26 20:30:48 2009
@@ -36,6 +36,7 @@
 #include "ev-application.h"
 #include "ev-document-factory.h"
 #include "ev-file-helpers.h"
+#include "ev-metadata-manager.h"
 #include "ev-utils.h"
 
 #ifdef ENABLE_DBUS
@@ -78,6 +79,8 @@
 	GObjectClass base_class;
 };
 
+static EvApplication *instance;
+
 G_DEFINE_TYPE (EvApplication, ev_application, G_TYPE_OBJECT);
 
 #define APPLICATION_SERVICE_NAME "org.gnome.evince.ApplicationService"
@@ -134,7 +137,9 @@
                                              G_OBJECT (application));
 	
 	application->scr_saver = totem_scrsaver_new (connection);
-	
+
+        ev_metadata_manager_init ();
+
 	return TRUE;
 }
 #endif /* ENABLE_DBUS */
@@ -149,8 +154,6 @@
 EvApplication *
 ev_application_get_instance (void)
 {
-	static EvApplication *instance;
-
 	if (!instance) {
 		instance = EV_APPLICATION (g_object_new (EV_TYPE_APPLICATION, NULL));
 	}
@@ -732,12 +735,15 @@
 	}
 #endif /* ENABLE_DBUS */
 	
+        ev_metadata_manager_shutdown ();
+
         g_free (application->dot_dir);
         application->dot_dir = NULL;
 	g_free (application->last_chooser_uri);
         application->last_chooser_uri = NULL;
 
 	g_object_unref (application);
+        instance = NULL;
 	
 	gtk_main_quit ();
 }

Modified: trunk/shell/main.c
==============================================================================
--- trunk/shell/main.c	(original)
+++ trunk/shell/main.c	Mon Jan 26 20:30:48 2009
@@ -34,7 +34,6 @@
 #include "ev-backends-manager.h"
 #include "ev-debug.h"
 #include "ev-file-helpers.h"
-#include "ev-metadata-manager.h"
 #include "ev-stock-icons.h"
 #include "eggsmclient.h"
 #include "eggdesktopfile.h"
@@ -316,7 +315,6 @@
 {
 	GOptionContext *context;
 	GHashTable *args;
-	gboolean enable_metadata = FALSE;
 	GError *error = NULL;
 
 	/* Init glib threads asap */
@@ -355,18 +353,12 @@
 
 			return 0;
 		}
-	} else {
-		enable_metadata = TRUE;
 	}
 #endif /* ENABLE_DBUS */
 
 	ev_debug_init ();
 	ev_backends_manager_init ();
 	
-	if (enable_metadata) {
-		ev_metadata_manager_init ();
-	}
-
 	ev_file_helpers_init ();
 	ev_stock_icons_init ();
 	
@@ -380,10 +372,6 @@
 
 	ev_file_helpers_shutdown ();
 
-	if (enable_metadata) {
-		ev_metadata_manager_shutdown ();
-	}
-
 	ev_backends_manager_shutdown ();
 
 	ev_debug_shutdown ();



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