[telepathy-account-widgets] build: add --disable-settings to avoid installing the GSettings schema



commit d445cc2ace4729dd70bf25628aceb119415dffdf
Author: Marco Barisione <marco barisione collabora co uk>
Date:   Tue Aug 27 07:49:12 2013 +0100

    build: add --disable-settings to avoid installing the GSettings schema
    
    This is needed to avoid multiple components shipping the same schema.
    It's just a temporary workaround that won't be needed when
    https://bugzilla.gnome.org/show_bug.cgi?id=706317 will be fixed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706801

 configure.ac                             |   18 ++++++++++++++++++
 data/Makefile.am                         |    3 +++
 tp-account-widgets/tpaw-avatar-chooser.c |   12 ++++++++++++
 3 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 82f5e6f..f928fec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,6 +157,23 @@ fi
 AC_SUBST(icondir)
 
 # -----------------------------------------------------------
+# Disable the installation of tp-aw's GSettings schema.
+# This can be needed to avoid multiple components shipping
+# the same schema.
+# See https://bugzilla.gnome.org/show_bug.cgi?id=706801
+# -----------------------------------------------------------
+AC_ARG_ENABLE(settings,
+  AS_HELP_STRING([--disable-settings],
+                 [compile without installing GSettings schema]),
+  enable_settings=$enableval, enable_settings=yes )
+
+if test x$enable_settings = xyes; then
+  AC_DEFINE(ENABLE_SETTINGS, [], [Enable GSettings schema])
+fi
+
+AM_CONDITIONAL(ENABLE_SETTINGS, test "x$enable_settings" = "xyes")
+
+# -----------------------------------------------------------
 # Pkg-Config dependency checks
 # -----------------------------------------------------------
 
@@ -370,6 +387,7 @@ Configure summary:
        Prefix......................:  ${prefix}
        Data directory .............:  ${real_pkgdatadir}
        Icon directory .............:  ${icondir}
+       GSettings schema support....:  ${enable_settings}
        Coding style checks.........:  ${ENABLE_CODING_STYLE_CHECKS}
        Unreleased version checks...:  ${enable_unreleased_checks}
        GETTEXT_PACKAGE.............:  ${GETTEXT_PACKAGE}
diff --git a/data/Makefile.am b/data/Makefile.am
index 19f40a3..433fb18 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,6 +1,8 @@
 SUBDIRS = icons
 
 gsettings_SCHEMAS = org.gnome.telepathy-account-widgets.gschema.xml
+
+if ENABLE_SETTINGS
 @GSETTINGS_RULES@
 
 # We need to compile schemas at make time
@@ -9,6 +11,7 @@ gschemas.compiled: $(gsettings_SCHEMAS:.xml=.valid)
        $(AM_V_GEN) $(GLIB_COMPILE_SCHEMAS) --targetdir=. .
 
 all-local: gschemas.compiled
+endif
 
 EXTRA_DIST =                           \
        $(schemas_DATA)                 \
diff --git a/tp-account-widgets/tpaw-avatar-chooser.c b/tp-account-widgets/tpaw-avatar-chooser.c
index c20ad59..63c0e05 100644
--- a/tp-account-widgets/tpaw-avatar-chooser.c
+++ b/tp-account-widgets/tpaw-avatar-chooser.c
@@ -79,7 +79,9 @@ struct _TpawAvatarChooserPrivate
   gboolean changed;
 
   GtkFileChooser *chooser_dialog;
+#ifdef ENABLE_SETTINGS
   GSettings *gsettings_ui;
+#endif
 };
 
 enum
@@ -237,7 +239,9 @@ avatar_chooser_dispose (GObject *object)
   tp_clear_object (&self->priv->account);
   tp_clear_pointer (&self->priv->avatar, g_array_unref);
   tp_clear_pointer (&self->priv->mime_type, g_free);
+#ifdef ENABLE_SETTINGS
   tp_clear_object (&self->priv->gsettings_ui);
+#endif
 
   G_OBJECT_CLASS (tpaw_avatar_chooser_parent_class)->dispose (object);
 }
@@ -967,12 +971,15 @@ avatar_chooser_response_cb (GtkWidget *widget,
   if (response == TPAW_AVATAR_CHOOSER_RESPONSE_FILE)
     {
       gchar *filename;
+#ifdef ENABLE_SETTINGS
       gchar *path;
+#endif
 
       filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
       avatar_chooser_set_image_from_file (self, filename);
       g_free (filename);
 
+#ifdef ENABLE_SETTINGS
       path = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (widget));
       if (path != NULL)
         {
@@ -982,6 +989,7 @@ avatar_chooser_response_cb (GtkWidget *widget,
 
           g_free (path);
         }
+#endif
     }
   else if (response == TPAW_AVATAR_CHOOSER_RESPONSE_NO_IMAGE)
     {
@@ -1046,8 +1054,10 @@ avatar_chooser_clicked_cb (GtkWidget *button,
   gtk_window_set_destroy_with_parent (GTK_WINDOW (chooser_dialog), TRUE);
 
   /* Get special dirs */
+#ifdef ENABLE_SETTINGS
   saved_dir = g_settings_get_string (self->priv->gsettings_ui,
              TPAW_PREFS_UI_AVATAR_DIRECTORY);
+#endif
 
   if (saved_dir != NULL &&
       !g_file_test (saved_dir, G_FILE_TEST_IS_DIR))
@@ -1127,7 +1137,9 @@ tpaw_avatar_chooser_init (TpawAvatarChooser *self)
       G_N_ELEMENTS (drop_types),
       GDK_ACTION_COPY);
 
+#ifdef ENABLE_SETTINGS
   self->priv->gsettings_ui = g_settings_new (TPAW_PREFS_UI_SCHEMA);
+#endif
 
   g_signal_connect (self, "drag-motion",
       G_CALLBACK (avatar_chooser_drag_motion_cb),


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