-2003-01-06 [Ivan Francolin Martinez (ivanfm@users.sourceforge.net)] 0.8.8claws62
+2003-01-07 [christoph] 0.8.8claws63
+
+ * src/compose.c
+ * src/folder.[ch]
+ * src/folderview.c
+ * 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
+ * src/toolbar.c
+ o remove all folder update triggering from the UI code. The folder
+ system should know much better when a folder needs an update.
+ o to prevent multiple updates in a row the folder updates can be
+ frozen for some time.
+
+ Note: - Please verify that no updates are missing
+ - Check where freeze/thaws should be added
+
+2003-01-07 [Ivan Francolin Martinez (ivanfm@users.sourceforge.net)] 0.8.8claws62
* src/prefs_actions.c
don't translate empty strings
MICRO_VERSION=8
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws62
+EXTRA_VERSION=claws63
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
g_free(msgpath);
folder_item_remove_msg(folder, msgnum);
- folder_update_item(folder, TRUE);
return val;
}
} else {
if (compose->mode == COMPOSE_REEDIT) {
compose_remove_reedit_target(compose);
- if (compose->targetinfo)
- folder_update_item
- (compose->targetinfo->folder, TRUE);
}
/* save message to outbox */
if (prefs_common.savemsg) {
if (procmsg_save_to_outbox(outbox, tmp, FALSE) < 0)
alertpanel_error
(_("Can't save the message to Sent."));
- else
- folder_update_item(outbox, TRUE);
}
}
if (procmsg_msg_exist(msginfo)) {
folder_item_remove_msg(drafts, msginfo->msgnum);
- folder_update_item(drafts, TRUE);
}
}
if (compose->mode == COMPOSE_REEDIT) {
compose_remove_reedit_target(compose);
- if (compose->targetinfo &&
- compose->targetinfo->folder != queue)
- folder_update_item
- (compose->targetinfo->folder, TRUE);
}
- folder_update_item(queue, TRUE);
-
if ((msgnum != NULL) && (item != NULL)) {
*msgnum = num;
*item = queue;
if (compose->mode == COMPOSE_REEDIT) {
compose_remove_reedit_target(compose);
- if (compose->targetinfo &&
- compose->targetinfo->folder != draft)
- folder_update_item(compose->targetinfo->folder,
- TRUE);
}
newmsginfo = folder_item_get_msginfo(draft, msgnum);
if (newmsginfo) {
procmsg_msginfo_unset_flags(newmsginfo, ~0, ~0);
procmsg_msginfo_set_flags(newmsginfo, 0, MSG_DRAFT);
- folder_update_item(draft, TRUE);
procmsg_msginfo_free(newmsginfo);
}
folder_item_write_cache(item);
- folder_update_item(item, FALSE);
-
+ folder_item_update(item, F_ITEM_UPDATE_MSGCNT);
}
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, unreadmarkedcnt = 0;
guint cache_max_num, folder_max_num, cache_cur_num, folder_cur_num;
- gboolean contentchange = FALSE;
+ gboolean update_flags = 0;
g_return_val_if_fail(item != NULL, -1);
if (item->path == NULL) return -1;
else
folder_cur_num = G_MAXINT;
- contentchange = TRUE;
-
continue;
}
else
cache_cur_num = G_MAXINT;
- contentchange = TRUE;
+ update_flags |= F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT;
continue;
}
else
folder_cur_num = G_MAXINT;
- contentchange = TRUE;
+ update_flags |= F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT;
continue;
}
procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
totalcnt++;
procmsg_msginfo_free(msginfo);
+
+ update_flags |= F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT;
}
g_slist_free(newmsg_list);
}
procmsg_msginfo_free(msginfo);
debug_print("Added newly found message %d to cache.\n", num);
}
+
+ update_flags |= F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT;
}
}
item->unreadmarked = unreadmarkedcnt;
g_slist_free(new_list);
- folder_update_item(item, contentchange);
+ folder_item_update(item, update_flags);
return 0;
}
if (procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD))
procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
dest->total++;
- dest->need_update = TRUE;
+ folder_item_update(dest, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
msgcache_add_msg(dest->cache, msginfo);
if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
dest->total++;
- dest->need_update = TRUE;
+ folder_item_update(dest, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
procmsg_msginfo_free(newmsginfo);
}
if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
msginfo->folder->unreadmarked--;
msginfo->folder->total--;
- msginfo->folder->need_update = TRUE;
+ folder_item_update(dest, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
}
}
if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
dest->total++;
- dest->need_update = TRUE;
+ folder_item_update(dest, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
procmsg_msginfo_free(newmsginfo);
}
if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
msginfo->folder->unreadmarked--;
msginfo->folder->total--;
- msginfo->folder->need_update = TRUE;
+ folder_item_update(dest, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
}
l2 = g_slist_next(l2);
if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
dest->total++;
- dest->need_update = TRUE;
+ folder_item_update(dest, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
procmsg_msginfo_free(newmsginfo);
}
if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
dest->total++;
- dest->need_update = TRUE;
+ folder_item_update(dest, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
procmsg_msginfo_free(newmsginfo);
}
msgcache_remove_msg(item->cache, num);
}
item->total--;
- item->need_update = TRUE;
+ folder_item_update(item, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
return ret;
}
item->unread = 0;
item->unreadmarked = 0;
item->total = 0;
- item->need_update = TRUE;
+ folder_item_update(item, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
}
return result;
if (g_node_depth(node) > 0) {
if (fitem->op_count > 0) {
fitem->op_count = 0;
- folder_update_item(fitem, FALSE);
+ folder_item_update(fitem, F_ITEM_UPDATE_MSGCNT);
}
if (node->children) {
GNode *child;
if (processing_list == NULL)
return;
+ folder_item_update_freeze();
+
mlist = folder_item_get_msg_list(item);
-
for (cur = mlist ; cur != NULL ; cur = cur->next) {
MsgInfo * msginfo;
filter_message_by_msginfo(processing_list, msginfo);
procmsg_msginfo_free(msginfo);
}
-
- folder_update_items_when_required(FALSE);
-
g_slist_free(mlist);
+
+ folder_item_update_thaw();
}
/*
- * Callback handling for FolderItem content changes
+ * functions for handling FolderItem content changes
*/
-void folder_update_item(FolderItem *item, gboolean contentchange)
-{
- FolderItemUpdateData source;
-
- source.item = item;
- source.content_change = contentchange;
- hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
-}
+static gint folder_item_update_freeze_cnt = 0;
-static void folder_update_item_func(FolderItem *item, gpointer contentchange)
+/**
+ * Notify the folder system about changes to a folder. If the
+ * update system is not frozen the FOLDER_ITEM_UPDATE_HOOKLIST will
+ * be invoked, otherwise the changes will be remebered until
+ * the folder system is thawed.
+ *
+ * \param item The FolderItem that was changed
+ * \param update_flags Type of changed that was made
+ */
+void folder_item_update(FolderItem *item, FolderItemUpdateFlags update_flags)
{
- FolderItemUpdateData source;
-
- if (item->need_update) {
+ if (folder_item_update_freeze_cnt == 0) {
+ FolderItemUpdateData source;
+
source.item = item;
- source.content_change = GPOINTER_TO_INT(contentchange);
- hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
-
- item->need_update = FALSE;
+ source.update_flags = update_flags;
+ hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
+ } else {
+ item->update_flags |= update_flags;
}
}
-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)
+void folder_item_update_recursive(FolderItem *item, FolderItemUpdateFlags update_flags)
{
GNode *node = item->folder->node;
- FolderItemUpdateData source;
node = g_node_find(node, G_PRE_ORDER, G_TRAVERSE_ALL, item);
node = node->children;
- source.item = item;
- source.content_change = update_summary;
- hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
+ folder_item_update(item, update_flags);
while (node != NULL) {
if (node && node->data) {
FolderItem *next_item = (FolderItem*) node->data;
- source.item = next_item;
- source.content_change = update_summary;
- hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
+ folder_item_update(next_item, update_flags);
}
node = node->next;
}
}
+void folder_item_update_freeze()
+{
+ folder_item_update_freeze_cnt++;
+}
+
+static void folder_item_update_func(FolderItem *item, gpointer data)
+{
+ FolderItemUpdateData source;
+
+ if (item->update_flags) {
+ source.item = item;
+ source.update_flags = item->update_flags;
+ hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
+ item->update_flags = 0;
+ }
+}
+
+void folder_item_update_thaw()
+{
+ if (folder_item_update_freeze_cnt > 0)
+ folder_item_update_freeze_cnt--;
+ if (folder_item_update_freeze_cnt == 0) {
+ /* Update all folders */
+ folder_func_to_all_folders(folder_item_update_func, NULL);
+ }
+}
+
#undef PUT_ESCAPE_STR
F_MOVE_FAILED
} FolderMoveStatus;
+typedef enum
+{
+ F_ITEM_UPDATE_MSGCNT = 1 << 0,
+ F_ITEM_UPDATE_CONTENT = 1 << 1,
+} FolderItemUpdateFlags;
+
typedef void (*FolderUIFunc) (Folder *folder,
FolderItem *item,
gpointer data);
guint ret_rcpt : 1; /* return receipt */
gint op_count;
- guint opened : 1; /* opened by summary view */
- guint need_update : 1; /* folderview for this folder should be updated */
+ guint opened : 1; /* opened by summary view */
+ FolderItemUpdateFlags update_flags; /* folderview for this folder should be updated */
FolderSortKey sort_key;
FolderSortType sort_type;
struct _FolderItemUpdateData
{
- FolderItem *item;
- gboolean content_change;
+ FolderItem *item;
+ FolderItemUpdateFlags update_flags;
};
Folder *folder_new (FolderType type,
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);
+void folder_item_update (FolderItem *item,
+ FolderItemUpdateFlags update_flags);
+void folder_item_update_recursive (FolderItem *item,
+ FolderItemUpdateFlags update_flags);
+void folder_item_update_freeze ();
+void folder_item_update_thaw ();
#endif /* __FOLDER_H__ */
gtk_ctree_node_set_row_style(ctree, node, style);
- item->need_update = FALSE;
-
if ((node = gtkut_ctree_find_collapsed_parent(ctree, node)) != NULL)
folderview_update_node(folderview, node);
}
node = gtk_ctree_find_by_row_data(ctree, NULL, update_info->item);
if (node) {
- folderview_update_node(folderview, node);
- if (update_info->content_change && folderview->opened == node)
+ if (update_info->update_flags & F_ITEM_UPDATE_MSGCNT)
+ folderview_update_node(folderview, node);
+ if ((update_info->update_flags & F_ITEM_UPDATE_CONTENT) && (folderview->opened == node))
summary_show(folderview->summaryview, update_info->item);
}
folderview_check_new(item->folder);
else
folderview_rescan_tree(item->folder);
-
- if (folderview->opened) {
- item = gtk_ctree_node_get_row_data(ctree, folderview->opened);
- if (item)
- folder_update_item(item, TRUE);
- }
}
void folderview_create_folder_node_recursive(FolderView *folderview, FolderItem *item)
debug_print("can't remove src node: is null\n");
folderview_create_folder_node_recursive(folderview, new_folder);
- folder_update_item(from_parent, TRUE);
- folder_update_item_recursive(new_folder, TRUE);
folderview_sort_folders(folderview,
gtk_ctree_find_by_row_data(GTK_CTREE(folderview->ctree),
NULL, new_folder->parent), new_folder->folder);
g_warning("Can't find the folder.\n");
} else {
ok = proc_mbox(dest, filename);
- folder_update_item(dest, TRUE);
}
}
}
folderview_unselect(mainwin->folderview);
folderview_select(mainwin->folderview, item);
}
- } else if (prefs_common.scan_all_after_inc) {
- item = mainwin->summaryview->folder_item;
- if (FOLDER_SUMMARY_MISMATCH(item, mainwin->summaryview)) {
- folder_update_item(item, TRUE);
- }
}
}
case A_IMAP4:
case A_NNTP:
folderview_check_new(FOLDER(account->folder));
- if (!prefs_common.scan_all_after_inc && item != NULL &&
- FOLDER(account->folder) == item->folder)
- folder_update_item(item, TRUE);
return 1;
case A_POP3:
FolderItem *item = mainwin->summaryview->folder_item;
folderview_check_new(FOLDER(account->folder));
- if (!prefs_common.scan_all_after_inc && item != NULL &&
- FOLDER(account->folder) == item->folder)
- folder_update_item(item, TRUE);
}
}
new_msgs += pop3_state->cur_total_num;
- if (!prefs_common.scan_all_after_inc) {
- folder_update_items_when_required
- (!prefs_common.open_inbox_on_inc);
- }
-
if (pop3_state->error_val == PS_AUTHFAIL &&
pop3_state->ac_prefs->tmp_pass) {
g_free(pop3_state->ac_prefs->tmp_pass);
if (msgs >= 0) empty_mbox(mbox);
unlock_mbox(mbox, lockfd, LOCK_FLOCK);
- if (!prefs_common.scan_all_after_inc) {
- folder_update_items_when_required
- (!prefs_common.open_inbox_on_inc);
- } else if (!prefs_common.scan_all_after_inc) {
- folder_update_item(dest, TRUE);
- }
-
return msgs;
}
alertpanel_error(_("Some errors occurred while sending queued messages."));
folder_item_scan(folder->queue);
if (prefs_common.savemsg && folder->outbox) {
- folder_update_item(folder->outbox, TRUE);
if (folder->outbox == def_outbox)
def_outbox = NULL;
}
}
}
-
- if (prefs_common.savemsg && def_outbox)
- folder_update_item(def_outbox, TRUE);
}
procmsg_empty_trash();
- for (list = folder_get_list(); list != NULL; list = list->next) {
- folder = list->data;
- if (folder && folder->trash) {
- folder_update_item(folder->trash, TRUE);
- }
- }
-
if (mainwin->summaryview->folder_item &&
mainwin->summaryview->folder_item->stype == F_TRASH)
gtk_widget_grab_focus(mainwin->folderview->ctree);
}
g_free(tmp);
- folder_update_item(queue, TRUE);
-
return 0;
}
prefs->color = dialog->item->prefs->color;
/* update folder view */
if (prefs->color > 0)
- folder_update_item(dialog->item, FALSE);
+ folder_item_update(dialog->item, F_ITEM_UPDATE_MSGCNT);
prefs_folder_item_save_config(dialog->item);
prefs_folder_item_destroy(dialog);
procmsg_msginfo_free(msginfo);
}
- folder_update_item(queue, FALSE);
-
return ret;
}
procmsg_msginfo_unset_flags(msginfo, ~0, 0);
procmsg_msginfo_free(msginfo);
}
- folder_update_item(outbox, TRUE);
+ folder_item_update(outbox, TRUE);
return 0;
}
if ((perm_flags & MSG_NEW) && !MSG_IS_NEW(msginfo->flags) &&
!MSG_IS_IGNORE_THREAD(msginfo->flags)) {
item->new++;
- item->need_update = TRUE;
}
/* if unread flag is set */
if ((perm_flags & MSG_UNREAD) && !MSG_IS_UNREAD(msginfo->flags) &&
!MSG_IS_IGNORE_THREAD(msginfo->flags)) {
item->unread++;
- item->need_update = TRUE;
}
if (!MSG_IS_UNREAD(msginfo->flags) &&(perm_flags & MSG_UNREAD)
&& procmsg_msg_has_marked_parent(msginfo)) {
item->unreadmarked++;
- item->need_update = TRUE;
}
if (!MSG_IS_MARKED(msginfo->flags) && (perm_flags & MSG_MARKED)) {
if ((perm_flags & MSG_IGNORE_THREAD) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) {
if (MSG_IS_NEW(msginfo->flags) || (perm_flags & MSG_NEW)) {
item->new--;
- item->need_update = TRUE;
}
if (MSG_IS_UNREAD(msginfo->flags) || (perm_flags & MSG_UNREAD)) {
item->unread--;
- item->need_update = TRUE;
}
if ((perm_flags & MSG_UNREAD) || (MSG_IS_UNREAD(msginfo->flags)
&& procmsg_msg_has_marked_parent(msginfo))) {
item->unreadmarked--;
- item->need_update = TRUE;
}
if ((perm_flags & MSG_MARKED) || (MSG_IS_MARKED(msginfo->flags)
&& !MSG_IS_IGNORE_THREAD(msginfo->flags))) {
msginfo_update.msginfo = msginfo;
hooks_invoke(MSGINFO_UPDATE_HOOKLIST, &msginfo_update);
+ folder_item_update(msginfo->folder, F_ITEM_UPDATE_MSGCNT);
CHANGE_FLAGS(msginfo);
procmsg_msginfo_write_flags(msginfo);
if ((perm_flags & MSG_NEW) && MSG_IS_NEW(msginfo->flags) &&
!MSG_IS_IGNORE_THREAD(msginfo->flags)) {
item->new--;
- item->need_update = TRUE;
}
/* if unread flag is unset */
if ((perm_flags & MSG_UNREAD) && MSG_IS_UNREAD(msginfo->flags) &&
!MSG_IS_IGNORE_THREAD(msginfo->flags)) {
item->unread--;
- item->need_update = TRUE;
}
if (MSG_IS_UNREAD(msginfo->flags) && (perm_flags & MSG_UNREAD)
&& !MSG_IS_IGNORE_THREAD(msginfo->flags)
&& procmsg_msg_has_marked_parent(msginfo)) {
item->unreadmarked--;
- item->need_update = TRUE;
}
if (MSG_IS_MARKED(msginfo->flags) && (perm_flags & MSG_MARKED)
if ((perm_flags & MSG_IGNORE_THREAD) && MSG_IS_IGNORE_THREAD(msginfo->flags)) {
if (MSG_IS_NEW(msginfo->flags) && !(perm_flags & MSG_NEW)) {
item->new++;
- item->need_update = TRUE;
}
if (MSG_IS_UNREAD(msginfo->flags) && !(perm_flags & MSG_UNREAD)) {
item->unread++;
- item->need_update = TRUE;
}
if (MSG_IS_UNREAD(msginfo->flags) && !(perm_flags & MSG_UNREAD)
&& procmsg_msg_has_marked_parent(msginfo)) {
item->unreadmarked++;
- item->need_update = TRUE;
}
if (MSG_IS_MARKED(msginfo->flags) && !(perm_flags & MSG_MARKED)) {
procmsg_update_unread_children(msginfo, TRUE);
msginfo_update.msginfo = msginfo;
hooks_invoke(MSGINFO_UPDATE_HOOKLIST, &msginfo_update);
+ folder_item_update(msginfo->folder, F_ITEM_UPDATE_MSGCNT);
CHANGE_FLAGS(msginfo);
procmsg_msginfo_write_flags(msginfo);
return children;
}
-static void procmsg_update_unread_children (MsgInfo *info, gboolean newly_marked)
+static void procmsg_update_unread_children(MsgInfo *info, gboolean newly_marked)
{
GSList *children = procmsg_find_children(info);
GSList *cur;
info->folder->unreadmarked++;
else
info->folder->unreadmarked--;
- info->folder->need_update = TRUE;
+ folder_item_update(info->folder, F_ITEM_UPDATE_MSGCNT);
}
procmsg_msginfo_free(tmp);
}
g_node_destroy(root);
- folder_update_items_when_required(FALSE);
-
summary_thread_init(summaryview);
} else {
gchar *text[N_SUMMARY_COLS];
if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
procmsg_msginfo_unset_flags
(msginfo, MSG_NEW | MSG_UNREAD, 0);
- folder_update_item(msginfo->folder, FALSE);
summary_set_row_marks(summaryview, row);
gtk_clist_thaw(GTK_CLIST(ctree));
summary_status_show(summaryview);
changed = TRUE;
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
if (MSG_IS_COPY(msginfo->flags)) {
summaryview->copied--;
changed = TRUE;
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
changed |= summary_update_unread_children (summaryview, msginfo, TRUE);
if (changed && !prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
summary_mark_row_as_read(summaryview,
GTK_CTREE_NODE(cur->data));
- folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
summary_set_row_marks(summaryview, node);
}
gtk_clist_thaw(clist);
- folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
for (cur = GTK_CLIST(ctree)->selection; cur != NULL; cur = cur->next)
summary_mark_row_as_unread(summaryview,
GTK_CTREE_NODE(cur->data));
- folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
changed = TRUE;
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
if (MSG_IS_COPY(msginfo->flags)) {
summaryview->copied--;
changed = TRUE;
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
changed |= summary_update_unread_children (summaryview, msginfo, FALSE);
if (!prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
summaryview->moved--;
changed = TRUE;
if (!prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
summaryview->copied--;
changed = TRUE;
if (!prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0) {
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
changed = TRUE;
}
}
if (changed) {
msginfo->to_folder->op_count++;
if (msginfo->to_folder->op_count == 1)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
}
summary_execute(summaryview);
else {
summary_status_show(summaryview);
-
- folder_update_item(to_folder, FALSE);
}
if (!summaryview->selected) { /* this was the last message */
if (!prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0) {
- folder_update_item(msginfo->to_folder, FALSE);
changed = TRUE;
}
}
if (changed) {
msginfo->to_folder->op_count++;
if (msginfo->to_folder->op_count == 1)
- folder_update_item(msginfo->to_folder, FALSE);
+ folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);
}
}
summary_execute(summaryview);
else {
summary_status_show(summaryview);
-
- folder_update_item(to_folder, FALSE);
}
}
if (summaryview->mlist) {
procmsg_move_messages(summaryview->mlist);
- folder_update_items_when_required(FALSE);
-
for (cur = summaryview->mlist; cur != NULL; cur = cur->next)
procmsg_msginfo_free((MsgInfo *)cur->data);
g_slist_free(summaryview->mlist);
summaryview->mlist = NULL;
}
-
- folder_update_item(summaryview->folder_item, FALSE);
}
static void summary_execute_move_func(GtkCTree *ctree, GtkCTreeNode *node,
if (summaryview->mlist) {
procmsg_copy_messages(summaryview->mlist);
- folder_update_items_when_required(FALSE);
-
g_slist_free(summaryview->mlist);
summaryview->mlist = NULL;
}
g_slist_free(summaryview->mlist);
summaryview->mlist = NULL;
-
- if ((summaryview->folder_item != trash) && (trash != NULL)) {
- folder_update_item(trash, FALSE);
- }
- folder_update_item(summaryview->folder_item, FALSE);
}
static void summary_execute_delete_func(GtkCTree *ctree, GtkCTreeNode *node,
summaryview);
gtk_clist_thaw(GTK_CLIST(summaryview->ctree));
-
- folder_update_items_when_required(FALSE);
}
debug_print("done.\n");
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);
- folder_update_item(msginfo->folder, FALSE);
procmsg_msginfo_set_flags(msginfo, mff->account->crosspost_col, 0);
}
g_hash_table_remove(mff->newsart, key);
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);
}
- folder_update_items_when_required(FALSE);
summary_status_show(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);
}
- folder_update_items_when_required(FALSE);
summary_status_show(summaryview);
}
(folder->queue, prefs_common.savemsg) < 0)
alertpanel_error(_("Some errors occurred while sending queued messages."));
folder_item_scan(folder->queue);
- folder_update_item(folder->queue, TRUE);
}
}
}