fix bug that did not allow at least me to clean my trash folders for a long time...
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 22 Dec 2001 23:53:31 +0000 (23:53 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 22 Dec 2001 23:53:31 +0000 (23:53 +0000)
ChangeLog.claws
configure.in
src/mainwindow.c

index f3da5ed095d525eca8059784b01284daa7accc71..e3228afb5bf125776eea30b87814c2e41f5d624b 100644 (file)
@@ -1,3 +1,14 @@
+2001-12-23 [alfons]    0.6.6claws11
+
+       * src/mainwindow.c
+               fix bug introduced by submission included in 0.6.5claws52.
+               ideally this submission should clean the trash if any trash
+               folder has a message. however, the hasTrash variable was
+               set to false whenever a trash folder was empty (discarding
+               a previously found *filled* trash folder.)
+
+               also edited the code a little bit and made it more safe.
+
 2001-12-22 [alfons]    0.6.6claws10
 
        * src/imap.c
index 1d79d8312824194a1d78f10023a5d89d14bec186..36fb11bb2845fef701fc70a3903905d3eeef296d 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws10
+EXTRA_VERSION=claws11
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index f8e3f34e253ec636bfe6750b062b8eb8283f1043..4353d35c9775cd4cc44321bf8cd6e33aac04cf58 100644 (file)
@@ -1201,21 +1201,17 @@ void main_window_get_position(MainWindow *mainwin)
 void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
 {
        GList *list;
-       gboolean hasTrash = 0;
-
-       for (list = folder_get_list(); list != NULL; list = list->next) {
-               Folder *folder;
+       guint has_trash;
+       Folder *folder;
 
-               folder = list->data;
-               if (folder->trash) {
-                       hasTrash = (folder->trash->total > 0);
-               }
+       for (has_trash = 0, list = folder_get_list(); list != NULL; list = list->next) {
+               folder = FOLDER(list->data);
+               if (folder && folder->trash && folder->trash->total > 0)
+                       has_trash++;
        }
 
-       if (!hasTrash) {
-         return;
-       }
+       if (!has_trash) return;
+       
        if (confirm) {
                if (alertpanel(_("Empty trash"),
                               _("Empty all messages in trash?"),
@@ -1227,10 +1223,8 @@ void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
        procmsg_empty_trash();
 
        for (list = folder_get_list(); list != NULL; list = list->next) {
-               Folder *folder;
-
                folder = list->data;
-               if (folder->trash && folder->trash->total != 0) {
+               if (folder && folder->trash && folder->trash->total != 0) {
                        folder_item_scan(folder->trash);
                        folderview_update_item(folder->trash, TRUE);
                }