diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-03-17 15:23:49 +0000 |
---|---|---|
committer | CI Train Bot <ci-train-bot@canonical.com> | 2015-03-17 15:23:49 +0000 |
commit | ddde67df581dea8c5a261e43d5b12a3821f06ed1 (patch) | |
tree | e3c2859c54b0bba9c72ad221ea41c95ed8f5a70f /src/actions.cpp | |
parent | 15ec7f61fa84a9a8b40c1c9fcfa6c2a268d3232b (diff) | |
parent | 273c3b3829c9a3e853d0b6b0a32ae87cc3c6852b (diff) | |
download | ayatana-indicator-datetime-ddde67df581dea8c5a261e43d5b12a3821f06ed1.tar.gz ayatana-indicator-datetime-ddde67df581dea8c5a261e43d5b12a3821f06ed1.tar.bz2 ayatana-indicator-datetime-ddde67df581dea8c5a261e43d5b12a3821f06ed1.zip |
Fix bug that prevented clicking on calendar days where DST sprang forward. Fixes: #1429388
Approved by: Ted Gould, PS Jenkins bot
Diffstat (limited to 'src/actions.cpp')
-rw-r--r-- | src/actions.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/actions.cpp b/src/actions.cpp index 1b665cc..839c9cd 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -143,9 +143,7 @@ void on_calendar_activated(GSimpleAction * /*action*/, g_return_if_fail(t != 0); - // the client gave us a date; remove the HMS component from the resulting DateTime - auto dt = DateTime(t); - dt = dt.add_full (0, 0, 0, -dt.hour(), -dt.minute(), -dt.seconds()); + auto dt = DateTime(t).start_of_day(); static_cast<Actions*>(gself)->set_calendar_date(dt); } @@ -225,18 +223,26 @@ Actions::Actions(const std::shared_ptr<State>& state): auto v = create_default_header_state(); auto a = g_simple_action_new_stateful("desktop-header", nullptr, v); g_action_map_add_action(gam, G_ACTION(a)); + g_object_unref(a); + a = g_simple_action_new_stateful("desktop_greeter-header", nullptr, v); g_action_map_add_action(gam, G_ACTION(a)); + g_object_unref(a); + a = g_simple_action_new_stateful("phone-header", nullptr, v); g_action_map_add_action(gam, G_ACTION(a)); + g_object_unref(a); + a = g_simple_action_new_stateful("phone_greeter-header", nullptr, v); g_action_map_add_action(gam, G_ACTION(a)); + g_object_unref(a); // add the calendar action v = create_calendar_state(state); a = g_simple_action_new_stateful("calendar", G_VARIANT_TYPE_INT64, v); g_action_map_add_action(gam, G_ACTION(a)); g_signal_connect(a, "activate", G_CALLBACK(on_calendar_activated), this); + g_object_unref(a); /// /// Keep our GActionGroup's action's states in sync with m_state |