2006-06-15 [colin] 2.3.0cvs14
authorColin Leroy <colin@colino.net>
Thu, 15 Jun 2006 07:02:07 +0000 (07:02 +0000)
committerColin Leroy <colin@colino.net>
Thu, 15 Jun 2006 07:02:07 +0000 (07:02 +0000)
* src/folder.c
Better fix (avoid losing the folder if scan_tree
fails)

ChangeLog
PATCHSETS
configure.ac
src/folder.c

index dfe7186..0c673e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-15 [colin]     2.3.0cvs14
+
+       * src/folder.c
+               Better fix (avoid losing the folder if scan_tree 
+               fails)
+
 2006-06-15 [cleroy]    2.3.0cvs13
 
        * src/folder.c
index a0608fb..af59391 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.654.2.1631 -r 1.654.2.1632 configure.ac;  ) > 2.3.0cvs11.patchset
 ( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 manual/sylpheed-claws-manual.xml;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/dtd/manual.xsl;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/fr/sylpheed-claws-manual.xml;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/pl/sylpheed-claws-manual.xml;  ) > 2.3.0cvs12.patchset
 ( cvs diff -u -r 1.213.2.99 -r 1.213.2.100 src/folder.c;  ) > 2.3.0cvs13.patchset
+( cvs diff -u -r 1.213.2.100 -r 1.213.2.101 src/folder.c;  ) > 2.3.0cvs14.patchset
index 2d392fd..ab49d57 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=13
+EXTRA_VERSION=14
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index acd07b3..8114b51 100644 (file)
@@ -205,7 +205,6 @@ static void reset_parent_type(FolderItem *item, gpointer data) {
 
 void folder_item_change_type(FolderItem *item, SpecialFolderItemType newtype)
 {
-       FolderItem *parent;
        Folder *folder = NULL;
        FolderUpdateData hookdata;
 
@@ -832,17 +831,22 @@ void folder_scan_tree(Folder *folder, gboolean rebuild)
 {
        GHashTable *pptable;
        FolderUpdateData hookdata;
-       
+       Folder *old_folder = folder;
+
        if (!folder->klass->scan_tree)
                return;
        
        pptable = folder_persist_prefs_new(folder);
 
        if (rebuild)
-               folder_tree_destroy(folder);
+               folder_remove(folder);
 
-       if (folder->klass->scan_tree(folder) < 0)
+       if (folder->klass->scan_tree(folder) < 0) {
+               if (rebuild)
+                       folder_add(old_folder);
                return;
+       } else if (rebuild)
+               folder_add(folder);
 
        hookdata.folder = folder;
        hookdata.update_flags = FOLDER_TREE_CHANGED;