]> www.fi.muni.cz Git - evince.git/commitdiff
Move metadata manager initialisation and shutdown into EvApplication.
authorChristian Persch <chpe@src.gnome.org>
Mon, 26 Jan 2009 20:30:48 +0000 (20:30 +0000)
committerChristian Persch <chpe@src.gnome.org>
Mon, 26 Jan 2009 20:30:48 +0000 (20:30 +0000)
* 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.

svn path=/trunk/; revision=3386

ChangeLog
shell/ev-application.c
shell/main.c

index d5ae603df372e626d6531c939a1fa0a6af82afe5..e68072276d6f263bf39608a113eb043c3dea8ba4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-26  Christian Persch  <chpe@gnome.org>
+
+       * 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.
+
 2009-01-26  Christian Persch  <chpe@gnome.org>
 
        * shell/ev-metadata-manager.c: (ev_metadata_manager_set_string): Don't
index 4164d0b92c57a26729e955a8033d6d1094ad6a66..3a099f3218170b4cb553fc2c351b27bc5a38656a 100644 (file)
@@ -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 @@ struct _EvApplicationClass {
        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 @@ ev_application_register_service (EvApplication *application)
                                              G_OBJECT (application));
        
        application->scr_saver = totem_scrsaver_new (connection);
-       
+
+        ev_metadata_manager_init ();
+
        return TRUE;
 }
 #endif /* ENABLE_DBUS */
@@ -149,8 +154,6 @@ ev_application_register_service (EvApplication *application)
 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 @@ ev_application_shutdown (EvApplication *application)
        }
 #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 ();
 }
index 60f92c77ce120e4602673036ba07a934d53aec81..0ddf56f32fff2d54001a769a781146cb85df176a 100644 (file)
@@ -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 @@ main (int argc, char *argv[])
 {
        GOptionContext *context;
        GHashTable *args;
-       gboolean enable_metadata = FALSE;
        GError *error = NULL;
 
        /* Init glib threads asap */
@@ -355,18 +353,12 @@ main (int argc, char *argv[])
 
                        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 @@ main (int argc, char *argv[])
 
        ev_file_helpers_shutdown ();
 
-       if (enable_metadata) {
-               ev_metadata_manager_shutdown ();
-       }
-
        ev_backends_manager_shutdown ();
 
        ev_debug_shutdown ();