* src/compose.c
authorChristoph Hohmann <reboot@gmx.ch>
Sat, 9 Nov 2002 16:35:13 +0000 (16:35 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sat, 9 Nov 2002 16:35:13 +0000 (16:35 +0000)
* src/folder.[ch]
* src/folderview.[ch]
* src/import.c
* src/inc.c
* src/main.c
* src/mainwindow.c
* src/messageview.c
* src/prefs_folder_item.c
* src/procmsg.c
* src/summaryview.c
        implement a callback system for folder item updates

15 files changed:
ChangeLog.claws
configure.in
src/compose.c
src/folder.c
src/folder.h
src/folderview.c
src/folderview.h
src/import.c
src/inc.c
src/main.c
src/mainwindow.c
src/messageview.c
src/prefs_folder_item.c
src/procmsg.c
src/summaryview.c

index c46d227e1cb4df318d0b7e946e51acc52744fe8c..34546aa840c541fa26501708948c05472806955a 100644 (file)
@@ -1,3 +1,18 @@
+2002-11-09 [christoph] 0.8.5claws104
+
+       * src/compose.c
+       * src/folder.[ch]
+       * src/folderview.[ch]
+       * src/import.c
+       * src/inc.c
+       * src/main.c
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/prefs_folder_item.c
+       * src/procmsg.c
+       * src/summaryview.c
+               implement a callback system for folder item updates
+
 2002-11-09 [colin]     0.8.5claws103
 
        * src/folderview.c
 2002-11-09 [colin]     0.8.5claws103
 
        * src/folderview.c
index 4b06798275c8acef674566d5f99ea65ca34f447d..cb1f9c843dbe8ab1aa9a935255bb21147613adb6 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws103
+EXTRA_VERSION=claws104
 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 c7865efe98ed28eb0a2c95304ebc2f92c8a8fc21..8ddf544014047ebcd68b47fdabbf3abed1de7f2c 100644 (file)
@@ -2844,7 +2844,7 @@ gint compose_send(Compose *compose)
        g_free(msgpath);
 
        folder_item_remove_msg(folder, msgnum);
        g_free(msgpath);
 
        folder_item_remove_msg(folder, msgnum);
-       folderview_update_item(folder, TRUE);
+       folder_update_item(folder, TRUE);
 
        return val;
 }
 
        return val;
 }
@@ -2947,7 +2947,7 @@ gint compose_send(Compose *compose)
                if (compose->mode == COMPOSE_REEDIT) {
                        compose_remove_reedit_target(compose);
                        if (compose->targetinfo)
                if (compose->mode == COMPOSE_REEDIT) {
                        compose_remove_reedit_target(compose);
                        if (compose->targetinfo)
-                               folderview_update_item
+                               folder_update_item
                                        (compose->targetinfo->folder, TRUE);
                }
                /* save message to outbox */
                                        (compose->targetinfo->folder, TRUE);
                }
                /* save message to outbox */
@@ -2960,7 +2960,7 @@ gint compose_send(Compose *compose)
                                alertpanel_error
                                        (_("Can't save the message to Sent."));
                        else
                                alertpanel_error
                                        (_("Can't save the message to Sent."));
                        else
-                               folderview_update_item(outbox, TRUE);
+                               folder_update_item(outbox, TRUE);
                }
        }
 
                }
        }
 
@@ -3502,7 +3502,7 @@ void compose_remove_draft(Compose *compose)
 
        if (procmsg_msg_exist(msginfo)) {
                folder_item_remove_msg(drafts, msginfo->msgnum);
 
        if (procmsg_msg_exist(msginfo)) {
                folder_item_remove_msg(drafts, msginfo->msgnum);
-               folderview_update_item(drafts, TRUE);
+               folder_update_item(drafts, TRUE);
        }
 
 }
        }
 
 }
@@ -3714,11 +3714,11 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                compose_remove_reedit_target(compose);
                if (compose->targetinfo &&
                    compose->targetinfo->folder != queue)
                compose_remove_reedit_target(compose);
                if (compose->targetinfo &&
                    compose->targetinfo->folder != queue)
-                       folderview_update_item
+                       folder_update_item
                                (compose->targetinfo->folder, TRUE);
        }
 
                                (compose->targetinfo->folder, TRUE);
        }
 
-       folderview_update_item(queue, TRUE);
+       folder_update_item(queue, TRUE);
 
        if ((msgnum != NULL) && (item != NULL)) {
                *msgnum = num;
 
        if ((msgnum != NULL) && (item != NULL)) {
                *msgnum = num;
@@ -6371,14 +6371,14 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
                compose_remove_reedit_target(compose);
                if (compose->targetinfo &&
                    compose->targetinfo->folder != draft)
                compose_remove_reedit_target(compose);
                if (compose->targetinfo &&
                    compose->targetinfo->folder != draft)
-                       folderview_update_item(compose->targetinfo->folder,
+                       folder_update_item(compose->targetinfo->folder,
                                               TRUE);
        }
 
        newmsginfo = folder_item_fetch_msginfo(draft, msgnum);
        procmsg_msginfo_unset_flags(newmsginfo, ~0, ~0);
        MSG_SET_TMP_FLAGS(newmsginfo->flags, MSG_DRAFT);
                                               TRUE);
        }
 
        newmsginfo = folder_item_fetch_msginfo(draft, msgnum);
        procmsg_msginfo_unset_flags(newmsginfo, ~0, ~0);
        MSG_SET_TMP_FLAGS(newmsginfo->flags, MSG_DRAFT);
-       folderview_update_item(draft, TRUE);
+       folder_update_item(draft, TRUE);
        procmsg_msginfo_free(newmsginfo);
        
        lock = FALSE;
        procmsg_msginfo_free(newmsginfo);
        
        lock = FALSE;
