aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-04-12 12:05:11 -0500
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-08-29 14:37:39 +0200
commitd50e6b5cd520143b833ac5f0b55173980d130c14 (patch)
tree2cce325fd66b3247a482dda187f4d12ab1d37dd1 /src
parent3cd2c8e20343ef4b4efe7a34daba72f9af23205d (diff)
downloadayatana-indicator-datetime-d50e6b5cd520143b833ac5f0b55173980d130c14.tar.gz
ayatana-indicator-datetime-d50e6b5cd520143b833ac5f0b55173980d130c14.tar.bz2
ayatana-indicator-datetime-d50e6b5cd520143b833ac5f0b55173980d130c14.zip
in LiveTimezones, pass the primary timezone to it on construction. We used to create it implicitly but can't do that anymore now that TimedatedTimezone takes its own ctor argument.
Diffstat (limited to 'src')
-rw-r--r--src/timezones-live.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/timezones-live.cpp b/src/timezones-live.cpp
index 2979036..f3bd02d 100644
--- a/src/timezones-live.cpp
+++ b/src/timezones-live.cpp
@@ -25,11 +25,14 @@ namespace ayatana {
namespace indicator {
namespace datetime {
-LiveTimezones::LiveTimezones(const std::shared_ptr<const Settings>& settings):
- m_file(),
+LiveTimezones::LiveTimezones(
+ const std::shared_ptr<const Settings>& settings,
+ const std::shared_ptr<Timezone>& primary_timezone
+):
+ m_primary_timezone(primary_timezone),
m_settings(settings)
{
- m_file.timezone.changed().connect([this](const std::string&){update_timezones();});
+ m_primary_timezone->timezone.changed().connect([this](const std::string&){update_timezones();});
m_settings->show_detected_location.changed().connect([this](bool){update_geolocation();});
update_geolocation();
@@ -53,7 +56,7 @@ void LiveTimezones::update_geolocation()
void LiveTimezones::update_timezones()
{
- const auto a = m_file.timezone.get();
+ const auto a = m_primary_timezone->timezone.get();
const auto b = m_geo ? m_geo->timezone.get() : "";
timezone.set(a.empty() ? b : a);