[gnome-chess] ChessClock: verify clock state before (un)pause
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-chess] ChessClock: verify clock state before (un)pause
- Date: Sat, 3 Aug 2013 15:53:33 +0000 (UTC)
commit 91810128c6e2a23a8b0058bf7c8132f4c653b4cd
Author: Michael Catanzaro <mike catanzaro gmail com>
Date: Sat Aug 3 09:20:09 2013 -0500
ChessClock: verify clock state before (un)pause
If the clock is active, don't allow unpause. If it's not, don't allow
unpause. Checking if the timer exists is not sufficient here.
src/chess-clock.vala | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/chess-clock.vala b/src/chess-clock.vala
index 1f3e5da..7fb70c3 100644
--- a/src/chess-clock.vala
+++ b/src/chess-clock.vala
@@ -79,14 +79,14 @@ public class ChessClock : Object
_black_initial_ms = black_initial_seconds * 1000;
}
- private bool is_started
+ private bool is_active
{
get { return expire_timeout_id != 0; }
}
public void start ()
{
- if (is_started)
+ if (is_active)
return;
if (timer == null)
@@ -128,7 +128,7 @@ public class ChessClock : Object
public void stop ()
{
- if (!is_started)
+ if (!is_active)
return;
timer.stop ();
@@ -153,7 +153,7 @@ public class ChessClock : Object
public void pause ()
{
- if (timer == null)
+ if (!is_active)
return;
timer.stop ();
@@ -162,7 +162,7 @@ public class ChessClock : Object
public void unpause ()
{
- if (timer == null)
+ if (is_active)
return;
timer continue ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]