index 35d804bcd66519f6bda30c967b53bb4ef96b563a..ca34d088aaebc1ac3ae315d4a4366b5235c2e460 100644 (file)
@@ -33,7 +33,6 @@
 
 #include "intl.h"
 #include "folder.h"
 
 #include "intl.h"
 #include "folder.h"
-#include "folderview.h"
 #include "session.h"
 #include "imap.h"
 #include "news.h"
 #include "session.h"
 #include "imap.h"
 #include "news.h"
 #include "xml.h"
 #include "codeconv.h"
 #include "prefs.h"
 #include "xml.h"
 #include "codeconv.h"
 #include "prefs.h"
-#include "prefs_common.h"
 #include "account.h"
 #include "account.h"
-#include "prefs_account.h"
 #include "filtering.h"
 #include "scoring.h"
 #include "prefs_folder_item.h"
 #include "procheader.h"
 #include "statusbar.h"
 
 #include "filtering.h"
 #include "scoring.h"
 #include "prefs_folder_item.h"
 #include "procheader.h"
 #include "statusbar.h"
 
+/* Dependecies to be removed ?! */
+#include "prefs_common.h"
+#include "prefs_account.h"
+#include "prefs_folder_item.h"
+
 static GList *folder_list = NULL;
 
 static void folder_init                (Folder         *folder,
 static GList *folder_list = NULL;
 
 static void folder_init                (Folder         *folder,
@@ -443,6 +445,8 @@ void folder_scan_tree(Folder *folder)
        folder_persist_prefs_free(pptable);
 
        prefs_matcher_read_config();
        folder_persist_prefs_free(pptable);
 
        prefs_matcher_read_config();
+
+       folder_write_list();
 }
 
 FolderItem *folder_create_folder(FolderItem *parent, const gchar *name)
 }
 
 FolderItem *folder_create_folder(FolderItem *parent, const gchar *name)
@@ -943,7 +947,8 @@ gint folder_item_scan(FolderItem *item)
        GSList *folder_list = NULL, *cache_list = NULL, *folder_list_cur, *cache_list_cur, *new_list = NULL;
        guint newcnt = 0, unreadcnt = 0, totalcnt = 0;
        guint cache_max_num, folder_max_num, cache_cur_num, folder_cur_num;
        GSList *folder_list = NULL, *cache_list = NULL, *folder_list_cur, *cache_list_cur, *new_list = NULL;
        guint newcnt = 0, unreadcnt = 0, totalcnt = 0;
        guint cache_max_num, folder_max_num, cache_cur_num, folder_cur_num;
-
+       gboolean contentchange = FALSE;
+    
        g_return_val_if_fail(item != NULL, -1);
        if (item->path == NULL) return -1;
 
        g_return_val_if_fail(item != NULL, -1);
        if (item->path == NULL) return -1;
 
@@ -1042,6 +1047,8 @@ gint folder_item_scan(FolderItem *item)
                        else
                                folder_cur_num = G_MAXINT;
 
                        else
                                folder_cur_num = G_MAXINT;
 
+                       contentchange = TRUE;
+
                        continue;
                }
 
                        continue;
                }
 
@@ -1061,6 +1068,8 @@ gint folder_item_scan(FolderItem *item)
                        else
                                cache_cur_num = G_MAXINT;
 
                        else
                                cache_cur_num = G_MAXINT;
 
+                       contentchange = TRUE;
+
                        continue;
                }
 
                        continue;
                }
 
@@ -1110,6 +1119,8 @@ gint folder_item_scan(FolderItem *item)
                        else
                                folder_cur_num = G_MAXINT;
 
                        else
                                folder_cur_num = G_MAXINT;
 
+                       contentchange = TRUE;
+
                        continue;
                }
        }
                        continue;
                }
        }
@@ -1168,7 +1179,7 @@ gint folder_item_scan(FolderItem *item)
        
        g_slist_free(new_list);
 
        
        g_slist_free(new_list);
 
-       folderview_update_item(item, FALSE);
+       folder_update_item(item, contentchange);
 
        return 0;
 }
 
        return 0;
 }
@@ -2395,13 +2406,14 @@ static void folder_write_list_recursive(GNode *node, gpointer data)
                fputs(" />\n", fp);
 }
 
                fputs(" />\n", fp);
 }
 
