[Xfce4-commits] <xfce4-time-out-plugin:master> Emit the 'update' signal only if the countdown is running
Landry Breuil
noreply at xfce.org
Mon Apr 16 10:18:01 CEST 2012
Updating branch refs/heads/master
to f6517ad3f4f168264242d57f40a0a692af895ef0 (commit)
from fabc541d689cd40ed7753da30b971642da8643ef (commit)
commit f6517ad3f4f168264242d57f40a0a692af895ef0
Author: Landry Breuil <landry at xfce.org>
Date: Mon Apr 16 10:14:30 2012 +0200
Emit the 'update' signal only if the countdown is running
More logic fix for bug #7660, avoids useless calls.
panel-plugin/time-out-countdown.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/panel-plugin/time-out-countdown.c b/panel-plugin/time-out-countdown.c
index e73df6a..2977fd2 100644
--- a/panel-plugin/time-out-countdown.c
+++ b/panel-plugin/time-out-countdown.c
@@ -558,17 +558,20 @@ time_out_countdown_update (TimeOutCountdown *countdown)
{
g_return_val_if_fail (IS_TIME_OUT_COUNTDOWN (countdown), FALSE);
- /* Emit a regular 'update' signal */
- g_signal_emit_by_name (countdown, "update", time_out_countdown_get_remaining (countdown));
-
- /* If the countdown has passed the requested seconds, emit a 'finish' signal */
- if (time_out_countdown_get_running (countdown) && time_out_countdown_get_remaining (countdown) <= 0)
+ if (time_out_countdown_get_running (countdown))
{
- /* Set state to stopped */
- time_out_countdown_stop (countdown);
+ /* Emit a regular 'update' signal */
+ g_signal_emit_by_name (countdown, "update", time_out_countdown_get_remaining (countdown));
+
+ /* If the countdown has passed the requested seconds, emit a 'finish' signal */
+ if (time_out_countdown_get_remaining (countdown) <= 0)
+ {
+ /* Set state to stopped */
+ time_out_countdown_stop (countdown);
- /* Emit signal */
- g_signal_emit_by_name (countdown, "finish");
+ /* Emit signal */
+ g_signal_emit_by_name (countdown, "finish");
+ }
}
return TRUE;
More information about the Xfce4-commits
mailing list