aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-09-29 17:39:26 +0800
committerMilan Crha <mcrha@redhat.com>2010-09-29 17:39:26 +0800
commit6ec1118c92dcdf1f8377efde3ea575b5bc94412a (patch)
tree8cf3c669abb95acd6cf4aab979c0a1181760bd54
parentc7b134377499a7bdc4a109cd1ec374ab5ac57a7b (diff)
downloadgsoc2013-evolution-6ec1118c92dcdf1f8377efde3ea575b5bc94412a.tar
gsoc2013-evolution-6ec1118c92dcdf1f8377efde3ea575b5bc94412a.tar.gz
gsoc2013-evolution-6ec1118c92dcdf1f8377efde3ea575b5bc94412a.tar.bz2
gsoc2013-evolution-6ec1118c92dcdf1f8377efde3ea575b5bc94412a.tar.lz
gsoc2013-evolution-6ec1118c92dcdf1f8377efde3ea575b5bc94412a.tar.xz
gsoc2013-evolution-6ec1118c92dcdf1f8377efde3ea575b5bc94412a.tar.zst
gsoc2013-evolution-6ec1118c92dcdf1f8377efde3ea575b5bc94412a.zip
Bug #629462 - Tasks 'Due' filters don't work properly
-rw-r--r--calendar/gui/e-cal-model.c13
-rw-r--r--calendar/gui/e-calendar-view.c4
-rw-r--r--modules/calendar/e-cal-shell-view.c13
-rw-r--r--modules/calendar/e-task-shell-view.c19
4 files changed, 34 insertions, 15 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 9cb8352c33..525e4fff33 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -227,6 +227,16 @@ cal_model_get_property (GObject *object,
}
static void
+cal_model_constructed (GObject *object)
+{
+ e_extensible_load_extensions (E_EXTENSIBLE (object));
+
+ /* Chain up to parent's constructed() method. */
+ if (G_OBJECT_CLASS (parent_class)->constructed)
+ G_OBJECT_CLASS (parent_class)->constructed (object);
+}
+
+static void
cal_model_dispose (GObject *object)
{
ECalModelPrivate *priv;
@@ -302,6 +312,7 @@ e_cal_model_class_init (ECalModelClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->set_property = cal_model_set_property;
object_class->get_property = cal_model_get_property;
+ object_class->constructed = cal_model_constructed;
object_class->dispose = cal_model_dispose;
object_class->finalize = cal_model_finalize;
@@ -465,8 +476,6 @@ e_cal_model_init (ECalModel *model)
model->priv->notify_modified = NULL;
model->priv->notify_removed = NULL;
model->priv->notify_lock = g_mutex_new ();
-
- e_extensible_load_extensions (E_EXTENSIBLE (model));
}
/* ETableModel methods */
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 5b047999cf..94f4579788 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -353,6 +353,10 @@ calendar_view_constructed (GObject *object)
* the GType accurately. See GInstanceInitFunc documentation
* for details of the problem. */
e_extensible_load_extensions (E_EXTENSIBLE (object));
+
+ /* Chain up to parent's constructed() method. */
+ if (G_OBJECT_CLASS (e_calendar_view_parent_class)->constructed)
+ G_OBJECT_CLASS (e_calendar_view_parent_class)->constructed (object);
}
static void
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 19c804204c..f9985f5f6a 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -66,6 +66,7 @@ cal_shell_view_execute_search (EShellView *shell_view)
GtkRadioAction *action;
time_t start_range;
time_t end_range;
+ time_t now_time;
gboolean range_search;
gchar *start, *end;
gchar *query;
@@ -81,6 +82,9 @@ cal_shell_view_execute_search (EShellView *shell_view)
searchbar = e_cal_shell_content_get_searchbar (cal_shell_content);
+ calendar = e_cal_shell_content_get_calendar (cal_shell_content);
+ now_time = time_day_begin (icaltime_as_timet (icaltime_current_time_with_zone (e_cal_model_get_timezone (gnome_calendar_get_model (calendar)))));
+
action = GTK_RADIO_ACTION (ACTION (CALENDAR_SEARCH_ANY_FIELD_CONTAINS));
value = gtk_radio_action_get_current_value (action);
@@ -145,8 +149,8 @@ cal_shell_view_execute_search (EShellView *shell_view)
case CALENDAR_FILTER_ACTIVE_APPOINTMENTS:
/* Show a year's worth of appointments. */
- start_range = time (NULL);
- end_range = time_add_day (start_range, 365);
+ start_range = now_time;
+ end_range = time_day_end (time_add_day (start_range, 365));
start = isodate_from_time_t (start_range);
end = isodate_from_time_t (end_range);
@@ -161,8 +165,8 @@ cal_shell_view_execute_search (EShellView *shell_view)
break;
case CALENDAR_FILTER_NEXT_7_DAYS_APPOINTMENTS:
- start_range = time (NULL);
- end_range = time_add_day (start_range, 7);
+ start_range = now_time;
+ end_range = time_day_end (time_add_day (start_range, 7));
start = isodate_from_time_t (start_range);
end = isodate_from_time_t (end_range);
@@ -207,7 +211,6 @@ cal_shell_view_execute_search (EShellView *shell_view)
}
/* Submit the query. */
- calendar = e_cal_shell_content_get_calendar (cal_shell_content);
gnome_calendar_set_search_query (
calendar, query, range_search, start_range, end_range);
g_free (query);
diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c
index b2146f5e59..3bf0eb67f1 100644
--- a/modules/calendar/e-task-shell-view.c
+++ b/modules/calendar/e-task-shell-view.c
@@ -106,6 +106,7 @@ task_shell_view_execute_search (EShellView *shell_view)
ECalModel *model;
time_t start_range;
time_t end_range;
+ time_t now_time;
gchar *start, *end;
gchar *query;
gchar *temp;
@@ -117,6 +118,11 @@ task_shell_view_execute_search (EShellView *shell_view)
task_shell_content = E_TASK_SHELL_CONTENT (shell_content);
searchbar = e_task_shell_content_get_searchbar (task_shell_content);
+ task_shell_content = E_TASK_SHELL_CONTENT (shell_content);
+ task_table = e_task_shell_content_get_task_table (task_shell_content);
+ model = e_task_table_get_model (task_table);
+ now_time = time_day_begin (icaltime_as_timet (icaltime_current_time_with_zone (e_cal_model_get_timezone (model))));
+
action = GTK_RADIO_ACTION (ACTION (TASK_SEARCH_ANY_FIELD_CONTAINS));
value = gtk_radio_action_get_current_value (action);
@@ -177,8 +183,8 @@ task_shell_view_execute_search (EShellView *shell_view)
break;
case TASK_FILTER_NEXT_7_DAYS_TASKS:
- start_range = time (NULL);
- end_range = time_add_day (start_range, 7);
+ start_range = now_time;
+ end_range = time_day_end (time_add_day (start_range, 7));
start = isodate_from_time_t (start_range);
end = isodate_from_time_t (end_range);
@@ -191,8 +197,8 @@ task_shell_view_execute_search (EShellView *shell_view)
break;
case TASK_FILTER_ACTIVE_TASKS:
- start_range = time (NULL);
- end_range = time_add_day (start_range, 365);
+ start_range = now_time;
+ end_range = time_day_end (time_add_day (start_range, 365));
start = isodate_from_time_t (start_range);
end = isodate_from_time_t (end_range);
@@ -207,7 +213,7 @@ task_shell_view_execute_search (EShellView *shell_view)
case TASK_FILTER_OVERDUE_TASKS:
start_range = 0;
- end_range = time (NULL);
+ end_range = time_day_end (now_time);
start = isodate_from_time_t (start_range);
end = isodate_from_time_t (end_range);
@@ -264,9 +270,6 @@ task_shell_view_execute_search (EShellView *shell_view)
}
/* Submit the query. */
- task_shell_content = E_TASK_SHELL_CONTENT (shell_content);
- task_table = e_task_shell_content_get_task_table (task_shell_content);
- model = e_task_table_get_model (task_table);
e_cal_model_set_search_query (model, query);
g_free (query);