-static void folder_update_op_count_rec(GNode *node) {
+static void folder_update_op_count_rec(GNode *node)
+{
        FolderItem *fitem = FOLDER_ITEM(node->data);
 
        if (g_node_depth(node) > 0) {
                if (fitem->op_count > 0) {
                        fitem->op_count = 0;
        FolderItem *fitem = FOLDER_ITEM(node->data);
 
        if (g_node_depth(node) > 0) {
                if (fitem->op_count > 0) {
                        fitem->op_count = 0;
-                       folderview_update_item(fitem, 0);
+                       folder_update_item(fitem, FALSE);
                }
                if (node->children) {
                        GNode *child;
                }
                if (node->children) {
                        GNode *child;
@@ -2622,7 +2634,101 @@ void folder_item_apply_processing(FolderItem *item)
                procmsg_msginfo_free(msginfo);
        }
        
                procmsg_msginfo_free(msginfo);
        }
        
-       folderview_update_items_when_required(FALSE);
+       folder_update_items_when_required(FALSE);
 
        g_slist_free(mlist);
 }
 
        g_slist_free(mlist);
 }
+
+GSList *folder_item_update_callbacks_list = NULL;
+gint   folder_item_update_callbacks_nextid = 0;
+
+struct FolderItemUpdateCallback
+{
+       gint                    id;
+       FolderItemUpdateFunc    func;
+       gpointer                data;
+};
+
+gint folder_item_update_callback_register(FolderItemUpdateFunc func, gpointer data)
+{
+       struct FolderItemUpdateCallback *callback;
+
+       g_return_val_if_fail(func != NULL, -1);
+
+       folder_item_update_callbacks_nextid++;
+
+       callback = g_new0(struct FolderItemUpdateCallback, 1);
+       callback->id = folder_item_update_callbacks_nextid;
+       callback->func = func;
+       callback->data = data;
+
+       folder_item_update_callbacks_list =
+               g_slist_append(folder_item_update_callbacks_list, callback);
+
+       return folder_item_update_callbacks_nextid;
+}
+
+void folder_item_update_callback_unregister(gint id)
+{
+       GSList *list, *next;
+
+       for (list = folder_item_update_callbacks_list; list != NULL; list = next) {
+               struct FolderItemUpdateCallback *callback;
+
+               next = list->next;
+
+               callback = list->data;
+               if (callback->id == id) {
+                       folder_item_update_callbacks_list =
+                               g_slist_remove(folder_item_update_callbacks_list, callback);
+                       g_free(callback);
+               }
+       }
+}
+
+static void folder_item_update_callback_execute(FolderItem *item, gboolean contentchange)
+{
+       GSList *list;
+
+       for (list = folder_item_update_callbacks_list; list != NULL; list = list->next) {
+               struct FolderItemUpdateCallback *callback;
+
+               callback = list->data;
+               callback->func(item, contentchange, callback->data);
+       }
+}
+
+void folder_update_item(FolderItem *item, gboolean contentchange)
+{
+       folder_item_update_callback_execute(item, contentchange);
+}
+
+static void folder_update_item_func(FolderItem *item, gpointer data)
+{
+       gboolean contentchange = GPOINTER_TO_INT(data);
+       
+       if (item->need_update) {
+               folder_item_update_callback_execute(item, contentchange);
+               item->need_update = FALSE;
+       }
+}
+
+void folder_update_items_when_required(gboolean contentchange)
+{
+       folder_func_to_all_folders(folder_update_item_func, GINT_TO_POINTER(contentchange));
+}
+
+void folder_update_item_recursive(FolderItem *item, gboolean update_summary)
+{
+       GNode *node = item->folder->node;       
+       node = g_node_find(node, G_PRE_ORDER, G_TRAVERSE_ALL, item);
+       node = node->children;
+       folder_item_update_callback_execute(item, update_summary);
+       while (node != NULL) {
+               if (node && node->data) {
+                       FolderItem *next_item = (FolderItem*) node->data;
+                       folder_item_update_callback_execute(next_item, update_summary);
+               }
+               node = node->next;
+       }
+}
index 23c98eb1bdcc4c77e9da1087228c32ac12c14260..4cdf09b9c09e5b53bad3b01654c540957c3185a7 100644 (file)
@@ -104,6 +104,9 @@ typedef void (*FolderDestroyNotify) (Folder         *folder,
                                         gpointer        data);
 typedef void (*FolderItemFunc)         (FolderItem     *item,
                                         gpointer        data);
                                         gpointer        data);
 typedef void (*FolderItemFunc)         (FolderItem     *item,
                                         gpointer        data);
+typedef void (*FolderItemUpdateFunc)   (FolderItem     *item,
+                                        gboolean        contentchange,
+                                        gpointer        data);
 
 struct _Folder
 {
 
 struct _Folder
 {
@@ -385,4 +388,13 @@ void folder_item_set_default_flags (FolderItem *dest, MsgFlags *flags);
 
 void folder_item_apply_processing      (FolderItem *item);
 
 
 void folder_item_apply_processing      (FolderItem *item);
 
+void folder_update_item                        (FolderItem *item,
+                                        gboolean contentchange);
+void folder_update_items_when_required (gboolean contentchange);
+void folder_update_item_recursive      (FolderItem *item,
+                                        gboolean update_summary);
+gint folder_item_update_callback_register(FolderItemUpdateFunc func,
+                                         gpointer data);
+void folder_item_update_callback_unregister(gint id);
+
 #endif /* __FOLDER_H__ */
 #endif /* __FOLDER_H__ */
index 1379e3655eb41a6b1226a82758daa5d92ebc52dc..eaa17a829f6774717742fe1bc89a4237b4b08dc9 100644 (file)
@@ -258,12 +258,14 @@ static void folderview_drag_data_get     (GtkWidget        *widget,
 
 void folderview_create_folder_node       (FolderView       *folderview, 
                                          FolderItem       *item);
 
 void folderview_create_folder_node       (FolderView       *folderview, 
                                          FolderItem       *item);
+void folderview_update_item             (FolderItem       *item,
+                                          gboolean         update_summary,
+                                         gpointer          data);
 
 static void folderview_scoring_cb(FolderView *folderview, guint action,
                                  GtkWidget *widget);
 static void folderview_processing_cb(FolderView *folderview, guint action,
                                     GtkWidget *widget);
 
 static void folderview_scoring_cb(FolderView *folderview, guint action,
                                  GtkWidget *widget);
 static void folderview_processing_cb(FolderView *folderview, guint action,
                                     GtkWidget *widget);
-
 static GtkItemFactoryEntry folderview_mbox_popup_entries[] =
 {
        {N_("/Create _new folder..."),  NULL, folderview_new_mbox_folder_cb,    0, NULL},
 static GtkItemFactoryEntry folderview_mbox_popup_entries[] =
 {
        {N_("/Create _new folder..."),  NULL, folderview_new_mbox_folder_cb,    0, NULL},
@@ -492,6 +494,9 @@ FolderView *folderview_create(void)
        folderview->mbox_popup   = mbox_popup;
        folderview->mbox_factory = mbox_factory;
 
        folderview->mbox_popup   = mbox_popup;
        folderview->mbox_factory = mbox_factory;
 
+       folderview->folder_item_update_callback_id =
+               folder_item_update_callback_register(folderview_update_item, (gpointer) folderview);
+
        gtk_widget_show_all(scrolledwin);
 
        folderview_list = g_list_append(folderview_list, folderview);
        gtk_widget_show_all(scrolledwin);
 
        folderview_list = g_list_append(folderview_list, folderview);
@@ -813,7 +818,6 @@ void folderview_rescan_tree(Folder *folder)
        folder_scan_tree(folder);
        folder_set_ui_func(folder, NULL, NULL);
 
        folder_scan_tree(folder);
        folder_set_ui_func(folder, NULL, NULL);
 
-       folder_write_list();
        folderview_set_all();
 
        folderview_check_new(folder);
        folderview_set_all();
 
        folderview_check_new(folder);
@@ -1240,80 +1244,25 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                folderview_update_node(folderview, node);
 }
 
                folderview_update_node(folderview, node);
 }
 
-void folderview_update_item(FolderItem *item, gboolean update_summary)
+void folderview_update_item(FolderItem *item, gboolean update_summary, gpointer data)
 {
 {
-       GList *list;
-       FolderView *folderview;
+       FolderView *folderview = (FolderView *)data;
        GtkCTree *ctree;
        GtkCTreeNode *node;
 
        GtkCTree *ctree;
        GtkCTreeNode *node;
 
+       g_return_if_fail(folderview != NULL);
        g_return_if_fail(item != NULL);
 
        g_return_if_fail(item != NULL);
 
-       for (list = folderview_list; list != NULL; list = list->next) {
-               folderview = (FolderView *)list->data;
-               ctree = GTK_CTREE(folderview->ctree);
-
-               node = gtk_ctree_find_by_row_data(ctree, NULL, item);
-               if (node) {
-                       folderview_update_node(folderview, node);
-                       if (update_summary && folderview->opened == node)
-                               summary_show(folderview->summaryview, item);
-               }
-       }
-}
-
-static void folderview_update_item_recursive (FolderItem *item, gboolean update_summary)
-{
-       GNode *node = item->folder->node;       
-       node = g_node_find(node, G_PRE_ORDER, G_TRAVERSE_ALL, item);
-       node = node->children;
-       folderview_update_item(item, update_summary);
-       while (node != NULL) {
-               if (node && node->data) {
-                       FolderItem *next_item = (FolderItem*) node->data;
-                       folderview_update_item(next_item, update_summary);
-               }
-               node = node->next;
-       }
-}
-
-void folderview_update_items_when_required(gboolean update_summary)
-{
-       GList *list;
-       FolderView *folderview;
-       GtkCTree *ctree;
-       GtkCTreeNode *node;
-       FolderItem *item;
-
-       for (list = folderview_list; list != NULL; list = list->next) {
-               folderview = (FolderView *)list->data;
-               ctree = GTK_CTREE(folderview->ctree);
-
-               for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
-                    node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
-                       item = gtk_ctree_node_get_row_data(ctree, node);
+       ctree = GTK_CTREE(folderview->ctree);
 
 
-                       if (item->need_update) {
-                               folderview_update_node(folderview, node);
-                               if (update_summary && folderview->opened == node)
-                                       summary_show(folderview->summaryview, item);
-                       }
-               }
+       node = gtk_ctree_find_by_row_data(ctree, NULL, item);
+       if (node) {
+               folderview_update_node(folderview, node);
+               if (update_summary && folderview->opened == node)
+                       summary_show(folderview->summaryview, item);
        }
 }
 
        }
 }
 
-static void folderview_update_item_foreach_func(gpointer key, gpointer val,
-                                               gpointer data)
-{
-       folderview_update_item((FolderItem *)key, (gboolean)data);
-}
-
-void folderview_update_item_foreach(GHashTable *table, gboolean update_summary)
-{
-       g_hash_table_foreach(table, folderview_update_item_foreach_func,
-                            (gpointer)update_summary);
-}
-
 static gboolean folderview_gnode_func(GtkCTree *ctree, guint depth,
                                      GNode *gnode, GtkCTreeNode *cnode,
                                      gpointer data)
 static gboolean folderview_gnode_func(GtkCTree *ctree, guint depth,
                                      GNode *gnode, GtkCTreeNode *cnode,
                                      gpointer data)
@@ -1881,7 +1830,7 @@ static void folderview_update_tree_cb(FolderView *folderview, guint action,
        if (folderview->opened) {
                item = gtk_ctree_node_get_row_data(ctree, folderview->opened);
                if (item)
        if (folderview->opened) {
                item = gtk_ctree_node_get_row_data(ctree, folderview->opened);
                if (item)
-                       folderview_update_item(item, TRUE);
+                       folder_update_item(item, TRUE);
        }
 }
 
        }
 }
 
@@ -2705,8 +2654,8 @@ static void folderview_drag_received_cb(GtkWidget        *widget,
                                debug_print("can't remove src node: is null\n");
 
                        folderview_create_folder_node_recursive(folderview, new_item);
                                debug_print("can't remove src node: is null\n");
 
                        folderview_create_folder_node_recursive(folderview, new_item);
-                       folderview_update_item(src_parent, TRUE);
-                       folderview_update_item_recursive(new_item, TRUE);
+                       folder_update_item(src_parent, TRUE);
+                       folder_update_item_recursive(new_item, TRUE);
                        folderview_sort_folders(folderview, 
                                gtk_ctree_find_by_row_data(GTK_CTREE(widget), 
                                        NULL, new_item->parent), new_item->folder);
                        folderview_sort_folders(folderview, 
                                gtk_ctree_find_by_row_data(GTK_CTREE(widget), 
                                        NULL, new_item->parent), new_item->folder);
index 348c13bcc7aeb1bcc197841071fa98dc0d7b3584..7bbc84a7ad17f556e7c14bd7179304f2fae42e5a 100644 (file)
@@ -55,6 +55,8 @@ struct _FolderView
 
        MainWindow   *mainwin;
        SummaryView  *summaryview;
 
        MainWindow   *mainwin;
        SummaryView  *summaryview;
+
+       gint folder_item_update_callback_id;
 };
 
 FolderView *folderview_create          (void);
 };
 
 FolderView *folderview_create          (void);
@@ -72,13 +74,6 @@ void folderview_rescan_all           (void);
 void folderview_check_new              (Folder         *folder);
 void folderview_check_new_all          (void);
 
 void folderview_check_new              (Folder         *folder);
 void folderview_check_new_all          (void);
 
-void folderview_update_item            (FolderItem     *item,
-                                        gboolean        update_summary);
-void folderview_update_items_when_required
-                                       (gboolean        update_summary);
-void folderview_update_item_foreach    (GHashTable     *table,
-                                        gboolean        update_summary);
-
 void folderview_new_folder             (FolderView     *folderview);
 void folderview_rename_folder          (FolderView     *folderview);
 void folderview_delete_folder          (FolderView     *folderview);
 void folderview_new_folder             (FolderView     *folderview);
 void folderview_rename_folder          (FolderView     *folderview);
 void folderview_delete_folder          (FolderView     *folderview);
index 09c14909b30da30bd9c9cbcfb30b029ec0965891..ced1aaa027732561a4e83d7fe3862775cf398267 100644 (file)
@@ -107,7 +107,7 @@ gint import_mbox(FolderItem *default_dest)
                                g_warning("Can't find the folder.\n");
                        } else {
                                ok = proc_mbox(dest, filename);
                                g_warning("Can't find the folder.\n");
                        } else {
                                ok = proc_mbox(dest, filename);
-                               folderview_update_item(dest, TRUE);
+                               folder_update_item(dest, TRUE);
                        }
                }
        }
                        }
                }
        }
