aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-22 22:05:21 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-22 22:05:21 +0800
commit1f181f1e7ba371961b76ef20091dac86d99968a6 (patch)
treeb50d417dd46a9c426f31743a0a2b624ad6e320b0
parent04ffa1afb978a5adae7cc8a1241fff543dbcccf5 (diff)
downloadgsoc2013-evolution-1f181f1e7ba371961b76ef20091dac86d99968a6.tar.gz
gsoc2013-evolution-1f181f1e7ba371961b76ef20091dac86d99968a6.tar.zst
gsoc2013-evolution-1f181f1e7ba371961b76ef20091dac86d99968a6.zip
EMFolderTreeModel: Listen for "folder-info-stale" signals.
The signal indicates the folder tree for a particular store needs to be reconstructed. We do this by calling em_folder_tree_model_add_store().
-rw-r--r--mail/em-folder-tree-model.c19
-rw-r--r--mail/em-folder-tree-model.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index f3313135cf..eaa6b92342 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -108,6 +108,11 @@ store_info_free (EMFolderTreeModelStoreInfo *si)
si->store,
si->folder_renamed_handler_id);
+ if (si->folder_info_stale_handler_id > 0)
+ g_signal_handler_disconnect (
+ si->store,
+ si->folder_info_stale_handler_id);
+
if (si->folder_subscribed_handler_id > 0)
g_signal_handler_disconnect (
si->store,
@@ -1066,6 +1071,15 @@ folder_tree_model_folder_renamed_cb (CamelStore *store,
em_folder_tree_model_set_folder_info (model, &iter, si, info, TRUE);
}
+static void
+folder_tree_model_folder_info_stale_cb (CamelStore *store,
+ EMFolderTreeModel *model)
+{
+ /* Re-add the store. The EMFolderTreeModelStoreInfo will
+ * be discarded and the folder tree will be reconstructed. */
+ em_folder_tree_model_add_store (model, store);
+}
+
void
em_folder_tree_model_add_store (EMFolderTreeModel *model,
CamelStore *store)
@@ -1168,6 +1182,11 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model,
G_CALLBACK (folder_tree_model_folder_renamed_cb), model);
si->folder_renamed_handler_id = handler_id;
+ handler_id = g_signal_connect (
+ store, "folder-info-stale",
+ G_CALLBACK (folder_tree_model_folder_info_stale_cb), model);
+ si->folder_info_stale_handler_id = handler_id;
+
if (CAMEL_IS_SUBSCRIBABLE (store)) {
handler_id = g_signal_connect (
store, "folder-subscribed",
diff --git a/mail/em-folder-tree-model.h b/mail/em-folder-tree-model.h
index b3d7b5f7eb..af8acd72ff 100644
--- a/mail/em-folder-tree-model.h
+++ b/mail/em-folder-tree-model.h
@@ -84,6 +84,7 @@ struct _EMFolderTreeModelStoreInfo {
gulong folder_created_handler_id;
gulong folder_deleted_handler_id;
gulong folder_renamed_handler_id;
+ gulong folder_info_stale_handler_id;
gulong folder_subscribed_handler_id;
gulong folder_unsubscribed_handler_id;
};