From: Christian Persch Date: Mon, 26 Jan 2009 20:30:48 +0000 (+0000) Subject: Move metadata manager initialisation and shutdown into EvApplication. X-Git-Tag: EVINCE_2_25_90~21 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=df2a098c49bdaf1e2e0ef7483074b00376e5495e;p=evince.git Move metadata manager initialisation and shutdown into EvApplication. * 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 --- diff --git a/ChangeLog b/ChangeLog index d5ae603d..e6807227 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-01-26 Christian Persch + + * 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 * shell/ev-metadata-manager.c: (ev_metadata_manager_set_string): Don't diff --git a/shell/ev-application.c b/shell/ev-application.c index 4164d0b9..3a099f32 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -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 (); } diff --git a/shell/main.c b/shell/main.c index 60f92c77..0ddf56f3 100644 --- a/shell/main.c +++ b/shell/main.c @@ -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 ();