index c66ecb53a98b5f812c168300bbfac1ab85f69d60..d3ffbc424efee3971a326062e8356a9d7453d84e 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -152,7 +152,7 @@ static void inc_finished(MainWindow *mainwin, gboolean new_messages)
        } else if (prefs_common.scan_all_after_inc) {
                item = mainwin->summaryview->folder_item;
                if (FOLDER_SUMMARY_MISMATCH(item, mainwin->summaryview)) {
        } else if (prefs_common.scan_all_after_inc) {
                item = mainwin->summaryview->folder_item;
                if (FOLDER_SUMMARY_MISMATCH(item, mainwin->summaryview)) {
-                       folderview_update_item(item, TRUE);
+                       folder_update_item(item, TRUE);
                }       
        }
 }
                }       
        }
 }
@@ -247,7 +247,7 @@ static gint inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
                folderview_check_new(FOLDER(account->folder));
                if (!prefs_common.scan_all_after_inc && item != NULL &&
                    FOLDER(account->folder) == item->folder)
                folderview_check_new(FOLDER(account->folder));
                if (!prefs_common.scan_all_after_inc && item != NULL &&
                    FOLDER(account->folder) == item->folder)
-                       folderview_update_item(item, TRUE);
+                       folder_update_item(item, TRUE);
                return 1;
 
        case A_POP3:
                return 1;
 
        case A_POP3:
