aboutsummaryrefslogtreecommitdiff
path: root/include/datetime
diff options
context:
space:
mode:
Diffstat (limited to 'include/datetime')
-rw-r--r--include/datetime/clock-mock.h12
-rw-r--r--include/datetime/clock.h4
2 files changed, 12 insertions, 4 deletions
diff --git a/include/datetime/clock-mock.h b/include/datetime/clock-mock.h
index fb9b52f..0e24377 100644
--- a/include/datetime/clock-mock.h
+++ b/include/datetime/clock-mock.h
@@ -41,15 +41,23 @@ public:
DateTime localtime() const { return m_localtime; }
- void set_localtime(const DateTime& dt) {
+ void set_localtime(const DateTime& dt)
+ {
const auto old = m_localtime;
- m_localtime = dt;
+
+ set_localtime_quietly(dt);
+
if (!DateTime::is_same_minute(old, m_localtime))
minute_changed();
if (!DateTime::is_same_day(old, m_localtime))
date_changed();
}
+ void set_localtime_quietly(const DateTime& dt)
+ {
+ m_localtime = dt;
+ }
+
private:
DateTime m_localtime;
};
diff --git a/include/datetime/clock.h b/include/datetime/clock.h
index 0445aab..8745d24 100644
--- a/include/datetime/clock.h
+++ b/include/datetime/clock.h
@@ -66,7 +66,7 @@ private:
****
***/
-class Timezones;
+class Timezone;
/**
* \brief A live #Clock that provides the actual system time.
@@ -74,7 +74,7 @@ class Timezones;
class LiveClock: public Clock
{
public:
- LiveClock (const std::shared_ptr<const Timezones>& zones);
+ LiveClock (const std::shared_ptr<const Timezone>& zones);
virtual ~LiveClock();
virtual DateTime localtime() const;