[geary/wip/delete-folder-714357] Fix crash when removing labels with sub-labels



commit 06fb1bb303854675c5afe3479d80a895d81a774e
Author: Charles Lindsay <chaz yorba org>
Date:   Fri Feb 14 12:46:16 2014 -0800

    Fix crash when removing labels with sub-labels

 .../folder-list/folder-list-account-branch.vala    |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/client/folder-list/folder-list-account-branch.vala 
b/src/client/folder-list/folder-list-account-branch.vala
index 3194f21..3f26dfa 100644
--- a/src/client/folder-list/folder-list-account-branch.vala
+++ b/src/client/folder-list/folder-list-account-branch.vala
@@ -24,10 +24,13 @@ public class FolderList.AccountBranch : Sidebar.Branch {
         account.information.notify["nickname"].connect(on_nicknamed_changed);
         
         graft(get_root(), user_folder_group);
+        
+        entry_removed.connect(on_entry_removed);
     }
     
     ~AccountBranch() {
         account.information.notify["nickname"].disconnect(on_nicknamed_changed);
+        entry_removed.disconnect(on_entry_removed);
     }
     
     private void on_nicknamed_changed() {
@@ -124,4 +127,10 @@ public class FolderList.AccountBranch : Sidebar.Branch {
         prune(entry);
         folder_entries.unset(folder.path);
     }
+    
+    private void on_entry_removed(Sidebar.Entry entry) {
+        FolderEntry? folder_entry = entry as FolderEntry;
+        if (folder_entry != null && folder_entries.has_key(folder_entry.folder.path))
+            folder_entries.unset(folder_entry.folder.path);
+    }
 }


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