aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-08-18 00:49:03 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-08-18 00:49:03 +0800
commit18f8381651b229b6170bb425e63111954e35603f (patch)
tree02d2209869fa16a34a320f185dba0b9145fad720
parent084974a617b9edf5e53a483e9de15687a8fe6a33 (diff)
downloadgsoc2013-evolution-18f8381651b229b6170bb425e63111954e35603f.tar
gsoc2013-evolution-18f8381651b229b6170bb425e63111954e35603f.tar.gz
gsoc2013-evolution-18f8381651b229b6170bb425e63111954e35603f.tar.bz2
gsoc2013-evolution-18f8381651b229b6170bb425e63111954e35603f.tar.lz
gsoc2013-evolution-18f8381651b229b6170bb425e63111954e35603f.tar.xz
gsoc2013-evolution-18f8381651b229b6170bb425e63111954e35603f.tar.zst
gsoc2013-evolution-18f8381651b229b6170bb425e63111954e35603f.zip
folder_tree_model_folder_renamed_cb: Avoid duplicate rows.
Testing IMAP NOTIFY and folder renames, I observed a "folder-created" signal emission before the "folder-renamed" signal emission. So the renamed folder already exists in the tree model when we receive the "folder-renamed" signal. Make sure we handle that sanely.
-rw-r--r--mail/em-folder-tree-model.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 66f292695b..a7039f28d1 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -1049,6 +1049,11 @@ folder_tree_model_folder_renamed_cb (CamelStore *store,
em_folder_tree_model_remove_folders (model, si, &iter);
+ /* Make sure we don't already have the new folder name. */
+ reference = g_hash_table_lookup (si->full_hash, info->full_name);
+ if (gtk_tree_row_reference_valid (reference))
+ return;
+
parent = g_strdup (info->full_name);
p = strrchr (parent, '/');
if (p)