@@ -328,7 +328,7 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean notify)
                        folderview_check_new(FOLDER(account->folder));
                        if (!prefs_common.scan_all_after_inc && item != NULL &&
                            FOLDER(account->folder) == item->folder)
                        folderview_check_new(FOLDER(account->folder));
                        if (!prefs_common.scan_all_after_inc && item != NULL &&
                            FOLDER(account->folder) == item->folder)
-                               folderview_update_item(item, TRUE);
+                               folder_update_item(item, TRUE);
                }
        }
 
                }
        }
 
@@ -614,7 +614,7 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                new_msgs += pop3_state->cur_total_num;
 
                if (!prefs_common.scan_all_after_inc) {
                new_msgs += pop3_state->cur_total_num;
 
                if (!prefs_common.scan_all_after_inc) {
-                       folderview_update_items_when_required
+                       folder_update_items_when_required
                                 (!prefs_common.open_inbox_on_inc);
                }
 
                                 (!prefs_common.open_inbox_on_inc);
                }
 
@@ -1164,10 +1164,10 @@ static gint get_spool(FolderItem *dest, const gchar *mbox)
        unlock_mbox(mbox, lockfd, LOCK_FLOCK);
 
        if (!prefs_common.scan_all_after_inc) {
        unlock_mbox(mbox, lockfd, LOCK_FLOCK);
 
        if (!prefs_common.scan_all_after_inc) {
-               folderview_update_items_when_required
+               folder_update_items_when_required
                        (!prefs_common.open_inbox_on_inc);
        } else if (!prefs_common.scan_all_after_inc) {
                        (!prefs_common.open_inbox_on_inc);
        } else if (!prefs_common.scan_all_after_inc) {
-               folderview_update_item(dest, TRUE);
+               folder_update_item(dest, TRUE);
        }
 
        return msgs;
        }
 
        return msgs;
index 23a39c71eb9741448da611e01ee9bbab842d782c..6d1ab1b7917767def2fc58b18732e3cf02776871 100644 (file)
@@ -808,9 +808,8 @@ static void send_queue(void)
                                alertpanel_error(_("Some errors occurred while sending queued messages."));
                        statusbar_pop_all();
                        folder_item_scan(folder->queue);
                                alertpanel_error(_("Some errors occurred while sending queued messages."));
                        statusbar_pop_all();
                        folder_item_scan(folder->queue);
-                       folderview_update_item(folder->queue, TRUE);
                        if (prefs_common.savemsg && folder->outbox) {
                        if (prefs_common.savemsg && folder->outbox) {
-                               folderview_update_item(folder->outbox, TRUE);
+                               folder_update_item(folder->outbox, TRUE);
                                if (folder->outbox == def_outbox)
                                        def_outbox = NULL;
                        }
                                if (folder->outbox == def_outbox)
                                        def_outbox = NULL;
                        }
