gnome-session r5209 - in trunk: . gnome-session
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-session r5209 - in trunk: . gnome-session
- Date: Sun, 18 Jan 2009 23:02:18 +0000 (UTC)
Author: mccann
Date: Sun Jan 18 23:02:18 2009
New Revision: 5209
URL: http://svn.gnome.org/viewvc/gnome-session?rev=5209&view=rev
Log:
2009-01-18 William Jon McCann <jmccann redhat com>
* gnome-session/gsm-presence.c (reset_idle_watch),
(gsm_presence_set_idle_enabled), (gsm_presence_set_idle_timeout):
Reset the idle watch when the timeout property changes.
Modified:
trunk/ChangeLog
trunk/gnome-session/gsm-presence.c
Modified: trunk/gnome-session/gsm-presence.c
==============================================================================
--- trunk/gnome-session/gsm-presence.c (original)
+++ trunk/gnome-session/gsm-presence.c Sun Jan 18 23:02:18 2009
@@ -176,6 +176,26 @@
return handled;
}
+static void
+reset_idle_watch (GsmPresence *presence)
+{
+ if (presence->priv->idle_watch_id > 0) {
+ g_debug ("GsmPresence: removing idle watch");
+ gs_idle_monitor_remove_watch (presence->priv->idle_monitor,
+ presence->priv->idle_watch_id);
+ presence->priv->idle_watch_id = 0;
+ }
+
+ if (presence->priv->idle_enabled) {
+ g_debug ("GsmPresence: adding idle watch");
+
+ presence->priv->idle_watch_id = gs_idle_monitor_add_watch (presence->priv->idle_monitor,
+ presence->priv->idle_timeout,
+ (GSIdleMonitorWatchFunc)on_idle_timeout,
+ presence);
+ }
+}
+
void
gsm_presence_set_idle_enabled (GsmPresence *presence,
gboolean enabled)
@@ -183,21 +203,8 @@
g_return_if_fail (GSM_IS_PRESENCE (presence));
if (presence->priv->idle_enabled != enabled) {
- if (enabled) {
- g_debug ("GsmPresence: adding idle watch");
- presence->priv->idle_watch_id = gs_idle_monitor_add_watch (presence->priv->idle_monitor,
- presence->priv->idle_timeout,
- (GSIdleMonitorWatchFunc)on_idle_timeout,
- presence);
- } else {
- if (presence->priv->idle_watch_id > 0) {
- g_debug ("GsmPresence: removing idle watch");
- gs_idle_monitor_remove_watch (presence->priv->idle_monitor,
- presence->priv->idle_watch_id);
- presence->priv->idle_watch_id = 0;
- }
- }
-
+ presence->priv->idle_enabled = enabled;
+ reset_idle_watch (presence);
g_object_notify (G_OBJECT (presence), "idle-enabled");
}
@@ -254,6 +261,7 @@
if (timeout != presence->priv->idle_timeout) {
presence->priv->idle_timeout = timeout;
+ reset_idle_watch (presence);
g_object_notify (G_OBJECT (presence), "idle-timeout");
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]