diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-09-16 14:57:35 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-09-16 14:57:35 -0500 |
commit | 2c4bfbbfa53d62249f350dedbf19676f5003e632 (patch) | |
tree | b59b4fedfe0b5fb24808ff7b4f95d0c27e08f1e4 /include/datetime/clock-mock.h | |
parent | dc501b4b28452b097da0703cc77867377340ed13 (diff) | |
parent | 790f43bcea23f926f6617e0fe41026a3adaee8cc (diff) | |
download | ayatana-indicator-datetime-2c4bfbbfa53d62249f350dedbf19676f5003e632.tar.gz ayatana-indicator-datetime-2c4bfbbfa53d62249f350dedbf19676f5003e632.tar.bz2 ayatana-indicator-datetime-2c4bfbbfa53d62249f350dedbf19676f5003e632.zip |
sync with trunk
Diffstat (limited to 'include/datetime/clock-mock.h')
-rw-r--r-- | include/datetime/clock-mock.h | 12 |
1 files changed, 10 insertions, 2 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; }; |