aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2018-03-26 16:29:11 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-26 21:07:40 +0000
commit480e93c6762faaf6f8f1c5c3dfdf06c94317b7f0 (patch)
tree79a09f29cbe69aa0b32ed0652319c19c2f080948
parent2e14b67ca57829d097b9e850e95b96934ec7d97d (diff)
downloadayatana-indicator-datetime-480e93c6762faaf6f8f1c5c3dfdf06c94317b7f0.tar.gz
ayatana-indicator-datetime-480e93c6762faaf6f8f1c5c3dfdf06c94317b7f0.tar.bz2
ayatana-indicator-datetime-480e93c6762faaf6f8f1c5c3dfdf06c94317b7f0.zip
phone<-->desktop convergence
-rw-r--r--src/menu.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index 1bf8111..2556921 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -235,7 +235,7 @@ private:
GMenuModel* create_calendar_section(Profile profile)
{
const bool show_calendar = m_state->settings->show_calendar.get() &&
- ((profile == Desktop) || (profile == DesktopGreeter));
+ ((profile == Desktop) || (profile == DesktopGreeter) || (profile == Phone));
auto menu = g_menu_new();
const char * action_name;
@@ -374,25 +374,22 @@ private:
{
GMenu* menu = g_menu_new();
- if (profile == Desktop)
- {
- const auto now = m_state->clock->localtime();
+ const auto now = m_state->clock->localtime();
- for(const auto& location : m_state->locations->locations.get())
- {
- const auto& zone = location.zone();
- const auto& name = location.name();
- const auto zone_now = now.to_timezone(zone);
- const auto fmt = m_formatter->relative_format(zone_now.get());
- auto detailed_action = g_strdup_printf("indicator.set-location::%s %s", zone.c_str(), name.c_str());
- auto i = g_menu_item_new (name.c_str(), detailed_action);
- g_menu_item_set_attribute(i, "x-canonical-type", "s", "org.ayatana.indicator.location");
- g_menu_item_set_attribute(i, "x-canonical-timezone", "s", zone.c_str());
- g_menu_item_set_attribute(i, "x-canonical-time-format", "s", fmt.c_str());
- g_menu_append_item (menu, i);
- g_object_unref(i);
- g_free(detailed_action);
- }
+ for(const auto& location : m_state->locations->locations.get())
+ {
+ const auto& zone = location.zone();
+ const auto& name = location.name();
+ const auto zone_now = now.to_timezone(zone);
+ const auto fmt = m_formatter->relative_format(zone_now.get());
+ auto detailed_action = g_strdup_printf("indicator.set-location::%s %s", zone.c_str(), name.c_str());
+ auto i = g_menu_item_new (name.c_str(), detailed_action);
+ g_menu_item_set_attribute(i, "x-canonical-type", "s", "org.ayatana.indicator.location");
+ g_menu_item_set_attribute(i, "x-canonical-timezone", "s", zone.c_str());
+ g_menu_item_set_attribute(i, "x-canonical-time-format", "s", fmt.c_str());
+ g_menu_append_item (menu, i);
+ g_object_unref(i);
+ g_free(detailed_action);
}
return G_MENU_MODEL(menu);