2008-04-01 [colin] 3.3.1cvs48
[claws.git] / src / imap_gtk.c
index d80c0578f2be260647b5c059775479724737ceaa..228936c1cab27ff7e0655a8c158990f56eb276e4 100644 (file)
@@ -128,7 +128,10 @@ static void set_sensitivity(GtkItemFactory *factory, FolderItem *item)
        
        SET_SENS("/Subscriptions/Unsubscribe...",    item->stype == F_NORMAL && folder_item_parent(item) != NULL);
        SET_SENS("/Subscriptions/Subscribe...",    TRUE);
-       menu_set_active(factory, "/Subscriptions/Show only subscribed folders", item->folder->account->imap_subsonly);
+       if (item->folder && item->folder->account)
+               menu_set_active(factory, 
+                       "/Subscriptions/Show only subscribed folders", 
+                       item->folder->account->imap_subsonly);
 
 #undef SET_SENS
 }
@@ -549,6 +552,14 @@ static void subscribed_cb(FolderView *folderview, guint action,
        if (item->folder->account->imap_subsonly == GTK_CHECK_MENU_ITEM(widget)->active)
                return;
 
+       if (folderview->opened == folderview->selected ||
+           gtk_ctree_is_ancestor(ctree,
+                                 folderview->selected,
+                                 folderview->opened)) {
+               summary_clear_all(folderview->summaryview);
+               folderview->opened = NULL;
+       }
+
        item->folder->account->imap_subsonly = GTK_CHECK_MENU_ITEM(widget)->active;
        folderview_fast_rescan_tree(item->folder);
 }