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 864dc15..ef0c7ee 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 16cb70c..a3b2aab 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 73d3c49..68d132e 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 4be46d2..17113fc 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 58d9991..bb701be 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));