aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-idle.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-12-06 23:49:12 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-12-06 23:49:12 +0800
commit5cf3bfdf8d8e5d61ce10b2c04e467375ddac7740 (patch)
tree34d7e149e7420388625f53717f95a4c460166191 /libempathy/empathy-idle.c
parente0de4a5f2a254beef02021573c57543dfd33311f (diff)
downloadgsoc2013-empathy-5cf3bfdf8d8e5d61ce10b2c04e467375ddac7740.tar
gsoc2013-empathy-5cf3bfdf8d8e5d61ce10b2c04e467375ddac7740.tar.gz
gsoc2013-empathy-5cf3bfdf8d8e5d61ce10b2c04e467375ddac7740.tar.bz2
gsoc2013-empathy-5cf3bfdf8d8e5d61ce10b2c04e467375ddac7740.tar.lz
gsoc2013-empathy-5cf3bfdf8d8e5d61ce10b2c04e467375ddac7740.tar.xz
gsoc2013-empathy-5cf3bfdf8d8e5d61ce10b2c04e467375ddac7740.tar.zst
gsoc2013-empathy-5cf3bfdf8d8e5d61ce10b2c04e467375ddac7740.zip
When NM is in sleeping (=disabled) state, do just like if it was
2007-12-06 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-preferences.c: * libempathy-gtk/empathy-preferences.glade: * libempathy/empathy-idle.c: When NM is in sleeping (=disabled) state, do just like if it was connected. Remove option from preference dialog to disabled NM support because NM can be disabled using nm-applet, but let the option in gconf, it can be useful in case of buggy NM. svn path=/trunk/; revision=469
Diffstat (limited to 'libempathy/empathy-idle.c')
-rw-r--r--libempathy/empathy-idle.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index 10d5b7bde..6ef72609e 100644
--- a/libempathy/empathy-idle.c
+++ b/libempathy/empathy-idle.c
@@ -208,8 +208,9 @@ empathy_idle_init (EmpathyIdle *idle)
idle, NULL);
} else {
empathy_debug (DEBUG_DOMAIN, "Failed to get nm proxy");
- priv->nm_connected = TRUE;
}
+
+ priv->nm_connected = TRUE;
}
static void
@@ -468,7 +469,7 @@ empathy_idle_set_use_nm (EmpathyIdle *idle,
"Couldn't get NM state: %s",
error->message);
g_clear_error (&error);
- nm_status = NM_STATE_CONNECTED;
+ nm_status = NM_STATE_ASLEEP;
}
idle_nm_state_change_cb (priv->nm_proxy, nm_status, idle);
@@ -573,6 +574,7 @@ idle_nm_state_change_cb (DBusGProxy *proxy,
EmpathyIdle *idle)
{
EmpathyIdlePriv *priv;
+ gboolean nm_connected;
priv = GET_PRIV (idle);
@@ -583,20 +585,23 @@ idle_nm_state_change_cb (DBusGProxy *proxy,
return;
}
- if (state != NM_STATE_CONNECTED && priv->nm_connected) {
+ nm_connected = !(state == NM_STATE_CONNECTING ||
+ state == NM_STATE_DISCONNECTED);
+
+ if (priv->nm_connected && !nm_connected) {
/* We are no more connected */
idle_ext_away_stop (idle);
- priv->nm_saved_state = priv->state;
+ priv->nm_saved_state = priv->state;
empathy_idle_set_state (idle, MC_PRESENCE_OFFLINE);
- priv->nm_connected = FALSE;
}
- else if (state == NM_STATE_CONNECTED && !priv->nm_connected) {
+ else if (!priv->nm_connected && nm_connected) {
/* We are now connected */
- priv->nm_connected = TRUE;
- empathy_idle_set_state (idle, priv->nm_saved_state);
priv->nm_saved_state = MC_PRESENCE_UNSET;
+ empathy_idle_set_state (idle, priv->nm_saved_state);
}
+
+ priv->nm_connected = nm_connected;
}
static void