#include "utils.h"
#include "xml.h"
#include "codeconv.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
#include "account.h"
#include "filtering.h"
#include "scoring.h"
#include "prefs_folder_item.h"
#include "procheader.h"
-#include "statusbar.h"
+#include "hooks.h"
+#include "log.h"
/* Dependecies to be removed ?! */
#include "prefs_common.h"
unreadcnt++;
if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
unreadmarkedcnt++;
+ if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
+ procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
procmsg_msginfo_free(newmsginfo);
}
unreadcnt++;
if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
unreadmarkedcnt++;
+ if (procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD))
+ procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
}
totalcnt++;
procmsg_msginfo_free(msginfo);
unreadcnt++;
if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
unreadmarkedcnt++;
+ if (procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD))
+ procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
totalcnt++;
procmsg_msginfo_free(msginfo);
}
unreadcnt++;
if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
unreadmarkedcnt++;
+ if (procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD))
+ procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
totalcnt++;
procmsg_msginfo_free(msginfo);
debug_print("Added newly found message %d to cache.\n", num);
dest->unread++;
if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
dest->unreadmarked++;
+ 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;
MsgInfo * msginfo;
cnt++;
if (cnt%500)
- statusbar_print_all(_("Moving %s to %s (%d%%)..."), src->name,
+ log_message(_("Moving %s to %s (%d%%)...\n"), src->name,
new_item->path,
100*cnt/g_slist_length(mlist));
msginfo = (MsgInfo *) cur->data;
folder_item_move_msg(new_item, msginfo);
- if (cnt%500)
- statusbar_pop_all();
procmsg_msginfo_free(msginfo);
}
gint folder_item_move_to(FolderItem *src, FolderItem *dest, FolderItem **new_item)
{
FolderItem *tmp = dest->parent;
- char * src_identifier, * dst_identifier, * new_identifier;
- char * phys_srcpath, * phys_dstpath;
+ gchar * src_identifier, * dst_identifier;
+ gchar * phys_srcpath, * phys_dstpath;
GNode *src_node;
while (tmp) {
dest->unread++;
if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
dest->unreadmarked++;
+ 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;
dest->unread++;
if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
dest->unreadmarked++;
+ 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;
dest->unread++;
if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
dest->unreadmarked++;
+ 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;
dest->unread++;
if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
dest->unreadmarked++;
+ 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;
sort_key = SORT_BY_UNREAD;
else if (!strcmp(attr->value, "mime"))
sort_key = SORT_BY_MIME;
+ else if (!strcmp(attr->value, "to"))
+ sort_key = SORT_BY_TO;
else if (!strcmp(attr->value, "locked"))
sort_key = SORT_BY_LOCKED;
} else if (!strcmp(attr->name, "sort_type")) {
"draft", "queue", "trash"};
static gchar *sort_key_str[] = {"none", "number", "size", "date",
"from", "subject", "score", "label",
- "mark", "unread", "mime", "locked" };
+ "mark", "unread", "mime", "to",
+ "locked"};
g_return_if_fail(node != NULL);
g_return_if_fail(fp != NULL);
/*
* Callback handling for FolderItem content changes
*/
-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);
+ FolderItemUpdateData source;
+
+ source.item = item;
+ source.content_change = contentchange;
+ hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
}
static void folder_update_item_func(FolderItem *item, gpointer contentchange)
{
+ FolderItemUpdateData source;
+
if (item->need_update) {
- folder_item_update_callback_execute(item, GPOINTER_TO_INT(contentchange));
+ source.item = item;
+ source.content_change = GPOINTER_TO_INT(contentchange);
+ hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
+
item->need_update = FALSE;
}
}
void folder_update_item_recursive(FolderItem *item, gboolean update_summary)
{
GNode *node = item->folder->node;
+ FolderItemUpdateData source;
+
node = g_node_find(node, G_PRE_ORDER, G_TRAVERSE_ALL, item);
node = node->children;
- folder_item_update_callback_execute(item, update_summary);
+
+ source.item = item;
+ source.content_change = update_summary;
+ hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
while (node != NULL) {
if (node && node->data) {
FolderItem *next_item = (FolderItem*) node->data;
- folder_item_update_callback_execute(next_item, update_summary);
+
+ source.item = next_item;
+ source.content_change = update_summary;
+ hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
}
node = node->next;
}