@@ -818,5 +817,5 @@ static void send_queue(void)
        }
 
        if (prefs_common.savemsg && def_outbox)
        }
 
        if (prefs_common.savemsg && def_outbox)
-               folderview_update_item(def_outbox, TRUE);
+               folder_update_item(def_outbox, TRUE);
 }
 }
index d44e5985f516b6568cc8de7c2f943d2475c1c3f3..defd40a8a7c7d13d5e9c2415299206a6a51e109b 100644 (file)
@@ -1462,7 +1462,7 @@ void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
        for (list = folder_get_list(); list != NULL; list = list->next) {
                folder = list->data;
                if (folder && folder->trash) {
        for (list = folder_get_list(); list != NULL; list = list->next) {
                folder = list->data;
                if (folder && folder->trash) {
-                       folderview_update_item(folder->trash, TRUE);
+                       folder_update_item(folder->trash, TRUE);
                }
        }
 
                }
        }
 
@@ -3086,7 +3086,7 @@ void send_queue_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
                                alertpanel_error(_("Some errors occurred while sending queued messages."));
                        statusbar_pop_all();
                        folder_item_scan(folder->queue);
                                alertpanel_error(_("Some errors occurred while sending queued messages."));
                        statusbar_pop_all();
                        folder_item_scan(folder->queue);
-                       folderview_update_item(folder->queue, TRUE);
+                       folder_update_item(folder->queue, TRUE);
                }
        }
 }
                }
        }
 }
index 18c3046538eb40c3f5c7336e99d529b1ac355b59..bbf597ade1e1013c30a4bcc7d70ed7a356abfb9d 100644 (file)
@@ -278,7 +278,7 @@ static gint disposition_notification_queue(PrefsAccount * account,
        }
        g_free(tmp);
 
        }
        g_free(tmp);
 
-       folderview_update_item(queue, TRUE);
+       folder_update_item(queue, TRUE);
 
        return 0;
 }
 
        return 0;
 }
index 17c3b1e7d3ce69e40600d42c40160d5d31a23bc7..4530aff522c9788b0260cfbccd9a0823093bdd8e 100644 (file)
@@ -613,7 +613,7 @@ void prefs_folder_item_ok_cb(GtkWidget *widget,
        prefs->color = dialog->item->prefs->color;
        /* update folder view */
        if (prefs->color > 0)
        prefs->color = dialog->item->prefs->color;
        /* update folder view */
        if (prefs->color > 0)
-               folderview_update_item(dialog->item, FALSE);
+               folder_update_item(dialog->item, FALSE);
 
        prefs_folder_item_save_config(dialog->item);
        prefs_folder_item_destroy(dialog);
 
        prefs_folder_item_save_config(dialog->item);
        prefs_folder_item_destroy(dialog);
index 860833a90add1980b4a41634d2e3c869c8506299..b47af18f66152988ac7b58864a9e88ab98b47dcb 100644 (file)
@@ -899,7 +899,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
                procmsg_msginfo_free(msginfo);
        }
 
                procmsg_msginfo_free(msginfo);
        }
 
-       folderview_update_item(queue, FALSE);
+       folder_update_item(queue, FALSE);
 
        return ret;
 }
 
        return ret;
 }
index dea703041091b6bf2292e42ff8e5b32d1a04e08d..a71a26dd7f07408c6ac67134c99b2cf0e612a447 100644 (file)
@@ -2129,7 +2129,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
 
                g_node_destroy(root);
 
 
                g_node_destroy(root);
 
-               folderview_update_items_when_required(FALSE);
+               folder_update_items_when_required(FALSE);
 
                summary_thread_init(summaryview);
        } else {
 
                summary_thread_init(summaryview);
        } else {
@@ -2321,7 +2321,7 @@ static void summary_display_msg_full(SummaryView *summaryview,
                if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
                        procmsg_msginfo_unset_flags
                                (msginfo, MSG_NEW | MSG_UNREAD, 0);
                if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
                        procmsg_msginfo_unset_flags
                                (msginfo, MSG_NEW | MSG_UNREAD, 0);
-                       folderview_update_item(msginfo->folder, FALSE);
+                       folder_update_item(msginfo->folder, FALSE);
                        summary_set_row_marks(summaryview, row);
                        gtk_clist_thaw(GTK_CLIST(ctree));
                        summary_status_show(summaryview);
                        summary_set_row_marks(summaryview, row);
                        gtk_clist_thaw(GTK_CLIST(ctree));
                        summary_status_show(summaryview);
@@ -2647,7 +2647,7 @@ static void summary_mark_row(SummaryView *summaryview, GtkCTreeNode *row)
        if (changed && !prefs_common.immediate_exec) {
                msginfo->to_folder->op_count--;
                if (msginfo->to_folder->op_count == 0)
        if (changed && !prefs_common.immediate_exec) {
                msginfo->to_folder->op_count--;
                if (msginfo->to_folder->op_count == 0)
-                       folderview_update_item(msginfo->to_folder, 0);
+                       folder_update_item(msginfo->to_folder, FALSE);
        }
        msginfo->to_folder = NULL;
        procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
        }
        msginfo->to_folder = NULL;
        procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
@@ -2677,7 +2677,7 @@ static void summary_lock_row(SummaryView *summaryview, GtkCTreeNode *row)
        if (changed && !prefs_common.immediate_exec) {
                msginfo->to_folder->op_count--;
                if (msginfo->to_folder->op_count == 0)
        if (changed && !prefs_common.immediate_exec) {
                msginfo->to_folder->op_count--;
                if (msginfo->to_folder->op_count == 0)
-                       folderview_update_item(msginfo->to_folder, 0);
+                       folder_update_item(msginfo->to_folder, FALSE);
        }
        msginfo->to_folder = NULL;
        procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
        }
        msginfo->to_folder = NULL;
        procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
@@ -2728,7 +2728,7 @@ void summary_mark_as_read(SummaryView *summaryview)
        for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
                summary_mark_row_as_read(summaryview,
                                         GTK_CTREE_NODE(cur->data));
        for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
                summary_mark_row_as_read(summaryview,
                                         GTK_CTREE_NODE(cur->data));
-       folderview_update_items_when_required(FALSE);
+       folder_update_items_when_required(FALSE);
 
        summary_status_show(summaryview);
 }
 
        summary_status_show(summaryview);
 }
