summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Zabaluev <mikhail.zabaluev@nokia.com>2012-01-13 14:13:15 +0100
committerMikhail Zabaluev <mikhail.zabaluev@nokia.com>2012-01-13 16:35:02 +0100
commit1282e4c7b8d7e2c3bde3201dacd81dbeb4ca8b1d (patch)
treec994663c1a6034ea9083b03c87875b4d2b48e535
parent18209172f6ff643247c1fe1f09aa20b14ab2f932 (diff)
Make the usage of "use-conn" GSetting a configure optionoptionalize-gsettings
-rw-r--r--configure.ac11
-rw-r--r--data/Makefile.am13
-rw-r--r--src/kludge-transport.c8
3 files changed, 29 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index b2d01395..c5dc9b17 100644
--- a/configure.ac
+++ b/configure.ac
@@ -376,6 +376,16 @@ fi
AM_CONDITIONAL(HAVE_NM, test "x$have_nm" = "xyes")
AM_CONDITIONAL(HAVE_CONNMAN, test "x$have_connman" = "xyes")
+AC_ARG_ENABLE([conn-setting],
+ [AS_HELP_STRING([--enable-conn-setting],
+ [use a GSetting to control automatic connectivity @<:@default=yes@:>@])],
+ [],
+ [enable_conn_setting=yes])
+if test x"$enable_conn_setting" = xyes; then
+ AC_DEFINE([ENABLE_CONN_SETTING], [1], [Define to use the "use-conn" GSetting])
+fi
+AM_CONDITIONAL([ENABLE_CONN_SETTING], [test x"$enable_conn_setting" = xyes])
+
# -----------------------------------------------------------
# Suspend/resume tracking goop
# -----------------------------------------------------------
@@ -460,6 +470,7 @@ Configure summary:
Gnome Keyring................: ${keyring_enabled}
Network Manager integration..: ${have_nm}
ConnMan integration..........: ${have_connman}
+ Connectivity GSetting........: ${enable_conn_setting}
Suspend tracking with UPower.: ${have_upower}
Aegis........................: ${aegis_enabled}
libaccounts-glib backend.....: ${libaccounts_sso_enabled}
diff --git a/data/Makefile.am b/data/Makefile.am
index 3d293bd8..a83709e1 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,15 +1,22 @@
-gsettings_SCHEMAS = \
+mc_schemas = \
im.telepathy.MissionControl.FromEmpathy.gschema.xml \
$(NULL)
-@GSETTINGS_RULES@
+
+gsettings_SCHEMAS =
+
+if ENABLE_CONN_SETTING
+gsettings_SCHEMAS += $(mc_schemas)
# We build our own schema cache here for the benefit of the test suite
noinst_DATA = gschemas.compiled
gschemas.compiled: $(gsettings_SCHEMAS)
$(AM_V_GEN)$(GLIB_COMPILE_SCHEMAS) --targetdir=$(builddir) $(srcdir)
+endif
+
+@GSETTINGS_RULES@
EXTRA_DIST = \
- $(gsettings_SCHEMAS) \
+ $(mc_schemas) \
$(NULL)
CLEANFILES = $(noinst_DATA)
diff --git a/src/kludge-transport.c b/src/kludge-transport.c
index bdd80b81..636f9cfa 100644
--- a/src/kludge-transport.c
+++ b/src/kludge-transport.c
@@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
+
#include "kludge-transport.h"
#include <telepathy-glib/util.h>
@@ -42,8 +44,10 @@ struct _McdKludgeTransportPrivate {
/* Hold a set of McdAccounts which would like to go online. */
GHashTable *pending_accounts;
+#ifdef ENABLE_CONN_SETTING
/* Application settings we steal from under Empathy's nose. */
GSettings *settings;
+#endif
};
static void transport_iface_init (
@@ -86,9 +90,11 @@ mcd_kludge_transport_constructed (GObject *object)
priv->pending_accounts = g_hash_table_new_full (NULL, NULL,
g_object_unref, NULL);
+#ifdef ENABLE_CONN_SETTING
priv->settings = g_settings_new ("im.telepathy.MissionControl.FromEmpathy");
g_settings_bind (priv->settings, "use-conn", priv->minotaur, "use-conn",
G_SETTINGS_BIND_GET);
+#endif
}
static void
@@ -99,7 +105,9 @@ mcd_kludge_transport_dispose (GObject *object)
GObjectClass *parent_class = mcd_kludge_transport_parent_class;
tp_clear_object (&priv->minotaur);
+#ifdef ENABLE_CONN_SETTING
tp_clear_object (&priv->settings);
+#endif
g_list_free (priv->transports);
priv->transports = NULL;