2007-02-23 [colin] 2.7.2cvs69
authorColin Leroy <colin@colino.net>
Fri, 23 Feb 2007 18:07:44 +0000 (18:07 +0000)
committerColin Leroy <colin@colino.net>
Fri, 23 Feb 2007 18:07:44 +0000 (18:07 +0000)
* src/folderview.c
* src/imap_gtk.c
Fix crash when unsubscribing the currently
selected/opened folder

ChangeLog
PATCHSETS
configure.ac
src/folderview.c
src/imap_gtk.c

index 864dc15357e3cfa522c4fbe6177d8216f2f0446a..ef0c7eedd9411d17ac8efef9b96f4ab66e1ba397 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-23 [colin]     2.7.2cvs69
+
+       * src/folderview.c
+       * src/imap_gtk.c
+               Fix crash when unsubscribing the currently
+               selected/opened folder
+
 2007-02-23 [colin]     2.7.2cvs68
 
        * src/compose.c
index 16cb70ca0d20c126d7d12800aa0aa890d26783fd..a3b2aabfca159343a42507fe8791be8013eafac6 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.81 -r 1.60.2.82 src/addressbook.c;  cvs diff -u -r 1.28.2.23 -r 1.28.2.24 src/addrindex.c;  ) > 2.7.2cvs66.patchset
 ( cvs diff -u -r 1.27.2.29 -r 1.27.2.30 src/addr_compl.c;  ) > 2.7.2cvs67.patchset
 ( cvs diff -u -r 1.382.2.360 -r 1.382.2.361 src/compose.c;  ) > 2.7.2cvs68.patchset
+( cvs diff -u -r 1.207.2.149 -r 1.207.2.150 src/folderview.c;  cvs diff -u -r 1.1.2.43 -r 1.1.2.44 src/imap_gtk.c;  ) > 2.7.2cvs69.patchset
index 73d3c4997452fa549fb080a95c9e1bcb9a4a5836..68d132e384b8b3b534219478561233fa36394338 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=68
+EXTRA_VERSION=69
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4be46d252921dfddf350ba795a8ccf7729039c49..17113fcce73ea9d2ab9788665231f63f1e1970d9 100644 (file)
@@ -2677,8 +2677,13 @@ static gboolean folderview_update_folder(gpointer source, gpointer userdata)
                GtkCTreeNode *node;
 
                node = gtk_ctree_find_by_row_data(GTK_CTREE(ctree), NULL, hookdata->item);
-               if (node != NULL)
+               if (node != NULL) {
                        gtk_ctree_remove_node(GTK_CTREE(ctree), node);
+                       if (folderview->selected == node)
+                               folderview->selected = NULL;
+                       if (folderview->opened == node)
+                               folderview->opened = NULL;
+               }
        } else if (hookdata->update_flags & (FOLDER_TREE_CHANGED | FOLDER_ADD_FOLDER | FOLDER_REMOVE_FOLDER))
                folderview_set(folderview);
 
index 58d9991e201e77d5f89d5044373a9b0d1f6852fb..bb701be3d0060dd21c5f1ba1c74dfc6d27820860 100644 (file)
@@ -486,6 +486,17 @@ static void subscribe_cb(FolderView *folderview, guint action,
        g_free(message);
        if (avalue != G_ALERTALTERNATE) return;
        
+       
+       if (!action) {
+               if (folderview->opened == folderview->selected ||
+                   gtk_ctree_is_ancestor(ctree,
+                                         folderview->selected,
+                                         folderview->opened)) {
+                       summary_clear_all(folderview->summaryview);
+                       folderview->opened = NULL;
+               }
+       }
+
        if (recurse) {
                g_node_traverse(item->node, G_PRE_ORDER,
                        G_TRAVERSE_ALL, -1, imap_gtk_subscribe_func, GINT_TO_POINTER(action));