0.8.11claws161
authorChristoph Hohmann <reboot@gmx.ch>
Sat, 17 May 2003 13:15:38 +0000 (13:15 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sat, 17 May 2003 13:15:38 +0000 (13:15 +0000)
* src/folder.c
* src/folderview.c
* src/imap.c
        don't use imap_scan_folder anymore. Instead call folder_item_scan
        for every folder after rebuilding the folder tree.

(closes Bug 19 imap_scan_folder() computes incorrectly number of new
 messages)

ChangeLog.claws
configure.ac
src/folder.c
src/folderview.c
src/imap.c

index e367284..ea8d29a 100644 (file)
@@ -1,3 +1,14 @@
+2003-05-17 [christoph] 0.8.11claws161
+
+       * src/folder.c
+       * src/folderview.c
+       * src/imap.c
+               don't use imap_scan_folder anymore. Instead call folder_item_scan
+               for every folder after rebuilding the folder tree.
+
+       (closes Bug 19 imap_scan_folder() computes incorrectly number of new
+        messages)
+
 2003-05-17 [christoph] 0.8.11claws160
 
        * src/imap.c
index a297fae..7e6439c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws160
+EXTRA_VERSION=claws161
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 5ac2290..f143292 100644 (file)
@@ -411,6 +411,7 @@ gboolean folder_scan_tree_func(GNode *node, gpointer data)
        FolderItem *item = (FolderItem *)node->data;
        
        folder_item_restore_persist_prefs(item, pptable);
+       folder_item_scan(item);
 
        return FALSE;
 }
@@ -423,8 +424,12 @@ void folder_scan_tree(Folder *folder)
                return;
        
        pptable = folder_persist_prefs_new(folder);
-       folder_tree_destroy(folder);
 
+       /*
+        * should be changed and tree update should be done without 
+        * destroying the tree first
+        */
+       folder_tree_destroy(folder);
        folder->klass->scan_tree(folder);
 
        g_node_traverse(folder->node, G_POST_ORDER, G_TRAVERSE_ALL, -1, folder_scan_tree_func, pptable);
index 5ad85b2..316a773 100644 (file)
@@ -830,45 +830,9 @@ void folderview_rescan_tree(Folder *folder)
 
        folderview_set_all();
 
-       folderview_check_new(folder);
-       
-       gtk_widget_destroy(window);
-       inc_unlock();
-}
-
-#if 0
-void folderview_rescan_all(void)
-{
-       GList *list;
-       GtkWidget *window;
-
-       inc_lock();
-       window = label_window_create(_("Rescanning all folder trees..."));
-
-       list = folder_get_list();
-       for (; list != NULL; list = list->next) {
-               Folder *folder = list->data;
-
-               if (!folder->scan_tree) continue;
-               folder_set_ui_func(folder, folderview_scan_tree_func, NULL);
-               folder_scan_tree(folder);
-               folder_set_ui_func(folder, NULL, NULL);
-       }
-
-       folder_write_list();
-       folderview_set_all();
-
-       list = folder_get_list();
-       for (; list != NULL; list = list->next) {
-               Folder *folder = list->data;
-
-               folderview_check_new(folder);
-       }
-
        gtk_widget_destroy(window);
        inc_unlock();
 }
-#endif
 
 /** folderview_check_new()
  *  Scan and update the folder and return the 
index 89ed676..9624923 100644 (file)
@@ -171,7 +171,6 @@ static gint imap_remove_all_msg(Folder * folder, FolderItem * item);
 static gboolean imap_is_msg_changed(Folder * folder,
                                    FolderItem * item, MsgInfo * msginfo);
 
-static gint imap_scan_folder(Folder * folder, FolderItem * item);
 static void imap_scan_tree(Folder * folder);
 
 static gint imap_create_tree(Folder * folder);
@@ -968,32 +967,6 @@ gboolean imap_is_msg_changed(Folder *folder, FolderItem *item, MsgInfo *msginfo)
        return FALSE;
 }
 
-gint imap_scan_folder(Folder *folder, FolderItem *item)
-{
-       IMAPSession *session;
-       gint messages, recent, unseen;
-       guint32 uid_next, uid_validity;
-       gint ok;
-
-       g_return_val_if_fail(folder != NULL, -1);
-       g_return_val_if_fail(item != NULL, -1);
-
-       session = imap_session_get(folder);
-       if (!session) return -1;
-
-       ok = imap_status(session, IMAP_FOLDER(folder), item->path,
-                        &messages, &recent, &uid_next, &uid_validity, &unseen);
-       if (ok != IMAP_SUCCESS) return -1;
-
-       item->new_msgs = unseen > 0 ? recent : 0;
-       item->unread_msgs = unseen;
-       item->total_msgs = messages;
-       item->last_num = (messages > 0 && uid_next > 0) ? uid_next - 1 : 0;
-       /* item->mtime = uid_validity; */
-
-       return 0;
-}
-
 void imap_scan_tree(Folder *folder)
 {
        FolderItem *item;
@@ -1105,8 +1078,6 @@ static gint imap_scan_tree_recursive(IMAPSession *session, FolderItem *item)
                        }
                }
                folder_item_append(item, new_item);
-               if (new_item->no_select == FALSE)
-                       imap_scan_folder(folder, new_item);
                if (new_item->no_sub == FALSE)
                        imap_scan_tree_recursive(session, new_item);
        }
@@ -3428,7 +3399,7 @@ gboolean imap_check_msgnum_validity(Folder *folder, FolderItem *_item)
        if(item->item.mtime == uid_validity)
                return TRUE;
 
-       debug_print("Freeing imap uid cache");
+       debug_print("Freeing imap uid cache\n");
        item->lastuid = 0;
        g_slist_free(item->uid_list);
        item->uid_list = NULL;