aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2020-09-03 00:41:17 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-09-05 13:05:14 +0200
commit24d102c12a1470726c1d5321a918825cd3d18527 (patch)
treecc0c9ce3d45980673fbf336019791e3684f2c457 /src
parent28ddb97415d894ee01d358d39289c8bd7528a9f2 (diff)
downloadayatana-indicator-datetime-24d102c12a1470726c1d5321a918825cd3d18527.tar.gz
ayatana-indicator-datetime-24d102c12a1470726c1d5321a918825cd3d18527.tar.bz2
ayatana-indicator-datetime-24d102c12a1470726c1d5321a918825cd3d18527.zip
gsettings: Drop the 'show-clock' setting. Always show the clock.
The 'show-clock' gsetting option made it possible to "hide" the time from the indicator. Fixes AyatanaIndicator/ayatana-indicator-datetime#16.
Diffstat (limited to 'src')
-rw-r--r--src/menu.cpp7
-rw-r--r--src/settings-live.cpp14
2 files changed, 2 insertions, 19 deletions
diff --git a/src/menu.cpp b/src/menu.cpp
index 5469dd1..416d02c 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -94,10 +94,6 @@ protected:
update_section(Appointments); // uses formatter.relative_format()
update_section(Locations); // uses formatter.relative_format()
});
- m_state->settings->show_clock.changed().connect([this](bool){
- update_header(); // update header's label
- update_section(Locations); // locations' relative time may have changed
- });
m_state->settings->show_calendar.changed().connect([this](bool){
update_section(Calendar);
});
@@ -465,7 +461,6 @@ protected:
GVariant* create_header_state()
{
- const auto visible = m_state->settings->show_clock.get();
const auto title = _("Date and Time");
auto label = g_variant_new_string(m_formatter->header.get().c_str());
@@ -474,7 +469,7 @@ protected:
g_variant_builder_add(&b, "{sv}", "accessible-desc", label);
g_variant_builder_add(&b, "{sv}", "label", label);
g_variant_builder_add(&b, "{sv}", "title", g_variant_new_string(title));
- g_variant_builder_add(&b, "{sv}", "visible", g_variant_new_boolean(visible));
+ g_variant_builder_add(&b, "{sv}", "visible", g_variant_new_boolean(TRUE));
return g_variant_builder_end(&b);
}
};
diff --git a/src/settings-live.cpp b/src/settings-live.cpp
index 206b762..5c2addb 100644
--- a/src/settings-live.cpp
+++ b/src/settings-live.cpp
@@ -41,7 +41,6 @@ LiveSettings::LiveSettings():
update_custom_time_format();
update_locations();
update_show_calendar();
- update_show_clock();
update_show_date();
update_show_day();
update_show_detected_locations();
@@ -78,10 +77,6 @@ LiveSettings::LiveSettings():
g_settings_set_boolean(m_settings, SETTINGS_SHOW_CALENDAR_S, value);
});
- show_clock.changed().connect([this](bool value){
- g_settings_set_boolean(m_settings, SETTINGS_SHOW_CLOCK_S, value);
- });
-
show_date.changed().connect([this](bool value){
g_settings_set_boolean(m_settings, SETTINGS_SHOW_DATE_S, value);
});
@@ -174,11 +169,6 @@ void LiveSettings::update_show_calendar()
show_calendar.set(val);
}
-void LiveSettings::update_show_clock()
-{
- show_clock.set(g_settings_get_boolean(m_settings, SETTINGS_SHOW_CLOCK_S));
-}
-
void LiveSettings::update_show_date()
{
show_date.set(g_settings_get_boolean(m_settings, SETTINGS_SHOW_DATE_S));
@@ -284,9 +274,7 @@ void LiveSettings::on_changed(GSettings* /*settings*/,
void LiveSettings::update_key(const std::string& key)
{
- if (key == SETTINGS_SHOW_CLOCK_S)
- update_show_clock();
- else if (key == SETTINGS_LOCATIONS_S)
+ if (key == SETTINGS_LOCATIONS_S)
update_locations();
else if (key == SETTINGS_TIME_FORMAT_S)
update_time_format_mode();