aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Timer.cc4
-rw-r--r--src/FbTk/Timer.hh2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/FbTk/Timer.cc b/src/FbTk/Timer.cc
index 1806557..61875f7 100644
--- a/src/FbTk/Timer.cc
+++ b/src/FbTk/Timer.cc
@@ -91,7 +91,7 @@ Timer::~Timer() {
91} 91}
92 92
93 93
94void Timer::setTimeout(uint64_t timeout) { 94void Timer::setTimeout(uint64_t timeout, bool force_start) {
95 95
96 bool was_timing = isTiming(); 96 bool was_timing = isTiming();
97 if (was_timing) { 97 if (was_timing) {
@@ -99,7 +99,7 @@ void Timer::setTimeout(uint64_t timeout) {
99 } 99 }
100 m_timeout = timeout; 100 m_timeout = timeout;
101 101
102 if (was_timing) { 102 if (force_start || was_timing) {
103 start(); 103 start();
104 } 104 }
105} 105}
diff --git a/src/FbTk/Timer.hh b/src/FbTk/Timer.hh
index 4bdd13a..8904a85 100644
--- a/src/FbTk/Timer.hh
+++ b/src/FbTk/Timer.hh
@@ -43,7 +43,7 @@ public:
43 ~Timer(); 43 ~Timer();
44 44
45 void fireOnce(bool once) { m_once = once; } 45 void fireOnce(bool once) { m_once = once; }
46 void setTimeout(uint64_t timeout); 46 void setTimeout(uint64_t timeout, bool force_start = false);
47 void setCommand(const RefCount<Slot<void> > &cmd); 47 void setCommand(const RefCount<Slot<void> > &cmd);
48 48
49 template<typename Functor> 49 template<typename Functor>