aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-11-20 01:40:06 +0800
committerMilan Crha <mcrha@redhat.com>2013-11-20 01:40:06 +0800
commit705a5a00001270a5283666bc34a13bfc455438de (patch)
tree5298aab71b0243d351c15a821ad77c987706732c /modules
parent7727f426a2e7d4ef4e7b90da810052ce36aae789 (diff)
downloadgsoc2013-evolution-705a5a00001270a5283666bc34a13bfc455438de.tar
gsoc2013-evolution-705a5a00001270a5283666bc34a13bfc455438de.tar.gz
gsoc2013-evolution-705a5a00001270a5283666bc34a13bfc455438de.tar.bz2
gsoc2013-evolution-705a5a00001270a5283666bc34a13bfc455438de.tar.lz
gsoc2013-evolution-705a5a00001270a5283666bc34a13bfc455438de.tar.xz
gsoc2013-evolution-705a5a00001270a5283666bc34a13bfc455438de.tar.zst
gsoc2013-evolution-705a5a00001270a5283666bc34a13bfc455438de.zip
Bug #712342 - Calendar search doesn't finish
Diffstat (limited to 'modules')
-rw-r--r--modules/calendar/e-cal-shell-view-private.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 98c6da468f..c03b3e3b00 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -1300,13 +1300,8 @@ cal_searching_instances_done_cb (gpointer user_data)
if (!g_cancellable_is_cancelled (gid->cancellable)) {
gid->cal_shell_view->priv->search_pending_count--;
- if (!gid->cal_shell_view->priv->search_pending_count) {
- gid->cal_shell_view->priv->search_hit_cache =
- g_slist_sort (
- gid->cal_shell_view->priv->search_hit_cache,
- cal_time_t_ptr_compare);
+ if (!gid->cal_shell_view->priv->search_pending_count)
cal_iterate_searching (gid->cal_shell_view);
- }
}
g_object_unref (gid->cancellable);
@@ -1381,16 +1376,12 @@ cal_search_get_object_list_cb (GObject *source,
g_warn_if_fail (icalcomps == NULL);
g_error_free (error);
- } else if (error != NULL) {
+ } else if (error != NULL || !icalcomps) {
g_warn_if_fail (icalcomps == NULL);
- g_error_free (error);
+ g_clear_error (&error);
cal_shell_view->priv->search_pending_count--;
if (!cal_shell_view->priv->search_pending_count) {
- cal_shell_view->priv->search_hit_cache =
- g_slist_sort (
- cal_shell_view->priv->search_hit_cache,
- cal_time_t_ptr_compare);
cal_iterate_searching (cal_shell_view);
}
@@ -1456,10 +1447,15 @@ cal_searching_check_candidates (ECalShellView *cal_shell_view)
view_type == GNOME_CAL_MONTH_VIEW))
value = time_add_day (value, 1);
+ cal_shell_view->priv->search_hit_cache =
+ g_slist_sort (
+ cal_shell_view->priv->search_hit_cache,
+ cal_time_t_ptr_compare);
+
for (iter = cal_shell_view->priv->search_hit_cache; iter; iter = iter->next) {
time_t cache = *((time_t *) iter->data);
- /* list is sorted, once the search iteration is complete */
+ /* list is sorted before traversing it */
if (cache > value) {
if (cal_shell_view->priv->search_direction > 0)
candidate = cache;