From c1d7093754507c971b61633f51b7a80f2dcb4c7d Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Tue, 18 Aug 2009 18:25:13 +0100 Subject: empathy: create a new EmpathyConnectivity object on startup Signed-off-by: Jonny Lamb --- src/empathy.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/empathy.c b/src/empathy.c index 15155d28d..ce706c9e9 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -208,15 +209,15 @@ operation_error_cb (MissionControl *mc, } static void -use_nm_notify_cb (EmpathyConf *conf, - const gchar *key, - gpointer user_data) +use_conn_notify_cb (EmpathyConf *conf, + const gchar *key, + gpointer user_data) { - EmpathyIdle *idle = user_data; - gboolean use_nm; + EmpathyConnectivity *connectivity = user_data; + gboolean use_conn; - if (empathy_conf_get_bool (conf, key, &use_nm)) { - empathy_idle_set_use_nm (idle, use_nm); + if (empathy_conf_get_bool (conf, key, &use_conn)) { + empathy_connectivity_set_use_conn (connectivity, use_conn); } } @@ -555,6 +556,7 @@ main (int argc, char *argv[]) GtkWidget *window; MissionControl *mc; EmpathyIdle *idle; + EmpathyConnectivity *connectivity; gboolean autoconnect = TRUE; gboolean no_connect = FALSE; gboolean hide_contact_list = FALSE; @@ -684,9 +686,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 (), -- cgit v1.2.3