aboutsummaryrefslogtreecommitdiff
path: root/src/aoclocklabel.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2021-01-09 01:18:19 -0600
committeroldmud0 <oldmud0@users.noreply.github.com>2021-01-09 01:18:19 -0600
commitde3533fbf2615a40efc60c9ed2e96f1a3b5da3c1 (patch)
tree484c45a32b32a87cfa8874d53b17f00c030bab6c /src/aoclocklabel.cpp
parent610510eb7b13475f0625d69e9a8e2b1d14669198 (diff)
Rework timer and ping logic
The timer's time as received by the server is clarified to be the actual numerical time, in milliseconds, to be shown on the clock.
Diffstat (limited to 'src/aoclocklabel.cpp')
-rw-r--r--src/aoclocklabel.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/aoclocklabel.cpp b/src/aoclocklabel.cpp
index d67ec36d..4c9c4819 100644
--- a/src/aoclocklabel.cpp
+++ b/src/aoclocklabel.cpp
@@ -4,7 +4,7 @@ AOClockLabel::AOClockLabel(QWidget *parent) : QLabel(parent) {}
void AOClockLabel::start()
{
- timer.start(100, this);
+ timer.start(1000 / 60, this);
}
void AOClockLabel::start(int msecs)
@@ -15,11 +15,7 @@ void AOClockLabel::start(int msecs)
void AOClockLabel::set(int msecs, bool update_text)
{
- QTime time = QTime::currentTime();
- if (msecs > time.msec())
- {
- target_time = time.addMSecs(msecs);
- }
+ target_time = QTime::currentTime().addMSecs(msecs);
if (update_text)
{
if (QTime::currentTime() >= target_time)