@@ -2749,7 +2749,7 @@ void summary_mark_all_read(SummaryView *summaryview)
                        summary_set_row_marks(summaryview, node);
        }
        gtk_clist_thaw(clist);
                        summary_set_row_marks(summaryview, node);
        }
        gtk_clist_thaw(clist);
-       folderview_update_items_when_required(FALSE);
+       folder_update_items_when_required(FALSE);
 
        summary_status_show(summaryview);
 }
 
        summary_status_show(summaryview);
 }
@@ -2786,7 +2786,7 @@ void summary_mark_as_unread(SummaryView *summaryview)
        for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
                summary_mark_row_as_unread(summaryview,
                                           GTK_CTREE_NODE(cur->data));
        for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
                summary_mark_row_as_unread(summaryview,
                                           GTK_CTREE_NODE(cur->data));
-       folderview_update_items_when_required(FALSE);
+       folder_update_items_when_required(FALSE);
 
        summary_status_show(summaryview);
 }
 
        summary_status_show(summaryview);
 }
@@ -2866,7 +2866,7 @@ static void summary_delete_row(SummaryView *summaryview, GtkCTreeNode *row)
        if (changed && !prefs_common.immediate_exec) {
                msginfo->to_folder->op_count--;
                if (msginfo->to_folder->op_count == 0)
        if (changed && !prefs_common.immediate_exec) {
                msginfo->to_folder->op_count--;
                if (msginfo->to_folder->op_count == 0)
-                       folderview_update_item(msginfo->to_folder, 0);
+                       folder_update_item(msginfo->to_folder, FALSE);
        }
        msginfo->to_folder = NULL;
        procmsg_msginfo_unset_flags(msginfo, MSG_MARKED, MSG_MOVE | MSG_COPY);
        }
        msginfo->to_folder = NULL;
        procmsg_msginfo_unset_flags(msginfo, MSG_MARKED, MSG_MOVE | MSG_COPY);
@@ -3022,7 +3022,7 @@ static void summary_unmark_row(SummaryView *summaryview, GtkCTreeNode *row)
        if (changed && !prefs_common.immediate_exec) {
                msginfo->to_folder->op_count--;
                if (msginfo->to_folder->op_count == 0)
        if (changed && !prefs_common.immediate_exec) {
                msginfo->to_folder->op_count--;
                if (msginfo->to_folder->op_count == 0)
-                       folderview_update_item(msginfo->to_folder, 0);
+                       folder_update_item(msginfo->to_folder, FALSE);
        }
        msginfo->to_folder = NULL;
        procmsg_msginfo_unset_flags(msginfo, MSG_MARKED | MSG_DELETED, MSG_MOVE | MSG_COPY);
        }
        msginfo->to_folder = NULL;
        procmsg_msginfo_unset_flags(msginfo, MSG_MARKED | MSG_DELETED, MSG_MOVE | MSG_COPY);
@@ -3057,7 +3057,7 @@ static void summary_move_row_to(SummaryView *summaryview, GtkCTreeNode *row,
                if (!prefs_common.immediate_exec) {
                        msginfo->to_folder->op_count--;
                        if (msginfo->to_folder->op_count == 0) {
                if (!prefs_common.immediate_exec) {
                        msginfo->to_folder->op_count--;
                        if (msginfo->to_folder->op_count == 0) {
-                               folderview_update_item(msginfo->to_folder, 0);
+                               folder_update_item(msginfo->to_folder, FALSE);
                                changed = TRUE;
                        }
                }
                                changed = TRUE;
                        }
                }
@@ -3081,7 +3081,7 @@ static void summary_move_row_to(SummaryView *summaryview, GtkCTreeNode *row,
                if (changed) {
                        msginfo->to_folder->op_count++;
                        if (msginfo->to_folder->op_count == 1)
                if (changed) {
                        msginfo->to_folder->op_count++;
                        if (msginfo->to_folder->op_count == 1)
-                               folderview_update_item(msginfo->to_folder, 0);
+                               folder_update_item(msginfo->to_folder, FALSE);
                }
        }
 
                }
        }
 
