aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-10-05 13:06:35 -0500
committerCharles Kerr <charles.kerr@canonical.com>2015-10-05 13:06:35 -0500
commit55ec6e57ee6ec5930b2ec74ececde52ead16f935 (patch)
tree7c23970516b3faeb0d70ecaa95888d5dfd959aa0 /include
parent645e1ade17334468583a0227cf685940ce6043aa (diff)
parent3f3445ae0c7c47f3351bccbb4e653c875da89f85 (diff)
downloadayatana-indicator-datetime-55ec6e57ee6ec5930b2ec74ececde52ead16f935.tar.gz
ayatana-indicator-datetime-55ec6e57ee6ec5930b2ec74ececde52ead16f935.tar.bz2
ayatana-indicator-datetime-55ec6e57ee6ec5930b2ec74ececde52ead16f935.zip
sync with trunk
Diffstat (limited to 'include')
-rw-r--r--include/datetime/timezone-timedated.h (renamed from include/datetime/timezone-file.h)18
-rw-r--r--include/datetime/timezones-live.h8
2 files changed, 14 insertions, 12 deletions
diff --git a/include/datetime/timezone-file.h b/include/datetime/timezone-timedated.h
index eca9c29..5978e3e 100644
--- a/include/datetime/timezone-file.h
+++ b/include/datetime/timezone-timedated.h
@@ -17,8 +17,10 @@
* Charles Kerr <charles.kerr@canonical.com>
*/
-#ifndef INDICATOR_DATETIME_FILE_TIMEZONE_H
-#define INDICATOR_DATETIME_FILE_TIMEZONE_H
+#ifndef INDICATOR_DATETIME_TIMEDATED_TIMEZONE_H
+#define INDICATOR_DATETIME_TIMEDATED_TIMEZONE_H
+
+#define DEFAULT_FILENAME "/etc/timezone"
#include <datetime/timezone.h> // base class
@@ -31,11 +33,11 @@ namespace datetime {
/**
* \brief A #Timezone that gets its information from monitoring a file, such as /etc/timezone
*/
-class FileTimezone: public Timezone
+class TimedatedTimezone: public Timezone
{
public:
- FileTimezone(const std::string& filename);
- ~FileTimezone();
+ TimedatedTimezone(std::string filename = DEFAULT_FILENAME);
+ ~TimedatedTimezone();
private:
class Impl;
@@ -43,12 +45,12 @@ private:
std::unique_ptr<Impl> impl;
// we have pointers in here, so disable copying
- FileTimezone(const FileTimezone&) =delete;
- FileTimezone& operator=(const FileTimezone&) =delete;
+ TimedatedTimezone(const TimedatedTimezone&) =delete;
+ TimedatedTimezone& operator=(const TimedatedTimezone&) =delete;
};
} // namespace datetime
} // namespace indicator
} // namespace unity
-#endif // INDICATOR_DATETIME_FILE_TIMEZONE_H
+#endif // INDICATOR_DATETIME_TIMEDATED_TIMEZONE_H
diff --git a/include/datetime/timezones-live.h b/include/datetime/timezones-live.h
index ca4ef31..b9d78a5 100644
--- a/include/datetime/timezones-live.h
+++ b/include/datetime/timezones-live.h
@@ -22,8 +22,8 @@
#include <datetime/settings.h>
#include <datetime/timezones.h>
-#include <datetime/timezone-file.h>
#include <datetime/timezone-geoclue.h>
+#include <datetime/timezone-timedated.h>
#include <memory> // shared_ptr<>
@@ -32,19 +32,19 @@ namespace indicator {
namespace datetime {
/**
- * \brief #Timezones object that uses a #FileTimezone and #GeoclueTimezone
+ * \brief #Timezones object that uses a #TimedatedTimezone and #GeoclueTimezone
* to detect what timezone we're in
*/
class LiveTimezones: public Timezones
{
public:
- LiveTimezones(const std::shared_ptr<const Settings>& settings, const std::string& filename);
+ LiveTimezones(const std::shared_ptr<const Settings>& settings);
private:
void update_geolocation();
void update_timezones();
- FileTimezone m_file;
+ TimedatedTimezone m_file;
std::shared_ptr<const Settings> m_settings;
std::shared_ptr<GeoclueTimezone> m_geo;
};