aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--include/datetime/alarm-queue-simple.h2
-rw-r--r--src/alarm-queue-simple.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/datetime/alarm-queue-simple.h b/include/datetime/alarm-queue-simple.h
index 8461227..af1145a 100644
--- a/include/datetime/alarm-queue-simple.h
+++ b/include/datetime/alarm-queue-simple.h
@@ -52,7 +52,7 @@ private:
const std::shared_ptr<Planner> m_planner;
const std::shared_ptr<WakeupTimer> m_timer;
core::Signal<const Appointment&> m_alarm_reached;
- DateTime m_time;
+ DateTime m_datetime;
};
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();