diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-01-30 13:17:11 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-01-30 13:17:11 -0600 |
commit | b56293e7b4fb4b253da17119ad153990744dac3b (patch) | |
tree | 8697db5f1aed5b0c4e96a98e7f733d0463537f74 /src | |
parent | fee34f529e85e97cb439ea9fbbb210cffd51a6cf (diff) | |
download | ayatana-indicator-datetime-b56293e7b4fb4b253da17119ad153990744dac3b.tar.gz ayatana-indicator-datetime-b56293e7b4fb4b253da17119ad153990744dac3b.tar.bz2 ayatana-indicator-datetime-b56293e7b4fb4b253da17119ad153990744dac3b.zip |
as per review, constify getters where possible. This isn't always possible due to system APIs asking for non-const pointers.
Diffstat (limited to 'src')
-rw-r--r-- | src/actions.cpp | 6 | ||||
-rw-r--r-- | src/menu.cpp | 5 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/actions.cpp b/src/actions.cpp index 6ee3896..cdeb77f 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -65,7 +65,7 @@ void on_activate_appointment(GSimpleAction * /*action*/, g_return_if_fail(uid && *uid); // find url of the upcoming appointment with this uid - for (auto& appt : self->state()->planner->upcoming.get()) + for (const auto& appt : self->state()->planner->upcoming.get()) { if (appt.uid == uid) { @@ -146,7 +146,7 @@ GVariant* create_default_header_state() GVariant* create_calendar_state(const std::shared_ptr<State>& state) { gboolean days[32] = { 0 }; - for(const auto& appt : state->planner->thisMonth.get()) + for (const auto& appt : state->planner->thisMonth.get()) days[appt.begin.day_of_month()] = true; GVariantBuilder day_builder; @@ -254,7 +254,7 @@ GActionGroup* Actions::action_group() return G_ACTION_GROUP(m_actions); } -std::shared_ptr<State> Actions::state() +const std::shared_ptr<State> Actions::state() const { return m_state; } diff --git a/src/menu.cpp b/src/menu.cpp index b263520..696ed2b 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -558,11 +558,6 @@ MenuFactory::MenuFactory(std::shared_ptr<Actions>& actions_, { } -std::shared_ptr<State> MenuFactory::state() -{ - return m_state; -} - std::shared_ptr<Menu> MenuFactory::buildMenu(Menu::Profile profile) { |