aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-19 14:34:32 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-09-19 14:34:32 +0000
commitac54aebec5fa0ba95fb2d583316c0a64ce3384dd (patch)
tree6f18f7a498f0c6e978354940a46a68733204c01f /include
parenta72a776c15a48341b9b06bbdd113d4112acd3e20 (diff)
parent13d371f6c4974baad92574f5e287a72313080432 (diff)
downloadayatana-indicator-datetime-ac54aebec5fa0ba95fb2d583316c0a64ce3384dd.tar.gz
ayatana-indicator-datetime-ac54aebec5fa0ba95fb2d583316c0a64ce3384dd.tar.bz2
ayatana-indicator-datetime-ac54aebec5fa0ba95fb2d583316c0a64ce3384dd.zip
Move timezone code behind a private Impl class
Approved by: Ted Gould, PS Jenkins bot
Diffstat (limited to 'include')
-rw-r--r--include/datetime/clock.h2
-rw-r--r--include/datetime/timezone-file.h17
-rw-r--r--include/datetime/timezone-geoclue.h22
3 files changed, 7 insertions, 34 deletions
diff --git a/include/datetime/clock.h b/include/datetime/clock.h
index 64d275b..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 {
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;
};