X-Git-Url: https://git.0d.be/?p=empathy.git;a=blobdiff_plain;f=src%2Fempathy.c;fp=src%2Fempathy.c;h=718fe70bfc7a5324deb5cb53365411d54413b072;hp=3cc494a94480a19cf4f23e5e7464fa1b26127671;hb=84e30dab1428affe335ef904377d07f8b5fdeb66;hpb=fd8e9c5dc2584055177c7a79021cdd53ca431c22 diff --git a/src/empathy.c b/src/empathy.c index 3cc494a9..718fe70b 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -33,7 +33,7 @@ #include #if HAVE_LIBCHAMPLAIN -#include +#include #endif #include @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -148,19 +149,6 @@ dispatch_cb (EmpathyDispatcher *dispatcher, } } -static void -use_nm_notify_cb (EmpathyConf *conf, - const gchar *key, - gpointer user_data) -{ - EmpathyIdle *idle = user_data; - gboolean use_nm; - - if (empathy_conf_get_bool (conf, key, &use_nm)) { - empathy_idle_set_use_nm (idle, use_nm); - } -} - /* Salut account creation */ static gboolean should_create_salut_account (void) @@ -228,6 +216,19 @@ salut_account_created (GObject *source, TRUE); } +static void +use_conn_notify_cb (EmpathyConf *conf, + const gchar *key, + gpointer user_data) +{ + EmpathyConnectivity *connectivity = user_data; + gboolean use_conn; + + if (empathy_conf_get_bool (conf, key, &use_conn)) { + empathy_connectivity_set_use_conn (connectivity, use_conn); + } +} + static void create_salut_account_if_needed (EmpathyConnectionManagers *managers) { @@ -535,6 +536,7 @@ main (int argc, char *argv[]) EmpathyFTFactory *ft_factory; GtkWidget *window; EmpathyIdle *idle; + EmpathyConnectivity *connectivity; gboolean autoconnect = TRUE; gboolean no_connect = FALSE; gboolean hide_contact_list = FALSE; @@ -637,9 +639,13 @@ main (int argc, char *argv[]) /* Setting up Idle */ idle = empathy_idle_dup_singleton (); empathy_idle_set_auto_away (idle, TRUE); - use_nm_notify_cb (empathy_conf_get (), EMPATHY_PREFS_USE_NM, idle); - empathy_conf_notify_add (empathy_conf_get (), EMPATHY_PREFS_USE_NM, - use_nm_notify_cb, idle); + + /* Setting up Connectivity */ + connectivity = empathy_connectivity_dup_singleton (); + use_conn_notify_cb (empathy_conf_get (), EMPATHY_PREFS_USE_CONN, + connectivity); + empathy_conf_notify_add (empathy_conf_get (), EMPATHY_PREFS_USE_CONN, + use_conn_notify_cb, connectivity); /* Autoconnect */ empathy_conf_get_bool (empathy_conf_get (), @@ -699,6 +705,7 @@ main (int argc, char *argv[]) empathy_idle_set_state (idle, TP_CONNECTION_PRESENCE_TYPE_OFFLINE); g_object_unref (idle); + g_object_unref (connectivity); g_object_unref (icon); g_object_unref (account_manager); g_object_unref (log_manager);