aboutsummaryrefslogtreecommitdiff
path: root/include/datetime
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-01-30 13:44:12 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-01-30 13:44:12 -0600
commit197309468247c893bdaa37ef47a98db695b2ea78 (patch)
treee95bd0460940252fc3cc2ff66d88394157e5720f /include/datetime
parent0f384f4c9607b785d7df4da8566fe2b869ef11e4 (diff)
downloadayatana-indicator-datetime-197309468247c893bdaa37ef47a98db695b2ea78.tar.gz
ayatana-indicator-datetime-197309468247c893bdaa37ef47a98db695b2ea78.tar.bz2
ayatana-indicator-datetime-197309468247c893bdaa37ef47a98db695b2ea78.zip
following on the review comment covered in the last commit, use shared_ptr<const X> instead of shared_ptr<X> where possible.
Diffstat (limited to 'include/datetime')
-rw-r--r--include/datetime/clock.h2
-rw-r--r--include/datetime/formatter.h8
-rw-r--r--include/datetime/locations-settings.h8
-rw-r--r--include/datetime/menu.h4
-rw-r--r--include/datetime/timezones-live.h4
5 files changed, 13 insertions, 13 deletions
diff --git a/include/datetime/clock.h b/include/datetime/clock.h
index b3e3538..4a9db8f 100644
--- a/include/datetime/clock.h
+++ b/include/datetime/clock.h
@@ -79,7 +79,7 @@ class Timezones;
class LiveClock: public Clock
{
public:
- LiveClock (const std::shared_ptr<Timezones>& zones);
+ LiveClock (const std::shared_ptr<const Timezones>& zones);
virtual ~LiveClock();
virtual DateTime localtime() const;
diff --git a/include/datetime/formatter.h b/include/datetime/formatter.h
index 3de109e..f323858 100644
--- a/include/datetime/formatter.h
+++ b/include/datetime/formatter.h
@@ -86,7 +86,7 @@ public:
std::string getRelativeFormat(GDateTime* then, GDateTime* then_end=nullptr) const;
protected:
- Formatter(const std::shared_ptr<Clock>&);
+ Formatter(const std::shared_ptr<const Clock>&);
virtual ~Formatter();
static const char* getDefaultHeaderTimeFormat(bool twelvehour, bool show_seconds);
@@ -107,10 +107,10 @@ private:
class DesktopFormatter: public Formatter
{
public:
- DesktopFormatter(const std::shared_ptr<Clock>&, const std::shared_ptr<Settings>&);
+ DesktopFormatter(const std::shared_ptr<const Clock>&, const std::shared_ptr<const Settings>&);
private:
- std::shared_ptr<Settings> m_settings;
+ std::shared_ptr<const Settings> m_settings;
void rebuildHeaderFormat();
const gchar* getFullTimeFormatString() const;
@@ -126,7 +126,7 @@ private:
class PhoneFormatter: public Formatter
{
public:
- PhoneFormatter(const std::shared_ptr<Clock>& clock): Formatter(clock) {
+ PhoneFormatter(const std::shared_ptr<const Clock>& clock): Formatter(clock) {
headerFormat.set(getDefaultHeaderTimeFormat(is_locale_12h(), false));
}
};
diff --git a/include/datetime/locations-settings.h b/include/datetime/locations-settings.h
index d01cbb5..8757f43 100644
--- a/include/datetime/locations-settings.h
+++ b/include/datetime/locations-settings.h
@@ -39,12 +39,12 @@ public:
* @param[in] settings the #Settings whose locations property is to be used
* @param[in] timezones the #Timezones to always show first in the list
*/
- SettingsLocations (const std::shared_ptr<Settings>& settings,
- const std::shared_ptr<Timezones>& timezones);
+ SettingsLocations (const std::shared_ptr<const Settings>& settings,
+ const std::shared_ptr<const Timezones>& timezones);
private:
- std::shared_ptr<Settings> m_settings;
- std::shared_ptr<Timezones> m_timezones;
+ std::shared_ptr<const Settings> m_settings;
+ std::shared_ptr<const Timezones> m_timezones;
void reload();
};
diff --git a/include/datetime/menu.h b/include/datetime/menu.h
index a95be10..7b351c3 100644
--- a/include/datetime/menu.h
+++ b/include/datetime/menu.h
@@ -70,12 +70,12 @@ private:
class MenuFactory
{
public:
- MenuFactory (const std::shared_ptr<Actions>& actions, const std::shared_ptr<State>& state);
+ MenuFactory (const std::shared_ptr<Actions>& actions, const std::shared_ptr<const State>& state);
std::shared_ptr<Menu> buildMenu(Menu::Profile profile);
private:
std::shared_ptr<Actions> m_actions;
- std::shared_ptr<State> m_state;
+ std::shared_ptr<const State> m_state;
};
} // namespace datetime
diff --git a/include/datetime/timezones-live.h b/include/datetime/timezones-live.h
index 286c967..ca4ef31 100644
--- a/include/datetime/timezones-live.h
+++ b/include/datetime/timezones-live.h
@@ -38,14 +38,14 @@ namespace datetime {
class LiveTimezones: public Timezones
{
public:
- LiveTimezones(std::shared_ptr<Settings>& settings, const std::string& filename);
+ LiveTimezones(const std::shared_ptr<const Settings>& settings, const std::string& filename);
private:
void update_geolocation();
void update_timezones();
FileTimezone m_file;
- std::shared_ptr<Settings> m_settings;
+ std::shared_ptr<const Settings> m_settings;
std::shared_ptr<GeoclueTimezone> m_geo;
};