From 13fd249f0f4ff0aece96ae5925be76c8d7ca089e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 16 Sep 2014 15:13:16 -0500 Subject: in main.cpp, reuse the existing FileTimezone so that we don't have an unneccessary extra one --- src/main.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 08d6dc1..c16cb20 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -63,20 +63,19 @@ namespace } std::shared_ptr create_state(const std::shared_ptr& engine, - const std::shared_ptr& tz) + const std::shared_ptr& timezone_) { // create the live objects auto live_settings = std::make_shared(); - auto timezone_ = std::make_shared(TIMEZONE_FILE); auto live_clock = std::make_shared(timezone_); // create a full-month planner currently pointing to the current month const auto now = live_clock->localtime(); - auto range_planner = std::make_shared(engine, tz); + auto range_planner = std::make_shared(engine, timezone_); auto calendar_month = std::make_shared(range_planner, now); // create an upcoming-events planner currently pointing to the current date - range_planner = std::make_shared(engine, tz); + range_planner = std::make_shared(engine, timezone_); auto calendar_upcoming = std::make_shared(range_planner, now); // create the state @@ -128,8 +127,8 @@ main(int /*argc*/, char** /*argv*/) textdomain(GETTEXT_PACKAGE); auto engine = create_engine(); - auto timezone = std::make_shared(TIMEZONE_FILE); - auto state = create_state(engine, timezone); + auto timezone_ = std::make_shared(TIMEZONE_FILE); + auto state = create_state(engine, timezone_); auto actions = std::make_shared(state); MenuFactory factory(actions, state); @@ -137,7 +136,7 @@ main(int /*argc*/, char** /*argv*/) auto snooze_planner = std::make_shared(state->settings, state->clock); auto notification_engine = std::make_shared("indicator-datetime-service"); std::unique_ptr snap (new Snap(notification_engine, state->settings)); - auto alarm_queue = create_simple_alarm_queue(state->clock, snooze_planner, engine, timezone); + auto alarm_queue = create_simple_alarm_queue(state->clock, snooze_planner, engine, timezone_); auto on_snooze = [snooze_planner](const Appointment& a) {snooze_planner->add(a);}; auto on_ok = [](const Appointment&){}; auto on_alarm_reached = [&snap, &on_snooze, &on_ok](const Appointment& a) {(*snap)(a, on_snooze, on_ok);}; -- cgit v1.2.3