[gnome-terminal] migration: Add --disable-migration configure switch



commit a0cba8ad1a9ced13aef95dc15f4eea11043c0220
Author: Christian Persch <chpe gnome org>
Date:   Wed Jan 23 22:39:46 2013 +0100

    migration: Add --disable-migration configure switch
    
    This allows building without GConf present.

 configure.ac       |   22 +++++++++++++++++-----
 src/Makefile.am    |    4 ++++
 src/terminal-app.c |    6 ++++++
 3 files changed, 27 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ab81bc1..ac9d818 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,11 +116,22 @@ GLIB_GSETTINGS
 
 GCONF_REQUIRED=2.31.3
 
-PKG_CHECK_MODULES([MIGRATOR],[
-  gio-2.0 >= $GIO_REQUIRED
-  vte$VTE_PC_VERSION >= $VTE_REQUIRED
-  gconf-2.0 >= $GCONF_REQUIRED
-  uuid])
+AC_MSG_CHECKING([whether to build the GConf to GSettings migrator])
+AC_ARG_ENABLE([migration],
+        [AS_HELP_STRING([--disable-migration],[Disable prefs migration from GConf to GSettings])],
+        [],[enable_migration=yes])
+AC_MSG_RESULT([$enable_migration])
+
+if test "$enable_migration" = "yes"; then
+ PKG_CHECK_MODULES([MIGRATOR],[
+   gio-2.0 >= $GIO_REQUIRED
+   vte$VTE_PC_VERSION >= $VTE_REQUIRED
+   gconf-2.0 >= $GCONF_REQUIRED
+   uuid])
+  AC_DEFINE([ENABLE_MIGRATION],[1],[Define to 1 to enable prefs migration from GConf to GSettings])
+fi
+
+AM_CONDITIONAL([ENABLE_MIGRATION],[test "$enable_migration" = "yes"])
 
 # ***********
 # Build tools
@@ -269,6 +280,7 @@ gnome-terminal-$VERSION:
       source code location:   ${srcdir}
       compiler:               ${CC}
       DBus service dir:       ${dbusservicedir}
+      Prefs migration:        ${enable_migration}
       Nautilus extension:     ${with_nautilus_extension}
       Nautilus extension dir: ${nautilusextensiondir}
 "
diff --git a/src/Makefile.am b/src/Makefile.am
index 1983be6..fe9f39c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -249,6 +249,8 @@ libterminal_nautilus_la_LIBADD = \
 
 # Pref migrator
 
+if ENABLE_MIGRATION
+
 gnome_terminal_migration_SOURCES = \
 	migration.c \
 	terminal-schemas.h \
@@ -270,6 +272,8 @@ gnome_terminal_migration_LDADD = \
 	$(MIGRATOR_LIBS) \
 	$(INTLLIBS)
 
+endif # ENABLE_MIGRATION
+
 gsettingsschema_in_files = org.gnome.Terminal.gschema.xml.in
 gsettings_SCHEMAS = $(gsettingsschema_in_files:.gschema.xml.in=.gschema.xml)
 
diff --git a/src/terminal-app.c b/src/terminal-app.c
index 58541db..50e9880 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -114,6 +114,7 @@ enum
 static void
 maybe_migrate_settings (TerminalApp *app)
 {
+#ifdef ENABLE_MIGRATION
   const char * const argv[] = { 
     TERM_LIBEXECDIR "/gnome-terminal-migration",
 #ifdef GNOME_ENABLE_DEBUG
@@ -151,6 +152,11 @@ maybe_migrate_settings (TerminalApp *app)
   } else {
     g_printerr ("Profile migrator exited abnormally.\n");
   }
+#else
+  g_settings_set_uint (terminal_app_get_global_settings (app),
+                       TERMINAL_SETTING_SCHEMA_VERSION,
+                       TERMINAL_SCHEMA_VERSION);
+#endif /* ENABLE_MIGRATION */
 }
 
 static char **



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