aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-01-30 12:45:50 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-01-30 12:45:50 -0600
commitd2caa37e18191c31d866dd3042b676c135bae50d (patch)
tree603cdc81a45c1d6e5250e72954f3876b56ca24e1
parent9752ca1cd3e75e1245ebb8dcb4719503e332a352 (diff)
downloadayatana-indicator-datetime-d2caa37e18191c31d866dd3042b676c135bae50d.tar.gz
ayatana-indicator-datetime-d2caa37e18191c31d866dd3042b676c135bae50d.tar.bz2
ayatana-indicator-datetime-d2caa37e18191c31d866dd3042b676c135bae50d.zip
as per review, don't inline getters
-rw-r--r--include/datetime/actions.h4
-rw-r--r--include/datetime/locations.h4
-rw-r--r--include/datetime/menu.h8
-rw-r--r--src/actions.cpp11
-rw-r--r--src/locations.cpp10
-rw-r--r--src/menu.cpp26
6 files changed, 55 insertions, 8 deletions
diff --git a/include/datetime/actions.h b/include/datetime/actions.h
index 3686b95..6817b4c 100644
--- a/include/datetime/actions.h
+++ b/include/datetime/actions.h
@@ -50,8 +50,8 @@ public:
virtual void open_appointment(const std::string& uid) =0;
virtual void set_location(const std::string& zone, const std::string& name)=0;
void set_calendar_date(const DateTime&);
- GActionGroup* action_group() { return G_ACTION_GROUP(m_actions); }
- std::shared_ptr<State> state() { return m_state; }
+ GActionGroup* action_group();
+ std::shared_ptr<State> state();
protected:
Actions(const std::shared_ptr<State>& state);
diff --git a/include/datetime/locations.h b/include/datetime/locations.h
index ee67615..fc776bb 100644
--- a/include/datetime/locations.h
+++ b/include/datetime/locations.h
@@ -39,9 +39,9 @@ namespace datetime {
class Location
{
public:
- const std::string& zone() const { return m_zone; }
+ const std::string& zone() const;
- const std::string& name() const { return m_name; }
+ const std::string& name() const;
bool operator== (const Location& that) const
{
diff --git a/include/datetime/menu.h b/include/datetime/menu.h
index fcd709f..f097b02 100644
--- a/include/datetime/menu.h
+++ b/include/datetime/menu.h
@@ -43,9 +43,9 @@ class Menu
public:
enum Profile { Desktop, DesktopGreeter, Phone, PhoneGreeter, NUM_PROFILES };
enum Section { Calendar, Appointments, Locations, Settings, NUM_SECTIONS };
- const std::string& name() const { return m_name; }
- Profile profile() const { return m_profile; }
- GMenuModel* menu_model() { return G_MENU_MODEL(m_menu); }
+ const std::string& name() const;
+ Profile profile() const;
+ GMenuModel* menu_model();
protected:
Menu (Profile profile_in, const std::string& name_in): m_profile(profile_in), m_name(name_in) {}
@@ -72,7 +72,7 @@ class MenuFactory
public:
MenuFactory (std::shared_ptr<Actions>& actions, std::shared_ptr<State>& state);
std::shared_ptr<Menu> buildMenu(Menu::Profile profile);
- std::shared_ptr<State> state() { return m_state; }
+ std::shared_ptr<State> state();
private:
std::shared_ptr<Actions> m_actions;
diff --git a/src/actions.cpp b/src/actions.cpp
index acf8fd4..6ee3896 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -249,6 +249,17 @@ void Actions::set_calendar_date(const DateTime& date)
m_state->planner->time.set(date);
}
+GActionGroup* Actions::action_group()
+{
+ return G_ACTION_GROUP(m_actions);
+}
+
+std::shared_ptr<State> Actions::state()
+{
+ return m_state;
+}
+
+
} // namespace datetime
} // namespace indicator
diff --git a/src/locations.cpp b/src/locations.cpp
index d6ab73a..8d1a086 100644
--- a/src/locations.cpp
+++ b/src/locations.cpp
@@ -25,6 +25,16 @@ namespace unity {
namespace indicator {
namespace datetime {
+const std::string& Location::zone() const
+{
+ return m_zone;
+}
+
+const std::string& Location::name() const
+{
+ return m_name;
+}
+
Location::Location(const std::string& zone_, const std::string& name_):
m_zone(zone_),
m_name(name_)
diff --git a/src/menu.cpp b/src/menu.cpp
index d0756cc..4bb4fb6 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -35,6 +35,27 @@ namespace datetime {
*****
****/
+const std::string& Menu::name() const
+{
+ return m_name;
+}
+
+Menu::Profile Menu::profile() const
+{
+ return m_profile;
+}
+
+GMenuModel* Menu::menu_model()
+{
+ return G_MENU_MODEL(m_menu);
+}
+
+
+/****
+*****
+****/
+
+
#define FALLBACK_ALARM_CLOCK_ICON_NAME "clock"
#define CALENDAR_ICON_NAME "calendar"
@@ -531,6 +552,11 @@ 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)
{