[balsa/gtk3] Get index entry by message number



commit d28ad8a95ae96f4d8117df6bf1fdc09957289757
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Jun 19 10:07:09 2012 -0400

    Get index entry by message number
    
    	* libbalsa/mailbox.c (lbm_node_has_unseen_child),
    	(lbm_get_index_entry), (mbox_model_get_value): get index entry
    	by message number instead of by GNode.

 ChangeLog          |    6 ++++++
 libbalsa/mailbox.c |    9 ++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7070145..def80e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-19  Peter Bloomfield
+
+	* libbalsa/mailbox.c (lbm_node_has_unseen_child),
+	(lbm_get_index_entry), (mbox_model_get_value): get index entry
+	by message number instead of by GNode.
+
 2012-06-13  Peter Bloomfield
 
 	* libbalsa/mailbox.c (lbm_msgno_inserted_idle_cb): lock mutex
diff --git a/libbalsa/mailbox.c b/libbalsa/mailbox.c
index 2d936bd..859cbd7 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -1167,7 +1167,7 @@ libbalsa_mailbox_type_from_path(const gchar * path)
  */
 
 static LibBalsaMailboxIndexEntry *lbm_get_index_entry(LibBalsaMailbox *
-						      lmm, GNode * node);
+						      lmm, guint msgno);
 /* Does the node (non-NULL) have unseen children? */
 static gboolean
 lbm_node_has_unseen_child(LibBalsaMailbox * lmm, GNode * node)
@@ -1175,7 +1175,7 @@ lbm_node_has_unseen_child(LibBalsaMailbox * lmm, GNode * node)
     for (node = node->children; node; node = node->next) {
 	LibBalsaMailboxIndexEntry *entry =
 	    /* g_ptr_array_index(lmm->mindex, msgno - 1); ?? */
-	    lbm_get_index_entry(lmm, node);
+	    lbm_get_index_entry(lmm, GPOINTER_TO_UINT(node->data));
 	if ((entry && entry->unseen) || lbm_node_has_unseen_child(lmm, node))
 	    return TRUE;
     }
@@ -3161,9 +3161,8 @@ lbm_get_index_entry_real(LibBalsaMailbox * mailbox)
 #endif                          /*BALSA_USE_THREADS */
 
 static LibBalsaMailboxIndexEntry *
-lbm_get_index_entry(LibBalsaMailbox * lmm, GNode * node)
+lbm_get_index_entry(LibBalsaMailbox * lmm, guint msgno)
 {
-    guint msgno = GPOINTER_TO_UINT(node->data);
     LibBalsaMailboxIndexEntry *entry;
 
     if (!lmm->mindex)
@@ -3239,7 +3238,7 @@ mbox_model_get_value(GtkTreeModel *tree_model,
         return;
     }
     g_return_if_fail(msgno<=libbalsa_mailbox_total_messages(lmm));
-    msg = lbm_get_index_entry(lmm, (GNode *) iter->user_data);
+    msg = lbm_get_index_entry(lmm, msgno);
     switch(column) {
         /* case LB_MBOX_MSGNO_COL: handled above */
     case LB_MBOX_MARKED_COL:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]