aboutsummaryrefslogtreecommitdiff
path: root/src/alarm-queue-simple.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-06-10 09:01:39 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-06-10 09:01:39 -0500
commit0e5acaedb9cb419b7fc607de175fce23025805c2 (patch)
treec92739f2538907c764aca739e8f5bbedba2fc054 /src/alarm-queue-simple.cpp
parent02319cb816824442fa59736f97e570726e01ce41 (diff)
downloadayatana-indicator-datetime-0e5acaedb9cb419b7fc607de175fce23025805c2.tar.gz
ayatana-indicator-datetime-0e5acaedb9cb419b7fc607de175fce23025805c2.tar.bz2
ayatana-indicator-datetime-0e5acaedb9cb419b7fc607de175fce23025805c2.zip
in alarm-queue-simple, call requeue() if time skew is detected.
Diffstat (limited to 'src/alarm-queue-simple.cpp')
-rw-r--r--src/alarm-queue-simple.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/alarm-queue-simple.cpp b/src/alarm-queue-simple.cpp
index 1c871bf..00608c9 100644
--- a/src/alarm-queue-simple.cpp
+++ b/src/alarm-queue-simple.cpp
@@ -35,7 +35,7 @@ SimpleAlarmQueue::SimpleAlarmQueue(const std::shared_ptr<Clock>& clock,
m_clock(clock),
m_planner(planner),
m_timer(timer),
- m_time(clock->localtime())
+ m_datetime(clock->localtime())
{
m_planner->appointments().changed().connect([this](const std::vector<Appointment>&){
g_debug("AlarmQueue %p calling requeue() due to appointments changed", this);
@@ -45,8 +45,8 @@ SimpleAlarmQueue::SimpleAlarmQueue(const std::shared_ptr<Clock>& clock,
m_clock->minute_changed.connect([=]{
const auto now = m_clock->localtime();
constexpr auto skew_threshold_usec = int64_t{90} * G_USEC_PER_SEC;
- const bool clock_jumped = std::abs(now - m_time) > skew_threshold_usec;
- m_time = now;
+ const bool clock_jumped = std::abs(now - m_datetime) > skew_threshold_usec;
+ m_datetime = now;
if (clock_jumped) {
g_debug("AlarmQueue %p calling requeue() due to clock skew", this);
requeue();