Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--shell/ev-application.c12
-rw-r--r--shell/main.c12
3 files changed, 16 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index d5ae603..e680722 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
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
copy the string twice. Bug #569231.
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 4164d0b..3a099f3 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 60f92c7..0ddf56f 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 ();