* src/folder.c
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 30 Jun 2002 16:35:20 +0000 (16:35 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 30 Jun 2002 16:35:20 +0000 (16:35 +0000)
* src/folderview.c
* src/mh.c
* src/news.c
* src/procmsg.c
    fix broken folder tree rescaning
    and don't use procmsg_get_mark_sum
    anymore

ChangeLog.claws
configure.in
src/folder.c
src/folderview.c
src/mh.c
src/news.c
src/procmsg.c

index 1090e3d..7e35c51 100644 (file)
@@ -1,3 +1,14 @@
+2002-06-30 [christoph] 0.7.8claws37
+
+       * src/folder.c
+       * src/folderview.c
+       * src/mh.c
+       * src/news.c
+       * src/procmsg.c
+           fix broken folder tree rescaning
+           and don't use procmsg_get_mark_sum
+           anymore
+
 2002-06-30 [christoph] 0.7.8claws36
 
        * merge new cache branch
index fb700b0..8beb5d0 100644 (file)
@@ -9,7 +9,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws36
+EXTRA_VERSION=claws37
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 047b1bc..2cb2981 100644 (file)
@@ -267,9 +267,12 @@ void folder_item_destroy(FolderItem *item)
 {
        g_return_if_fail(item != NULL);
 
+       debug_print(_("Destroying folder item %s\n"), item->path);
+       
+       if(item->cache)
+               folder_item_free_cache(item);
        g_free(item->name);
        g_free(item->path);
-       msgcache_destroy(item->cache);
        g_free(item);
 }
 
@@ -295,9 +298,17 @@ void folder_set_name(Folder *folder, const gchar *name)
        }
 }
 
+gboolean folder_tree_destroy_func(GNode *node, gpointer data) {
+       FolderItem *item = (FolderItem *) node->data;
+
+       folder_item_destroy(item);
+       return FALSE;
+}
+
 void folder_tree_destroy(Folder *folder)
 {
        /* TODO: destroy all FolderItem before */
+       g_node_traverse(folder->node, G_POST_ORDER, G_TRAVERSE_ALL, -1, folder_tree_destroy_func, NULL);
        g_node_destroy(folder->node);
 
        folder->inbox = NULL;
index a21aad0..8c73a2a 100644 (file)
@@ -812,6 +812,8 @@ void folderview_rescan_tree(Folder *folder)
        folder_write_list();
        folderview_set_all();
 
+       folderview_check_new(folder);
+       
        gtk_widget_destroy(window);
        inc_unlock();
 }
@@ -828,7 +830,6 @@ void folderview_rescan_all(void)
        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);
@@ -836,6 +837,14 @@ void folderview_rescan_all(void)
 
        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();
 }
index a888a88..a01239d 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -1270,6 +1270,7 @@ static void mh_scan_tree_recursive(FolderItem *item, GHashTable *pptable)
 
        closedir(dp);
 
+/*
        if (item->path) {
                gint new, unread, total, min, max;
 
@@ -1283,6 +1284,7 @@ static void mh_scan_tree_recursive(FolderItem *item, GHashTable *pptable)
                item->unread = unread;
                item->total = n_msg;
        }
+*/
 }
 
 static gboolean mh_rename_folder_func(GNode *node, gpointer data)
index ea87fc9..b589c06 100644 (file)
@@ -396,6 +396,7 @@ gint news_scan_group(Folder *folder, FolderItem *item)
                return 0;
        }
 
+/*
        path = folder_item_get_path(item);
        if (path && is_dir_exist(path)) {
                procmsg_get_mark_sum(path, &new, &unread, &total, &min, &max,
@@ -428,7 +429,7 @@ gint news_scan_group(Folder *folder, FolderItem *item)
        item->unread = unread;
        item->total = num;
        item->last_num = last;
-
+*/
        return 0;
 }
 
index 0ae7ab6..df2ee13 100644 (file)
@@ -479,6 +479,7 @@ static void mark_sum_func(gpointer key, gpointer value, gpointer data)
        g_free(flags);
 }
 
+#if 0 /* NEW CACHE DOES NOT ALLOW ACCESS TO THE MARK FILE */
 void procmsg_get_mark_sum(const gchar *folder,
                          gint *new, gint *unread, gint *total,
                          gint *min, gint *max,
@@ -504,6 +505,7 @@ void procmsg_get_mark_sum(const gchar *folder,
        debug_print("mark->new = %d, mark->unread = %d, mark->total = %d\n",
                    *(marksum.new), *(marksum.unread), *(marksum.total));
 }
+#endif
 
 static GHashTable *procmsg_read_mark_file(const gchar *folder)
 {