comparison src/idle.c @ 11697:186d2d293ef4

[gaim-migrate @ 13988] Get rid of the "Idle Tracking Method" preference. Use mouse/keyboard movement when possible, otherwise fallback to Gaim-usage. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 20 Oct 2005 03:48:22 +0000
parents 8004885fabbe
children a8ec0a291d14
comparison
equal deleted inserted replaced
11696:8094a66d574b 11697:186d2d293ef4
116 gint 116 gint
117 check_idle(gpointer data) 117 check_idle(gpointer data)
118 { 118 {
119 GaimConnection *gc = data; 119 GaimConnection *gc = data;
120 gboolean report_idle; 120 gboolean report_idle;
121 const char *idle_method;
122 GaimAccount *account; 121 GaimAccount *account;
123 time_t t; 122 time_t t;
124 int idle_time; 123 int idle_time;
125 124
126 account = gaim_connection_get_account(gc); 125 account = gaim_connection_get_account(gc);
127 126
128 gaim_signal_emit(gaim_blist_get_handle(), "update-idle"); 127 gaim_signal_emit(gaim_blist_get_handle(), "update-idle");
129 128
130 time(&t); 129 time(&t);
131 130
132 idle_method = gaim_prefs_get_string("/gaim/gtk/idle/method");
133 report_idle = gaim_prefs_get_bool("/gaim/gtk/idle/report"); 131 report_idle = gaim_prefs_get_bool("/gaim/gtk/idle/report");
134 132
135 #ifdef USE_SCREENSAVER 133 #ifdef USE_SCREENSAVER
136 if (idle_method != NULL && !strcmp(idle_method, "system"))
137 idle_time = get_idle_time_from_system(); 134 idle_time = get_idle_time_from_system();
138 else 135 #else
136 /*
137 * If Gaim wasn't built with xscreensaver support, then
138 * fallback to calculating our idle time based on when
139 * we last sent a message.
140 */
141 idle_time = t - gc->last_sent_time;
139 #endif /* USE_SCREENSAVER */ 142 #endif /* USE_SCREENSAVER */
140 idle_time = t - gc->last_sent_time; 143
141 144 /* Should we become auto-away? */
142 /* Should be become auto-away? */
143 if (gaim_prefs_get_bool("/core/away/away_when_idle") && 145 if (gaim_prefs_get_bool("/core/away/away_when_idle") &&
144 (idle_time > (60 * gaim_prefs_get_int("/core/away/mins_before_away"))) 146 (idle_time > (60 * gaim_prefs_get_int("/core/away/mins_before_away")))
145 && (!gc->is_auto_away)) 147 && (!gc->is_auto_away))
146 { 148 {
147 GaimPresence *presence; 149 GaimPresence *presence;