summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2011-11-03 16:52:10 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2011-11-04 18:39:45 +0000
commita4bb333ef99e7c64a6b4b63a080c57c5beb1aac7 (patch)
treebb7b410cd70f770dd5b88c101322899adb34a5d9
parentdb2ac21ee35f785cb21d7b1e782eb34c9753c4f4 (diff)
Bind use-conn GSettings key to ConnectivityMonitor
This GSettings key does the same thing as the Empathy one it's an alias for does: if use-conn is False, the network state from NM/ConnMan is ignored, and MC will allow you to try to sign in even if there is supposedly no network connection! It's pretty great. (When I first committed this, it didn't work. Now it does. I don't know why.)
-rw-r--r--.gitignore1
-rw-r--r--data/Makefile.am6
-rw-r--r--src/kludge-transport.c8
-rw-r--r--tests/twisted/tools/exec-with-log.sh.in2
4 files changed, 17 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 6ba0aeeb..a5884dd2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@
*.gcno
*.gcov
/data/*.valid
+/data/gschemas.compiled
/doc/reference/*/html
/doc/reference/*/xml
/doc/reference/*/*-decl-list.txt
diff --git a/data/Makefile.am b/data/Makefile.am
index 48c778d5..3d293bd8 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -3,7 +3,13 @@ gsettings_SCHEMAS = \
$(NULL)
@GSETTINGS_RULES@
+# 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)
+
EXTRA_DIST = \
$(gsettings_SCHEMAS) \
$(NULL)
+CLEANFILES = $(noinst_DATA)
diff --git a/src/kludge-transport.c b/src/kludge-transport.c
index 67d5b234..bdd80b81 100644
--- a/src/kludge-transport.c
+++ b/src/kludge-transport.c
@@ -41,6 +41,9 @@ struct _McdKludgeTransportPrivate {
/* Hold a set of McdAccounts which would like to go online. */
GHashTable *pending_accounts;
+
+ /* Application settings we steal from under Empathy's nose. */
+ GSettings *settings;
};
static void transport_iface_init (
@@ -82,6 +85,10 @@ mcd_kludge_transport_constructed (GObject *object)
priv->pending_accounts = g_hash_table_new_full (NULL, NULL,
g_object_unref, NULL);
+
+ priv->settings = g_settings_new ("im.telepathy.MissionControl.FromEmpathy");
+ g_settings_bind (priv->settings, "use-conn", priv->minotaur, "use-conn",
+ G_SETTINGS_BIND_GET);
}
static void
@@ -92,6 +99,7 @@ mcd_kludge_transport_dispose (GObject *object)
GObjectClass *parent_class = mcd_kludge_transport_parent_class;
tp_clear_object (&priv->minotaur);
+ tp_clear_object (&priv->settings);
g_list_free (priv->transports);
priv->transports = NULL;
diff --git a/tests/twisted/tools/exec-with-log.sh.in b/tests/twisted/tools/exec-with-log.sh.in
index 84b13ea2..a90af148 100644
--- a/tests/twisted/tools/exec-with-log.sh.in
+++ b/tests/twisted/tools/exec-with-log.sh.in
@@ -63,6 +63,8 @@ if test -f "$MC_ACCOUNT_DIR/gnome-keyring-env"; then
export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID MC_KEYRING_NAME SSH_AUTH_SOCK
fi
+export GSETTINGS_SCHEMA_DIR=@abs_top_builddir@/data
+
exec @abs_top_builddir@/libtool --mode=execute \
$MISSIONCONTROL_WRAPPER \
$MC_EXECUTABLE