fix 'Empty Trash' pop-up window' bug
authorPaul Mangan <paul@claws-mail.org>
Wed, 5 Dec 2001 13:41:47 +0000 (13:41 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 5 Dec 2001 13:41:47 +0000 (13:41 +0000)
src/mainwindow.c

index d82d456..e49cc08 100644 (file)
@@ -1143,7 +1143,21 @@ 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;
+
+               folder = list->data;
+               if (folder->trash) {
+                       hasTrash = (folder->trash->total > 0);
+               }
+       }
+
+       if (!hasTrash) {
+         return;
+       }
        if (confirm) {
                if (alertpanel(_("Empty trash"),
                               _("Empty all messages in trash?"),