diff options
Diffstat (limited to 'include/datetime')
-rw-r--r-- | include/datetime/actions-live.h | 24 | ||||
-rw-r--r-- | include/datetime/actions.h | 2 | ||||
-rw-r--r-- | include/datetime/clock-mock.h | 2 | ||||
-rw-r--r-- | include/datetime/clock.h | 6 | ||||
-rw-r--r-- | include/datetime/dbus-shared.h | 6 | ||||
-rw-r--r-- | include/datetime/engine-eds.h | 6 | ||||
-rw-r--r-- | include/datetime/engine-mock.h | 6 | ||||
-rw-r--r-- | include/datetime/engine.h | 6 | ||||
-rw-r--r-- | include/datetime/exporter.h | 2 | ||||
-rw-r--r-- | include/datetime/formatter.h | 4 | ||||
-rw-r--r-- | include/datetime/planner-range.h | 2 | ||||
-rw-r--r-- | include/datetime/timezone-file.h | 17 | ||||
-rw-r--r-- | include/datetime/timezone-geoclue.h | 22 | ||||
-rw-r--r-- | include/datetime/wakeup-timer-mainloop.h | 2 | ||||
-rw-r--r-- | include/datetime/wakeup-timer-powerd.h | 2 |
15 files changed, 41 insertions, 68 deletions
diff --git a/include/datetime/actions-live.h b/include/datetime/actions-live.h index 0bf48a8..0214d65 100644 --- a/include/datetime/actions-live.h +++ b/include/datetime/actions-live.h @@ -36,21 +36,21 @@ namespace datetime { class LiveActions: public Actions { public: - LiveActions(const std::shared_ptr<State>& state_in); - ~LiveActions() =default; + explicit LiveActions(const std::shared_ptr<State>& state_in); + virtual ~LiveActions() =default; - bool desktop_has_calendar_app() const; - void desktop_open_alarm_app(); - void desktop_open_appointment(const Appointment&); - void desktop_open_calendar_app(const DateTime&); - void desktop_open_settings_app(); + bool desktop_has_calendar_app() const override; + void desktop_open_alarm_app() override; + void desktop_open_appointment(const Appointment&) override; + void desktop_open_calendar_app(const DateTime&) override; + void desktop_open_settings_app() override; - void phone_open_alarm_app(); - void phone_open_appointment(const Appointment&); - void phone_open_calendar_app(const DateTime&); - void phone_open_settings_app(); + void phone_open_alarm_app() override; + void phone_open_appointment(const Appointment&) override; + void phone_open_calendar_app(const DateTime&) override; + void phone_open_settings_app() override; - void set_location(const std::string& zone, const std::string& name); + void set_location(const std::string& zone, const std::string& name) override; protected: virtual void execute_command(const std::string& command); diff --git a/include/datetime/actions.h b/include/datetime/actions.h index f59ef67..87cb676 100644 --- a/include/datetime/actions.h +++ b/include/datetime/actions.h @@ -61,7 +61,7 @@ public: const std::shared_ptr<State> state() const; protected: - Actions(const std::shared_ptr<State>& state); + explicit Actions(const std::shared_ptr<State>& state); virtual ~Actions(); private: diff --git a/include/datetime/clock-mock.h b/include/datetime/clock-mock.h index 0e24377..84fd860 100644 --- a/include/datetime/clock-mock.h +++ b/include/datetime/clock-mock.h @@ -36,7 +36,7 @@ namespace datetime { class MockClock: public Clock { public: - MockClock(const DateTime& dt): m_localtime(dt) {} + explicit MockClock(const DateTime& dt): m_localtime(dt) {} ~MockClock() =default; DateTime localtime() const { return m_localtime; } diff --git a/include/datetime/clock.h b/include/datetime/clock.h index 0b2a543..8745d24 100644 --- a/include/datetime/clock.h +++ b/include/datetime/clock.h @@ -25,8 +25,6 @@ #include <core/property.h> #include <core/signal.h> -#include <gio/gio.h> // GDBusConnection - #include <memory> // std::shared_ptr, std::unique_ptr namespace unity { @@ -68,7 +66,7 @@ private: **** ***/ -class Timezones; +class Timezone; /** * \brief A live #Clock that provides the actual system time. @@ -76,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; diff --git a/include/datetime/dbus-shared.h b/include/datetime/dbus-shared.h index c09caa2..0c6b4be 100644 --- a/include/datetime/dbus-shared.h +++ b/include/datetime/dbus-shared.h @@ -18,8 +18,8 @@ * Charles Kerr <charles.kerr@canonical.com> */ -#ifndef _INDICATOR_DATETIME_DBUS_SHARED_H_ -#define _INDICATOR_DATETIME_DBUS_SHARED_H_ +#ifndef INDICATOR_DATETIME_DBUS_SHARED_H +#define INDICATOR_DATETIME_DBUS_SHARED_H #define BUS_DATETIME_NAME "com.canonical.indicator.datetime" #define BUS_DATETIME_PATH "/com/canonical/indicator/datetime" @@ -29,4 +29,4 @@ #define BUS_POWERD_INTERFACE "com.canonical.powerd" -#endif /* _INDICATOR_DATETIME_DBUS_SHARED_H_ */ +#endif /* INDICATOR_DATETIME_DBUS_SHARED_H */ diff --git a/include/datetime/engine-eds.h b/include/datetime/engine-eds.h index 4b260a8..ebee838 100644 --- a/include/datetime/engine-eds.h +++ b/include/datetime/engine-eds.h @@ -17,8 +17,8 @@ * Charles Kerr <charles.kerr@canonical.com> */ -#ifndef INDICATOR_DATETIME_ENGINE_EDS__H -#define INDICATOR_DATETIME_ENGINE_EDS__H +#ifndef INDICATOR_DATETIME_ENGINE_EDS_H +#define INDICATOR_DATETIME_ENGINE_EDS_H #include <datetime/engine.h> @@ -72,4 +72,4 @@ private: } // namespace indicator } // namespace unity -#endif // INDICATOR_DATETIME_ENGINE_EDS__H +#endif // INDICATOR_DATETIME_ENGINE_EDS_H diff --git a/include/datetime/engine-mock.h b/include/datetime/engine-mock.h index ecbf102..4b25120 100644 --- a/include/datetime/engine-mock.h +++ b/include/datetime/engine-mock.h @@ -17,8 +17,8 @@ * Charles Kerr <charles.kerr@canonical.com> */ -#ifndef INDICATOR_DATETIME_ENGINE_MOCK__H -#define INDICATOR_DATETIME_ENGINE_MOCK__H +#ifndef INDICATOR_DATETIME_ENGINE_MOCK_H +#define INDICATOR_DATETIME_ENGINE_MOCK_H #include <datetime/engine.h> @@ -65,4 +65,4 @@ private: } // namespace indicator } // namespace unity -#endif // INDICATOR_DATETIME_ENGINE_NOOP__H +#endif // INDICATOR_DATETIME_ENGINE_MOCK_H diff --git a/include/datetime/engine.h b/include/datetime/engine.h index 2e8237e..56e9343 100644 --- a/include/datetime/engine.h +++ b/include/datetime/engine.h @@ -17,8 +17,8 @@ * Charles Kerr <charles.kerr@canonical.com> */ -#ifndef INDICATOR_DATETIME_ENGINE__H -#define INDICATOR_DATETIME_ENGINE__H +#ifndef INDICATOR_DATETIME_ENGINE_H +#define INDICATOR_DATETIME_ENGINE_H #include <datetime/appointment.h> #include <datetime/date-time.h> @@ -65,4 +65,4 @@ protected: } // namespace indicator } // namespace unity -#endif // INDICATOR_DATETIME_ENGINE__H +#endif // INDICATOR_DATETIME_ENGINE_H diff --git a/include/datetime/exporter.h b/include/datetime/exporter.h index dd57263..211e7bb 100644 --- a/include/datetime/exporter.h +++ b/include/datetime/exporter.h @@ -39,7 +39,7 @@ namespace datetime { class Exporter { public: - Exporter(const std::shared_ptr<Settings>&); + explicit Exporter(const std::shared_ptr<Settings>&); ~Exporter(); core::Signal<>& name_lost(); diff --git a/include/datetime/formatter.h b/include/datetime/formatter.h index 0d695e2..9b3699d 100644 --- a/include/datetime/formatter.h +++ b/include/datetime/formatter.h @@ -86,7 +86,7 @@ public: std::string relative_format(GDateTime* then, GDateTime* then_end=nullptr) const; protected: - Formatter(const std::shared_ptr<const Clock>&); + explicit Formatter(const std::shared_ptr<const Clock>&); virtual ~Formatter(); static const char* default_header_time_format(bool twelvehour, bool show_seconds); @@ -126,7 +126,7 @@ private: class PhoneFormatter: public Formatter { public: - PhoneFormatter(const std::shared_ptr<const Clock>& clock): Formatter(clock) { + explicit PhoneFormatter(const std::shared_ptr<const Clock>& clock): Formatter(clock) { header_format.set(default_header_time_format(is_locale_12h(), false)); } }; diff --git a/include/datetime/planner-range.h b/include/datetime/planner-range.h index 2ee2fa0..d638182 100644 --- a/include/datetime/planner-range.h +++ b/include/datetime/planner-range.h @@ -72,7 +72,7 @@ private: core::Property<std::vector<Appointment>> m_appointments; // we've got a GSignal tag here, so disable copying - SimpleRangePlanner(const RangePlanner&) =delete; + explicit SimpleRangePlanner(const RangePlanner&) =delete; SimpleRangePlanner& operator=(const RangePlanner&) =delete; }; diff --git a/include/datetime/timezone-file.h b/include/datetime/timezone-file.h index a67c01a..eca9c29 100644 --- a/include/datetime/timezone-file.h +++ b/include/datetime/timezone-file.h @@ -24,9 +24,6 @@ #include <string> // std::string -#include <glib.h> -#include <gio/gio.h> - namespace unity { namespace indicator { namespace datetime { @@ -37,21 +34,15 @@ namespace datetime { class FileTimezone: public Timezone { public: - FileTimezone(); FileTimezone(const std::string& filename); ~FileTimezone(); private: - void set_filename(const std::string& filename); - static void on_file_changed(gpointer gself); - void clear(); - void reload(); - - std::string m_filename; - GFileMonitor * m_monitor = nullptr; - unsigned long m_monitor_handler_id = 0; + class Impl; + friend Impl; + std::unique_ptr<Impl> impl; - // we have raw pointers and glib tags in here, so disable copying + // we have pointers in here, so disable copying FileTimezone(const FileTimezone&) =delete; FileTimezone& operator=(const FileTimezone&) =delete; }; diff --git a/include/datetime/timezone-geoclue.h b/include/datetime/timezone-geoclue.h index 4a5b726..ab6b815 100644 --- a/include/datetime/timezone-geoclue.h +++ b/include/datetime/timezone-geoclue.h @@ -22,11 +22,6 @@ #include <datetime/timezone.h> // base class -#include <string> - -#include <glib.h> -#include <gio/gio.h> - namespace unity { namespace indicator { namespace datetime { @@ -41,21 +36,10 @@ public: ~GeoclueTimezone(); private: - static void on_bus_got (GObject*, GAsyncResult*, gpointer); - static void on_client_created (GObject*, GAsyncResult*, gpointer); - static void on_address_changed (GDBusConnection*, const gchar*, const gchar*, const gchar*, const gchar*, GVariant*, gpointer); - static void on_requirements_set (GObject*, GAsyncResult*, gpointer); - static void on_address_started (GObject*, GAsyncResult*, gpointer); - static void on_address_got (GObject*, GAsyncResult*, gpointer); - void setTimezoneFromAddressVariant (GVariant*); - static GVariant * call_finish (GObject*, GAsyncResult*); - - GCancellable * m_cancellable = nullptr; - GDBusConnection * m_connection = nullptr; - std::string m_client_object_path; - guint m_signal_subscription = 0; + struct Impl; + std::unique_ptr<Impl> impl; - // we've got pointers and gsignal tags in here, so don't allow copying + // we've got pointers in here, so don't allow copying GeoclueTimezone(const GeoclueTimezone&) =delete; GeoclueTimezone& operator=(const GeoclueTimezone&) =delete; }; diff --git a/include/datetime/wakeup-timer-mainloop.h b/include/datetime/wakeup-timer-mainloop.h index 480d728..86da8cf 100644 --- a/include/datetime/wakeup-timer-mainloop.h +++ b/include/datetime/wakeup-timer-mainloop.h @@ -39,7 +39,7 @@ namespace datetime { class MainloopWakeupTimer: public WakeupTimer { public: - MainloopWakeupTimer(const std::shared_ptr<Clock>&); + explicit MainloopWakeupTimer(const std::shared_ptr<Clock>&); ~MainloopWakeupTimer(); void set_wakeup_time (const DateTime&); core::Signal<>& timeout(); diff --git a/include/datetime/wakeup-timer-powerd.h b/include/datetime/wakeup-timer-powerd.h index 6adbbb8..f11febe 100644 --- a/include/datetime/wakeup-timer-powerd.h +++ b/include/datetime/wakeup-timer-powerd.h @@ -39,7 +39,7 @@ namespace datetime { class PowerdWakeupTimer: public WakeupTimer { public: - PowerdWakeupTimer(const std::shared_ptr<Clock>&); + explicit PowerdWakeupTimer(const std::shared_ptr<Clock>&); ~PowerdWakeupTimer(); void set_wakeup_time(const DateTime&); core::Signal<>& timeout(); |