@@ -3116,7 +3116,7 @@ void summary_move_selected_to(SummaryView *summaryview, FolderItem *to_folder)
        else {
                summary_status_show(summaryview);
 
        else {
                summary_status_show(summaryview);
 
-               folderview_update_item(to_folder, 0);
+               folder_update_item(to_folder, FALSE);
        }
        
        if (!summaryview->selected) { /* this was the last message */
        }
        
        if (!summaryview->selected) { /* this was the last message */
@@ -3154,7 +3154,7 @@ static void summary_copy_row_to(SummaryView *summaryview, GtkCTreeNode *row,
                if (!prefs_common.immediate_exec) {
                        msginfo->to_folder->op_count--;
                        if (msginfo->to_folder->op_count == 0) {
                if (!prefs_common.immediate_exec) {
                        msginfo->to_folder->op_count--;
                        if (msginfo->to_folder->op_count == 0) {
-                               folderview_update_item(msginfo->to_folder, 0);
+                               folder_update_item(msginfo->to_folder, FALSE);
                                changed = TRUE;
                        }
                }
                                changed = TRUE;
                        }
                }
@@ -3178,7 +3178,7 @@ static void summary_copy_row_to(SummaryView *summaryview, GtkCTreeNode *row,
                if (changed) {
                        msginfo->to_folder->op_count++;
                        if (msginfo->to_folder->op_count == 1)
                if (changed) {
                        msginfo->to_folder->op_count++;
                        if (msginfo->to_folder->op_count == 1)
-                               folderview_update_item(msginfo->to_folder, 0);
+                               folder_update_item(msginfo->to_folder, FALSE);
                }
        }
 
                }
        }
 
@@ -3213,7 +3213,7 @@ void summary_copy_selected_to(SummaryView *summaryview, FolderItem *to_folder)
        else {
                summary_status_show(summaryview);
 
        else {
                summary_status_show(summaryview);
 
-               folderview_update_item(to_folder, 0);
+               folder_update_item(to_folder, FALSE);
        }
 }
 
        }
 }
 
@@ -3447,7 +3447,7 @@ static void summary_execute_move(SummaryView *summaryview)
        if (summaryview->mlist) {
                procmsg_move_messages(summaryview->mlist);
 
        if (summaryview->mlist) {
                procmsg_move_messages(summaryview->mlist);
 
-               folderview_update_items_when_required(FALSE);
+               folder_update_items_when_required(FALSE);
 
                for (cur = summaryview->mlist; cur != NULL; cur = cur->next)
                        procmsg_msginfo_free((MsgInfo *)cur->data);
 
                for (cur = summaryview->mlist; cur != NULL; cur = cur->next)
                        procmsg_msginfo_free((MsgInfo *)cur->data);
@@ -3455,7 +3455,7 @@ static void summary_execute_move(SummaryView *summaryview)
                summaryview->mlist = NULL;
        }
 
                summaryview->mlist = NULL;
        }
 
-       folderview_update_item(summaryview->folder_item, FALSE);
+       folder_update_item(summaryview->folder_item, FALSE);
 }
 
 static void summary_execute_move_func(GtkCTree *ctree, GtkCTreeNode *node,
 }
 
 static void summary_execute_move_func(GtkCTree *ctree, GtkCTreeNode *node,
@@ -3494,7 +3494,7 @@ static void summary_execute_copy(SummaryView *summaryview)
        if (summaryview->mlist) {
                procmsg_copy_messages(summaryview->mlist);
 
        if (summaryview->mlist) {
                procmsg_copy_messages(summaryview->mlist);
 
-               folderview_update_items_when_required(FALSE);
+               folder_update_items_when_required(FALSE);
 
                g_slist_free(summaryview->mlist);
                summaryview->mlist = NULL;
 
                g_slist_free(summaryview->mlist);
                summaryview->mlist = NULL;
@@ -3552,9 +3552,9 @@ static void summary_execute_delete(SummaryView *summaryview)
        summaryview->mlist = NULL;
 
        if ((summaryview->folder_item != trash) && (trash != NULL)) {
        summaryview->mlist = NULL;
 
        if ((summaryview->folder_item != trash) && (trash != NULL)) {
-               folderview_update_item(trash, FALSE);
+               folder_update_item(trash, FALSE);
        }
        }
-       folderview_update_item(summaryview->folder_item, FALSE);
+       folder_update_item(summaryview->folder_item, FALSE);
 }
 
 static void summary_execute_delete_func(GtkCTree *ctree, GtkCTreeNode *node,
 }
 
 static void summary_execute_delete_func(GtkCTree *ctree, GtkCTreeNode *node,
@@ -3849,7 +3849,7 @@ void summary_filter(SummaryView *summaryview)
 
                gtk_clist_thaw(GTK_CLIST(summaryview->ctree));
 
 
                gtk_clist_thaw(GTK_CLIST(summaryview->ctree));
 
-               folderview_update_items_when_required(FALSE);
+               folder_update_items_when_required(FALSE);
        }
 
        debug_print("done.\n");
        }
 
        debug_print("done.\n");
@@ -5019,7 +5019,7 @@ static void news_flag_crosspost(MsgInfo *msginfo)
                        debug_print(" <%s>", (gchar *)value);
                        if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
                                procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
                        debug_print(" <%s>", (gchar *)value);
                        if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
                                procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
-                               folderview_update_item(msginfo->folder, FALSE);
+                               folder_update_item(msginfo->folder, FALSE);
                                procmsg_msginfo_set_flags(msginfo, mff->account->crosspost_col, 0);
                        }
                        g_hash_table_remove(mff->newsart, key);
                                procmsg_msginfo_set_flags(msginfo, mff->account->crosspost_col, 0);
                        }
                        g_hash_table_remove(mff->newsart, key);
@@ -5082,7 +5082,7 @@ static void summary_ignore_thread(SummaryView *summaryview)
        for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
                gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_ignore_thread_func), summaryview);
        }
        for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
                gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_ignore_thread_func), summaryview);
        }
-       folderview_update_items_when_required(FALSE);
+       folder_update_items_when_required(FALSE);
 
        summary_status_show(summaryview);
 }
 
        summary_status_show(summaryview);
 }
@@ -5114,7 +5114,7 @@ static void summary_unignore_thread(SummaryView *summaryview)
        for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
                gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_unignore_thread_func), summaryview);
        }
        for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next) {
                gtk_ctree_pre_recursive(ctree, GTK_CTREE_NODE(cur->data), GTK_CTREE_FUNC(summary_unignore_thread_func), summaryview);
        }
-       folderview_update_items_when_required(FALSE);
+       folder_update_items_when_required(FALSE);
 
        summary_status_show(summaryview);
 }
 
        summary_status_show(summaryview);
 }