aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-07 11:07:16 +0800
committerDan Winship <danw@src.gnome.org>2000-07-07 11:07:16 +0800
commit2fd4f883fac06d433273ed2cef5dd5cb1ffa8abd (patch)
treec88e2b5e06b0e8e2d9975e2043dd6c47879c43f5 /mail/message-list.c
parentd692cab641aa76330247a2991ee8e510fc1bf75d (diff)
downloadgsoc2013-evolution-2fd4f883fac06d433273ed2cef5dd5cb1ffa8abd.tar.gz
gsoc2013-evolution-2fd4f883fac06d433273ed2cef5dd5cb1ffa8abd.tar.zst
gsoc2013-evolution-2fd4f883fac06d433273ed2cef5dd5cb1ffa8abd.zip
Map tree model row numbers to summary row numbers. (ml_tree_value_at,
* message-list.c (get_message_info): Map tree model row numbers to summary row numbers. (ml_tree_value_at, ml_tree_set_value_at, ml_tree_is_cell_editable): So don't do that here. svn path=/trunk/; revision=3938
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index aafdb35d97..edb919ad4f 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -96,9 +96,14 @@ get_message_info(MessageList *message_list, gint row)
}
} else
g_warning ("get_message_info: row %d out of range", row);
- } else {
- if (row<message_list->summary_table->len)
- info = message_list->summary_table->pdata[row];
+ } else if (row < message_list->summary_table->len) {
+ ETreeModel *model = (ETreeModel *)message_list->table_model;
+ ETreePath *node;
+
+ node = e_tree_model_node_at_row (model, row);
+ row = GPOINTER_TO_INT (e_tree_model_node_get_data (model, node));
+
+ info = message_list->summary_table->pdata[row];
}
return info;
@@ -573,8 +578,7 @@ ml_tree_icon_at (ETreeModel *etm, ETreePath *path, void *model_data)
static void *
ml_tree_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data)
{
- /* we just map the node to a row id, and reuse the other value_at */
- int row = (int)e_tree_model_node_get_data (etm, path);
+ int row = e_tree_model_row_of_node (etm, path);
return ml_value_at((ETableModel *)etm, col, row, model_data);
}
@@ -582,7 +586,7 @@ ml_tree_value_at (ETreeModel *etm, ETreePath *path, int col, void *model_data)
static void
ml_tree_set_value_at (ETreeModel *etm, ETreePath *path, int col, const void *val, void *model_data)
{
- int row = (int)e_tree_model_node_get_data (etm, path);
+ int row = e_tree_model_row_of_node (etm, path);
ml_set_value_at((ETableModel *)etm, col, row, val, model_data);
}
@@ -590,7 +594,7 @@ ml_tree_set_value_at (ETreeModel *etm, ETreePath *path, int col, const void *val
static gboolean
ml_tree_is_cell_editable (ETreeModel *etm, ETreePath *path, int col, void *model_data)
{
- int row = (int)e_tree_model_node_get_data (etm, path);
+ int row = e_tree_model_row_of_node (etm, path);
return ml_is_cell_editable((ETableModel *)etm, col, row, model_data);
}