[gedit/wip/gtkapp] Move more code to startup/shutdown
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/gtkapp] Move more code to startup/shutdown
- Date: Tue, 31 Jul 2012 13:26:50 +0000 (UTC)
commit b3229bb67a8c72c46ee4669a58e28c69770b4b73
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Jul 31 15:26:37 2012 +0200
Move more code to startup/shutdown
gedit/gedit-app.c | 24 ++++++++++++++++++++++++
gedit/gedit.c | 24 ------------------------
2 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index ef9c90b..a9d170a 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -90,6 +90,11 @@ struct _GeditAppPrivate
GSettings *window_settings;
PeasExtensionSet *extensions;
+
+#ifndef ENABLE_GVFS_METADATA
+ const gchar *cache_dir;
+ gchar *metadata_filename;
+#endif
};
static GeditApp *app_instance = NULL;
@@ -360,6 +365,8 @@ gedit_app_startup (GApplication *application)
G_APPLICATION_CLASS (gedit_app_parent_class)->startup (application);
+ gedit_dirs_init ();
+
gedit_debug_message (DEBUG_APP, "Set icon");
dir = gedit_dirs_get_gedit_data_dir ();
@@ -367,6 +374,17 @@ gedit_app_startup (GApplication *application)
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), icon_dir);
g_free (icon_dir);
+
+#ifndef ENABLE_GVFS_METADATA
+ /* Setup metadata-manager */
+ cache_dir = gedit_dirs_get_user_cache_dir ();
+
+ metadata_filename = g_build_filename (cache_dir, METADATA_FILE, NULL);
+
+ gedit_metadata_manager_init (metadata_filename);
+
+ g_free (metadata_filename);
+#endif
}
static void
@@ -788,6 +806,12 @@ gedit_app_shutdown (GApplication *app)
save_page_setup (GEDIT_APP (app));
save_print_settings (GEDIT_APP (app));
+#ifndef ENABLE_GVFS_METADATA
+ gedit_metadata_manager_shutdown ();
+#endif
+
+ gedit_dirs_shutdown ();
+
G_APPLICATION_CLASS (gedit_app_parent_class)->shutdown (app);
}
diff --git a/gedit/gedit.c b/gedit/gedit.c
index dc9f98b..476336e 100644
--- a/gedit/gedit.c
+++ b/gedit/gedit.c
@@ -56,11 +56,6 @@ main (int argc, char *argv[])
const gchar *dir;
gint status;
-#ifndef ENABLE_GVFS_METADATA
- const gchar *cache_dir;
- gchar *metadata_filename;
-#endif
-
/* Init type system as soon as possible */
g_type_init ();
@@ -71,25 +66,12 @@ main (int argc, char *argv[])
/* Setup locale/gettext */
setlocale (LC_ALL, "");
- gedit_dirs_init ();
-
dir = gedit_dirs_get_gedit_locale_dir ();
bindtextdomain (GETTEXT_PACKAGE, dir);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
-#ifndef ENABLE_GVFS_METADATA
- /* Setup metadata-manager */
- cache_dir = gedit_dirs_get_user_cache_dir ();
-
- metadata_filename = g_build_filename (cache_dir, METADATA_FILE, NULL);
-
- gedit_metadata_manager_init (metadata_filename);
-
- g_free (metadata_filename);
-#endif
-
/* Init plugins en thegine */
gedit_debug_message (DEBUG_APP, "Init plugins");
engine = gedit_plugins_engine_get_default ();
@@ -102,12 +84,6 @@ main (int argc, char *argv[])
g_object_unref (app);
g_object_unref (engine);
- gedit_dirs_shutdown ();
-
-#ifndef ENABLE_GVFS_METADATA
- gedit_metadata_manager_shutdown ();
-#endif
-
return status;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]