aboutsummaryrefslogtreecommitdiff
path: root/src/actions.cpp
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2020-07-26 19:01:02 +0200
committerRobert Tari <robert@tari.in>2020-07-26 19:13:08 +0200
commite7f2629167e523c5124d1f3e1ff1e8a481b5f210 (patch)
treeac3804d1e42d93ed0d97bed70a5c836de161ee93 /src/actions.cpp
parentd75484963ae648ffdb0f36a9cc1f225e5129c5c7 (diff)
downloadayatana-indicator-datetime-e7f2629167e523c5124d1f3e1ff1e8a481b5f210.tar.gz
ayatana-indicator-datetime-e7f2629167e523c5124d1f3e1ff1e8a481b5f210.tar.bz2
ayatana-indicator-datetime-e7f2629167e523c5124d1f3e1ff1e8a481b5f210.zip
Fix calendar going into update loop
Diffstat (limited to 'src/actions.cpp')
-rw-r--r--src/actions.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/actions.cpp b/src/actions.cpp
index 663812c..93629a0 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -130,7 +130,7 @@ void on_calendar_active_changed(GSimpleAction * /*action*/,
{
auto self = static_cast<Actions*>(gself);
- self->set_calendar_date(self->state()->clock->localtime());
+ self->set_calendar_date(self->state()->clock->localtime(), true);
}
}
@@ -143,7 +143,7 @@ void on_calendar_activated(GSimpleAction * /*action*/,
g_return_if_fail(t != 0);
auto dt = DateTime::Local(t).start_of_day();
- static_cast<Actions*>(gself)->set_calendar_date(dt);
+ static_cast<Actions*>(gself)->set_calendar_date(dt, false);
}
GVariant* create_default_header_state()
@@ -272,9 +272,13 @@ void Actions::update_calendar_state()
create_calendar_state(m_state));
}
-void Actions::set_calendar_date(const DateTime& date)
+void Actions::set_calendar_date(const DateTime& date, bool bUpdateCalendar)
{
- m_state->calendar_month->month().set(date);
+ if (bUpdateCalendar)
+ {
+ m_state->calendar_month->month().set(date);
+ }
+
m_state->calendar_upcoming->date().set(date);
}