aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-01-16 17:42:43 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-01-16 17:42:43 -0600
commit40689ea36c360cb6fb42048f5d93303237745b86 (patch)
treed6aa59ed19596f928a6db2c1f1e5d8079ae4a159 /src
parent4cc19729c540ffba163d5c9a53b9352fe61fe8af (diff)
downloadayatana-indicator-datetime-40689ea36c360cb6fb42048f5d93303237745b86.tar.gz
ayatana-indicator-datetime-40689ea36c360cb6fb42048f5d93303237745b86.tar.bz2
ayatana-indicator-datetime-40689ea36c360cb6fb42048f5d93303237745b86.zip
update timezones-live to use Settings to tell when the user has enabled/disabled GeoClue lookups
Diffstat (limited to 'src')
-rw-r--r--src/timezones-live.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/timezones-live.cpp b/src/timezones-live.cpp
index dc14021..baac05d 100644
--- a/src/timezones-live.cpp
+++ b/src/timezones-live.cpp
@@ -18,18 +18,20 @@
*/
#include <datetime/timezones-live.h>
+
#include <glib.h>
namespace unity {
namespace indicator {
namespace datetime {
-LiveTimezones::LiveTimezones(const std::string& filename):
- m_file(filename)
+LiveTimezones::LiveTimezones(std::shared_ptr<Settings>& settings, const std::string& filename):
+ m_file(filename),
+ m_settings(settings)
{
m_file.timezone.changed().connect([this](const std::string&){update_timezones();});
- geolocation_enabled.changed().connect([this](bool){update_geolocation();});
+ m_settings->show_detected_location.changed().connect([this](bool){update_geolocation();});
update_geolocation();
update_timezones();
@@ -37,9 +39,11 @@ LiveTimezones::LiveTimezones(const std::string& filename):
void LiveTimezones::update_geolocation()
{
+ // clear the previous pointer, if any
m_geo.reset();
- if(geolocation_enabled.get())
+ // if location detection is enabled, turn on GeoClue
+ if(m_settings->show_detected_location.get())
{
auto geo = new GeoclueTimezone();
geo->timezone.changed().connect([this](const std::string&){update_timezones();});