From ed9d932ef17fd55d8858a9391ab81d237a6be5ad Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 9 Mar 2014 12:41:45 -0500 Subject: in EdsPlanner, use a Timezone instead of Timezones object --- src/main.cpp | 4 +++- src/planner-eds.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 762795f..24a9409 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include // bindtextdomain() @@ -56,10 +57,11 @@ main(int /*argc*/, char** /*argv*/) std::shared_ptr live_settings(new LiveSettings); std::shared_ptr live_timezones(new LiveTimezones(live_settings, TIMEZONE_FILE)); std::shared_ptr live_clock(new LiveClock(live_timezones)); + std::shared_ptr file_timezone(new FileTimezone(TIMEZONE_FILE)); state->settings = live_settings; state->clock = live_clock; state->locations.reset(new SettingsLocations(live_settings, live_timezones)); - state->planner.reset(new PlannerEds(live_clock, live_timezones)); + state->planner.reset(new PlannerEds(live_clock, file_timezone)); state->planner->time = live_clock->localtime(); std::shared_ptr actions(new LiveActions(state)); MenuFactory factory(actions, state); diff --git a/src/planner-eds.cpp b/src/planner-eds.cpp index 8eeca43..f47c2e9 100644 --- a/src/planner-eds.cpp +++ b/src/planner-eds.cpp @@ -44,10 +44,10 @@ public: Impl(PlannerEds& owner, const std::shared_ptr& clock, - const std::shared_ptr& timezones): + const std::shared_ptr& timezone): m_owner(owner), m_clock(clock), - m_timezones(timezones), + m_timezone(timezone), m_cancellable(g_cancellable_new()) { e_source_registry_new(m_cancellable, on_source_registry_ready, this); @@ -394,7 +394,7 @@ private: **/ icaltimezone * default_timezone = nullptr; - const auto tz = m_timezones->timezone.get().c_str(); + const auto tz = m_timezone->timezone.get().c_str(); if (tz && *tz) { default_timezone = icaltimezone_get_builtin_timezone(tz); @@ -546,7 +546,7 @@ private: PlannerEds& m_owner; std::shared_ptr m_clock; - std::shared_ptr m_timezones; + std::shared_ptr m_timezone; std::set m_sources; std::map m_clients; std::map m_views; @@ -558,8 +558,8 @@ private: }; PlannerEds::PlannerEds(const std::shared_ptr& clock, - const std::shared_ptr& timezones): - p(new Impl(*this, clock, timezones)) {} + const std::shared_ptr& timezone): + p(new Impl(*this, clock, timezone)) {} PlannerEds::~PlannerEds() =default; -- cgit v1.2.3