[evolution] Bug #699980 - Calendar delete does not remove events from view



commit 16bf152272b67115380340c617e397d8e869334c
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 14 12:00:17 2013 +0200

    Bug #699980 - Calendar delete does not remove events from view

 e-util/e-source-selector.c              |    5 +++++
 modules/calendar/e-cal-shell-sidebar.c  |    4 ++++
 modules/calendar/e-memo-shell-sidebar.c |    4 ++++
 modules/calendar/e-task-shell-sidebar.c |    4 ++++
 4 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-source-selector.c b/e-util/e-source-selector.c
index f9d001a..07a3754 100644
--- a/e-util/e-source-selector.c
+++ b/e-util/e-source-selector.c
@@ -1638,6 +1638,11 @@ e_source_selector_unselect_source (ESourceSelector *selector,
        /* Make sure the ESource is in our tree model. */
        source_index = selector->priv->source_index;
        reference = g_hash_table_lookup (source_index, source);
+
+       /* can be NULL when the source was just removed */
+       if (!reference)
+               return;
+
        g_return_if_fail (gtk_tree_row_reference_valid (reference));
 
        class = E_SOURCE_SELECTOR_GET_CLASS (selector);
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index 632a3eb..053ee96 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -424,6 +424,10 @@ cal_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
        model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector));
 
        g_signal_connect_swapped (
+               registry, "source-removed",
+               G_CALLBACK (e_cal_shell_sidebar_remove_source), shell_sidebar);
+
+       g_signal_connect_swapped (
                model, "row-changed",
                G_CALLBACK (cal_shell_sidebar_row_changed_cb),
                shell_sidebar);
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index 85a105c..47abef7 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -422,6 +422,10 @@ memo_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
        model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector));
 
        g_signal_connect_swapped (
+               registry, "source-removed",
+               G_CALLBACK (e_memo_shell_sidebar_remove_source), shell_sidebar);
+
+       g_signal_connect_swapped (
                model, "row-changed",
                G_CALLBACK (memo_shell_sidebar_row_changed_cb),
                shell_sidebar);
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index 8009436..288e92d 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -422,6 +422,10 @@ task_shell_sidebar_restore_state_cb (EShellWindow *shell_window,
        model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector));
 
        g_signal_connect_swapped (
+               registry, "source-removed",
+               G_CALLBACK (e_task_shell_sidebar_remove_source), shell_sidebar);
+
+       g_signal_connect_swapped (
                model, "row-changed",
                G_CALLBACK (task_shell_sidebar_row_changed_cb),
                shell_sidebar);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]