aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-11-24 23:35:59 +0800
committerMilan Crha <mcrha@redhat.com>2011-11-24 23:36:42 +0800
commit4169ce41cc34d992ebd63b1bcc8f604e69aea89a (patch)
tree1aba982292305af36dc6873f487d67443c34f277 /modules
parent2eb60688a1955a95c3a040bd98f76bb67e3ff3ed (diff)
downloadgsoc2013-evolution-4169ce41cc34d992ebd63b1bcc8f604e69aea89a.tar
gsoc2013-evolution-4169ce41cc34d992ebd63b1bcc8f604e69aea89a.tar.gz
gsoc2013-evolution-4169ce41cc34d992ebd63b1bcc8f604e69aea89a.tar.bz2
gsoc2013-evolution-4169ce41cc34d992ebd63b1bcc8f604e69aea89a.tar.lz
gsoc2013-evolution-4169ce41cc34d992ebd63b1bcc8f604e69aea89a.tar.xz
gsoc2013-evolution-4169ce41cc34d992ebd63b1bcc8f604e69aea89a.tar.zst
gsoc2013-evolution-4169ce41cc34d992ebd63b1bcc8f604e69aea89a.zip
Bug #664634 - Deadlock when processing completed tasks filter
Diffstat (limited to 'modules')
-rw-r--r--modules/calendar/e-task-shell-view-private.c30
-rw-r--r--modules/calendar/e-task-shell-view-private.h1
2 files changed, 26 insertions, 5 deletions
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c
index 3467c12190..916494757d 100644
--- a/modules/calendar/e-task-shell-view-private.c
+++ b/modules/calendar/e-task-shell-view-private.c
@@ -46,14 +46,17 @@ task_shell_view_model_row_appended_cb (ETaskShellView *task_shell_view,
e_task_shell_sidebar_add_source (task_shell_sidebar, source);
}
-static void
-task_shell_view_process_completed_tasks (ETaskShellView *task_shell_view)
+static gboolean
+task_shell_view_process_completed_tasks (gpointer user_data)
{
+ ETaskShellView *task_shell_view = user_data;
ETaskShellContent *task_shell_content;
ETaskShellSidebar *task_shell_sidebar;
ETaskTable *task_table;
GList *clients;
+ task_shell_view->priv->update_completed_timeout = 0;
+
task_shell_content = task_shell_view->priv->task_shell_content;
task_table = e_task_shell_content_get_task_table (task_shell_content);
@@ -67,6 +70,18 @@ task_shell_view_process_completed_tasks (ETaskShellView *task_shell_view)
e_shell_view_execute_search (E_SHELL_VIEW (task_shell_view));
g_list_free (clients);
+
+ return FALSE;
+}
+
+static void
+task_shell_view_schedule_process_completed_tasks (ETaskShellView *task_shell_view)
+{
+ if (task_shell_view->priv->update_completed_timeout)
+ g_source_remove (task_shell_view->priv->update_completed_timeout);
+
+ task_shell_view->priv->update_completed_timeout =
+ g_timeout_add_seconds (1, task_shell_view_process_completed_tasks, task_shell_view);
}
static void
@@ -345,15 +360,15 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view)
/* Hide Completed Tasks (enable/units/value) */
g_signal_connect_object (
shell_settings, "notify::cal-hide-completed-tasks",
- G_CALLBACK (task_shell_view_process_completed_tasks),
+ G_CALLBACK (task_shell_view_schedule_process_completed_tasks),
task_shell_view, G_CONNECT_SWAPPED);
g_signal_connect_object (
shell_settings, "notify::cal-hide-completed-tasks-units",
- G_CALLBACK (task_shell_view_process_completed_tasks),
+ G_CALLBACK (task_shell_view_schedule_process_completed_tasks),
task_shell_view, G_CONNECT_SWAPPED);
g_signal_connect_object (
shell_settings, "notify::cal-hide-completed-tasks-value",
- G_CALLBACK (task_shell_view_process_completed_tasks),
+ G_CALLBACK (task_shell_view_schedule_process_completed_tasks),
task_shell_view, G_CONNECT_SWAPPED);
e_task_shell_view_actions_init (task_shell_view);
@@ -392,6 +407,11 @@ e_task_shell_view_private_dispose (ETaskShellView *task_shell_view)
g_source_remove (priv->update_timeout);
priv->update_timeout = 0;
}
+
+ if (priv->update_completed_timeout > 0) {
+ g_source_remove (priv->update_completed_timeout);
+ priv->update_completed_timeout = 0;
+ }
}
void
diff --git a/modules/calendar/e-task-shell-view-private.h b/modules/calendar/e-task-shell-view-private.h
index ec2173f201..66e664645e 100644
--- a/modules/calendar/e-task-shell-view-private.h
+++ b/modules/calendar/e-task-shell-view-private.h
@@ -100,6 +100,7 @@ struct _ETaskShellViewPrivate {
EActivity *activity;
guint update_timeout;
+ guint update_completed_timeout;
guint confirm_purge : 1;
};