* 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 1090e3d808e0c4b3194a935e342febaa4a1480cf..7e35c51e0de3967679af47845ac2da7b38f848b0 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
 2002-06-30 [christoph] 0.7.8claws36
 
        * merge new cache branch
index fb700b05e25a65837b71e1c0f25165fbdb2b4908..8beb5d0e204e1bb2419ca20f62202922f458efb9 100644 (file)
@@ -9,7 +9,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
 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
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 047b1bca12a91165ddb739528a0d78f7d582a8e6..2cb29814694a28d2e36630442459d4527ab0535c 100644 (file)
@@ -267,9 +267,12 @@ void folder_item_destroy(FolderItem *item)
 {
        g_return_if_fail(item != NULL);
 
 {
        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);
        g_free(item->name);
        g_free(item->path);
-       msgcache_destroy(item->cache);
        g_free(item);
 }
 
        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 */
 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;
        g_node_destroy(folder->node);
 
        folder->inbox = NULL;
index a21aad04ed92cd845e8436c616b2795bc8762536..8c73a2a1e3d1d8eb7ed4df2f780b127dc6577c2e 100644 (file)
@@ -812,6 +812,8 @@ void folderview_rescan_tree(Folder *folder)
        folder_write_list();
        folderview_set_all();
 
        folder_write_list();
        folderview_set_all();
 
+       folderview_check_new(folder);
+       
        gtk_widget_destroy(window);
        inc_unlock();
 }
        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;
 
        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_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();
 
        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();
 }
        gtk_widget_destroy(window);
        inc_unlock();
 }
index a888a88e048ba00309f180f2f5117c993840cde2..a01239d2ef21c461a1df4b92e92f76753bf33a89 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);
 
 
        closedir(dp);
 
+/*
        if (item->path) {
                gint new, unread, total, min, max;
 
        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;
        }
                item->unread = unread;
                item->total = n_msg;
        }
+*/
 }
 
 static gboolean mh_rename_folder_func(GNode *node, gpointer data)
 }
 
 static gboolean mh_rename_folder_func(GNode *node, gpointer data)
index ea87fc957751bd299cafe9cda6ca49d8ea2dc345..b589c06ce47023d39b40c6afc811cc183cbb58c8 100644 (file)
@@ -396,6 +396,7 @@ gint news_scan_group(Folder *folder, FolderItem *item)
                return 0;
        }
 
                return 0;
        }
 
+/*
        path = folder_item_get_path(item);
        if (path && is_dir_exist(path)) {
                procmsg_get_mark_sum(path, &new, &unread, &total, &min, &max,
        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;
        item->unread = unread;
        item->total = num;
        item->last_num = last;
-
+*/
        return 0;
 }
 
        return 0;
 }
 
index 0ae7ab63a4f9d197c6533dadd678652c756fce3a..df2ee1396f2f17f06255edce3cb68f0a507f12d3 100644 (file)
@@ -479,6 +479,7 @@ static void mark_sum_func(gpointer key, gpointer value, gpointer data)
        g_free(flags);
 }
 
        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,
 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));
 }
        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)
 {
 
 static GHashTable *procmsg_read_mark_file(const gchar *folder)
 {