From ee64bb2698adfe27e55615a8856b0e2c78ad8469 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 14 Jan 2014 23:07:10 -0600 Subject: Function: add fully-tested ActionGroups, per-profile Menus, state object. Form: Add code annotations/comments. Remove dead code. Use Mir style guide. Todo: GSettings toggles, sync with new dbus-test-runner API, get GNOME Panel building again --- include/datetime/clock.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'include/datetime/clock.h') diff --git a/include/datetime/clock.h b/include/datetime/clock.h index 978be27..c8e6c16 100644 --- a/include/datetime/clock.h +++ b/include/datetime/clock.h @@ -20,12 +20,12 @@ #ifndef INDICATOR_DATETIME_CLOCK_H #define INDICATOR_DATETIME_CLOCK_H +#include #include #include #include -#include #include #include @@ -45,9 +45,10 @@ class Clock { public: virtual ~Clock(); - virtual GDateTime* localtime() const = 0; - core::Property > timezones; + virtual DateTime localtime() const =0; + core::Property> timezones; core::Signal<> skewDetected; + core::Signal<> dateChanged; protected: Clock(); @@ -56,12 +57,13 @@ private: static void onSystemBusReady(GObject*, GAsyncResult*, gpointer); static void onPrepareForSleep(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; + + // we've got raw pointers in here, so disable copying Clock(const Clock&) =delete; Clock& operator=(const Clock&) =delete; - - GCancellable * cancellable_ = nullptr; - GDBusConnection * system_bus_ = nullptr; - unsigned int sleep_subscription_id_ = 0; }; /*** @@ -71,16 +73,17 @@ private: /** * \brief A live clock that provides the actual system time. * - * Adds another clock skew detection test: wakes up every - * skewTestIntervalSec seconds to see how much time has passed - * since the last time it checked. + * This subclass also adds another clock skew detection test: + * it wakes up every skewTestIntervalSec seconds to see how + * much time has passed since the last wakeup. If the answer + * isn't what it expected, the skewDetected signal is triggered. */ class LiveClock: public Clock { public: LiveClock (const std::shared_ptr& zones); virtual ~LiveClock(); - virtual GDateTime* localtime() const; + virtual DateTime localtime() const; core::Property skewTestIntervalSec; private: -- cgit v1.2.3