#include "addressbook.h"
#include "addr_compl.h"
#include "scoring.h"
+#include "prefs_folder_item.h"
#include "pixmaps/dir-open.xpm"
#include "pixmaps/mark.xpm"
STATUSBAR_POP(summaryview->mainwin);
- is_refresh = (item == summaryview->folder_item) ? TRUE : FALSE;
+ is_refresh = (!prefs_common.open_inbox_on_inc &&
+ item == summaryview->folder_item) ? TRUE : FALSE;
if (is_refresh) {
prev_msgnum = summary_get_current_msgnum(summaryview);
if (prev_msgnum < 1)
return FALSE;
} else
#endif
- summary_write_cache(summaryview);
+ if (!is_refresh)
+ summary_write_cache(summaryview);
gtk_clist_freeze(GTK_CLIST(ctree));
GtkCList *clist = GTK_CLIST(summaryview->ctree);
GtkCListCompareFunc cmp_func;
+ if (!summaryview->folder_item)
+ return;
+
switch (type) {
case SORT_BY_NUMBER:
cmp_func = (GtkCListCompareFunc)summary_cmp_by_num;
{
GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
MsgInfo *msginfo;
+ MsgInfo *parentinfo;
+ MsgInfo *cur_msginfo;
GtkCTreeNode *node, *parent;
gchar *text[N_SUMMARY_COLS];
GHashTable *msgid_table;
+ GSList * cur;
+ GtkCTreeNode *cur_parent;
if (!mlist) return;
if (prefs_common.use_addr_book)
start_address_completion();
+
+ main_window_set_thread_option(summaryview->mainwin);
- if (prefs_common.enable_thread) {
+ for (cur = mlist ; cur != NULL; cur = cur->next) {
+ msginfo = (MsgInfo *)cur->data;
+ msginfo->threadscore = msginfo->score;
+ }
+
+ /* if (prefs_common.enable_thread) { */
+ if (summaryview->folder_item->prefs->enable_thread) {
for (; mlist != NULL; mlist = mlist->next) {
msginfo = (MsgInfo *)mlist->data;
parent = NULL;
- summary_set_header(text, msginfo);
-
/* search parent node for threading */
- if (msginfo->inreplyto && *msginfo->inreplyto)
+ if (msginfo->inreplyto && *msginfo->inreplyto) {
parent = g_hash_table_lookup
(msgid_table, msginfo->inreplyto);
+ }
+
+ summary_set_header(text, msginfo);
node = gtk_ctree_insert_node
(ctree, parent, NULL, text, 2,
== NULL)
g_hash_table_insert(msgid_table,
msginfo->msgid, node);
+
+ cur_parent = parent;
+ cur_msginfo = msginfo;
+ while (cur_parent != NULL) {
+ parentinfo = gtk_ctree_node_get_row_data(ctree, cur_parent);
+
+ if (!parentinfo)
+ break;
+
+ if (parentinfo->threadscore <
+ cur_msginfo->threadscore) {
+ gchar * s;
+ parentinfo->threadscore =
+ cur_msginfo->threadscore;
+#if 0
+ s = itos(parentinfo->threadscore);
+ gtk_ctree_node_set_text(ctree, cur_parent, S_COL_SCORE, s);
+#endif
+ }
+ else break;
+
+ cur_msginfo = parentinfo;
+ if (cur_msginfo->inreplyto &&
+ *cur_msginfo->inreplyto) {
+ cur_parent = g_hash_table_lookup(msgid_table, cur_msginfo->inreplyto);
+ }
+ }
}
/* complete the thread */
text[S_COL_MIME] = NULL;
text[S_COL_NUMBER] = itos_buf(col_number, msginfo->msgnum);
text[S_COL_SIZE] = to_human_readable(msginfo->size);
+#if 0
+ text[S_COL_SCORE] = itos_buf(col_score, msginfo->threadscore);
+#else
text[S_COL_SCORE] = itos_buf(col_score, msginfo->score);
+#endif
if (msginfo->date_t) {
procheader_date_get_localtime(date_modified,
text[S_COL_FROM] = msginfo->fromname ? msginfo->fromname :
_("(No From)");
if (prefs_common.swap_from && msginfo->from && msginfo->to &&
- cur_account && cur_account->address) {
+ cur_account && cur_account->address &&
+ !MSG_IS_NEWS(msginfo->flags)) {
gchar *from;
Xalloca(from, strlen(msginfo->from) + 1, return);
strchr(p + 2, '%')) {
alertpanel_error(_("Print command line is invalid:\n`%s'"),
cmdline);
+ g_free(cmdline);
return;
}
(ctree, GTK_CTREE_NODE(cur->data));
if (msginfo) procmsg_print_message(msginfo, cmdline);
}
+
+ g_free(cmdline);
}
void summary_execute(SummaryView *summaryview)
/* if score are equal, sort by date */
- diff = msginfo1->score - msginfo2->score;
+ diff = msginfo1->threadscore - msginfo2->threadscore;
if (diff != 0)
return diff;
else