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 | |
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')
-rw-r--r-- | include/datetime/clock-mock.h | 12 | ||||
-rw-r--r-- | include/datetime/clock.h | 9 | ||||
-rw-r--r-- | include/datetime/dbus-shared.h | 5 |
3 files changed, 18 insertions, 8 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 c5c3105..64d275b 100644 --- a/include/datetime/clock.h +++ b/include/datetime/clock.h @@ -55,12 +55,9 @@ protected: void maybe_emit (const DateTime& a, const DateTime& b); private: - static void on_system_bus_ready(GObject*, GAsyncResult*, gpointer); - static void on_prepare_for_sleep(GDBusConnection*, const gchar*, const gchar*, const gchar*, const gchar*, GVariant*, gpointer); - - GCancellable * m_cancellable = nullptr; - GDBusConnection * m_system_bus = nullptr; - unsigned int m_sleep_subscription_id = 0; + class Impl; + friend class Impl; + std::unique_ptr<Impl> m_impl; // we've got raw pointers and GSignal tags in here, so disable copying Clock(const Clock&) =delete; diff --git a/include/datetime/dbus-shared.h b/include/datetime/dbus-shared.h index db10c1d..c09caa2 100644 --- a/include/datetime/dbus-shared.h +++ b/include/datetime/dbus-shared.h @@ -24,4 +24,9 @@ #define BUS_DATETIME_NAME "com.canonical.indicator.datetime" #define BUS_DATETIME_PATH "/com/canonical/indicator/datetime" +#define BUS_POWERD_NAME "com.canonical.powerd" +#define BUS_POWERD_PATH "/com/canonical/powerd" +#define BUS_POWERD_INTERFACE "com.canonical.powerd" + + #endif /* _INDICATOR_DATETIME_DBUS_SHARED_H_ */ |