2008-03-01 [colin] 3.3.1cvs6
authorColin Leroy <colin@colino.net>
Sat, 1 Mar 2008 13:48:34 +0000 (13:48 +0000)
committerColin Leroy <colin@colino.net>
Sat, 1 Mar 2008 13:48:34 +0000 (13:48 +0000)
* src/folder.c
* src/imap_gtk.c
Get rid of stale folders with no account

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

index 032e3cf..b5dcfac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-01 [colin]     3.3.1cvs6
+
+       * src/folder.c
+       * src/imap_gtk.c
+               Get rid of stale folders with no account
+
 2008-02-28 [colin]     3.3.1cvs5
 
        * src/compose.c
index a01061c..17df435 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.29.2.10 -r 1.29.2.11 INSTALL;  cvs diff -u -r 1.8.2.47 -r 1.8.2.48 README;  ) > 3.3.1cvs3.patchset
 ( cvs diff -u -r 1.179.2.211 -r 1.179.2.212 src/imap.c;  ) > 3.3.1cvs4.patchset
 ( cvs diff -u -r 1.382.2.438 -r 1.382.2.439 src/compose.c;  cvs diff -u -r 1.179.2.212 -r 1.179.2.213 src/imap.c;  cvs diff -u -r 1.94.2.171 -r 1.94.2.172 src/messageview.c;  cvs diff -u -r 1.1.4.97 -r 1.1.4.98 src/etpan/imap-thread.c;  ) > 3.3.1cvs5.patchset
+( cvs diff -u -r 1.213.2.177 -r 1.213.2.178 src/folder.c;  cvs diff -u -r 1.1.2.54 -r 1.1.2.55 src/imap_gtk.c;  ) > 3.3.1cvs6.patchset
index de9cc37..c42b348 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=5
+EXTRA_VERSION=6
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index dc3cf2f..dc39fce 100644 (file)
@@ -136,9 +136,10 @@ void folder_register_class(FolderClass *klass)
                                Folder *folder;
 
                                folder = folder_get_from_xml(node);
-                               folder_add(folder);
-                               folder_unloaded_list = g_slist_remove(folder_unloaded_list, node);
-
+                               if (folder) {
+                                       folder_add(folder);
+                                       folder_unloaded_list = g_slist_remove(folder_unloaded_list, node);
+                               }
                                cur = NULL;
                                continue;
                        }
@@ -727,6 +728,12 @@ void folder_add(Folder *folder)
 
        g_return_if_fail(folder != NULL);
 
+       if ((FOLDER_TYPE(folder) == F_IMAP ||
+            FOLDER_TYPE(folder) == F_NEWS) &&
+           folder->account == NULL) {
+               return;
+       }
+
        for (i = 0, cur = folder_list; cur != NULL; cur = cur->next, i++) {
                cur_folder = FOLDER(cur->data);
                if (cur_folder->sort < folder->sort)
index d80c057..6bcc912 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
 }