2010-05-26 [holger] 3.7.6cvs9
[claws.git] / src / summaryview.c
index 0f98e62384103d6f3a1ebee7203ff40d2b3c5ffe..a6edba4493fe0a7d76555947dca2881d479e5aa1 100644 (file)
@@ -2056,6 +2056,30 @@ void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
        summary_select_node(summaryview, node, FALSE, TRUE);
 }
 
+void summary_select_by_msg_list(SummaryView    *summaryview, GSList *msginfos)
+{
+       GtkCMCTree *ctree;
+       GSList *msgnum_list, *walk;
+       gboolean froze = FALSE;
+
+       ctree = GTK_CMCTREE(summaryview->ctree);
+
+       msgnum_list = NULL;
+       for(walk = msginfos; walk; walk = walk->next) {
+               MsgInfo *msginfo;
+               msginfo = walk->data;
+               msgnum_list = g_slist_prepend(msgnum_list, GUINT_TO_POINTER(msginfo->msgnum));
+       }
+       START_LONG_OPERATION(summaryview, FALSE);
+       for(walk = msgnum_list; walk; walk = walk->next) {
+               GtkCMCTreeNode *node;
+               node = summary_find_msg_by_msgnum(summaryview, GPOINTER_TO_UINT(walk->data));
+               gtk_cmctree_select(ctree, node);
+       }
+       END_LONG_OPERATION(summaryview);
+       g_slist_free(msgnum_list);
+}
+
 typedef struct _PostponedSelectData
 {
        GtkCMCTree *ctree;