[gnome-calendar] search-view: don't subscribe to invalid dates
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] search-view: don't subscribe to invalid dates
- Date: Fri, 8 Jul 2016 23:55:15 +0000 (UTC)
commit 33d9901c493a012555c54a338b7501e7bc8b6368
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Jul 8 20:52:41 2016 -0300
search-view: don't subscribe to invalid dates
src/gcal-search-view.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index 1b5aae2..96c8855 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -743,8 +743,22 @@ gcal_search_view_search (GcalSearchView *view,
if (!view->subscribed)
{
- gcal_manager_set_search_subscriber (view->manager, E_CAL_DATA_MODEL_SUBSCRIBER (view), 0, 0);
+ GDateTime *now, *start, *end;
+
+ now = g_date_time_new_now_local ();
+ start = g_date_time_add_years (now, -5);
+ end = g_date_time_add_years (now, 5);
+
+ gcal_manager_set_search_subscriber (view->manager, E_CAL_DATA_MODEL_SUBSCRIBER (view),
+ g_date_time_to_unix (start),
+ g_date_time_to_unix (end));
+
+ /* Mark the view as subscribed */
view->subscribed = TRUE;
+
+ g_clear_pointer (&start, g_date_time_unref);
+ g_clear_pointer (&end, g_date_time_unref);
+ g_clear_pointer (&now, g_date_time_unref);
}
/* update internal current time_t */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]