[gtranslator] Fix message edition on the GtrMessageTable
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator] Fix message edition on the GtrMessageTable
- Date: Sun, 22 Apr 2012 20:58:58 +0000 (UTC)
commit 85ece4430af4d41d5ed9303d6349c98bb8b8d9dd
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Apr 22 22:57:07 2012 +0200
Fix message edition on the GtrMessageTable
Fetch correctly the corresponding GtkTreeIter/Path for the
given GtrMsg
src/gtr-message-table.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
---
diff --git a/src/gtr-message-table.c b/src/gtr-message-table.c
index 2db67e6..7448733 100644
--- a/src/gtr-message-table.c
+++ b/src/gtr-message-table.c
@@ -114,18 +114,17 @@ gtr_message_table_selection_changed (GtkTreeSelection *selection,
static void
message_changed_cb (GtrTab * tab, GtrMsg * msg, GtrMessageTable * table)
{
- GtkTreePath *sort_path, *path;
- GtkTreeRowReference *row;
-
- row = _gtr_msg_get_row_reference (msg);
- sort_path = gtk_tree_row_reference_get_path (row);
+ GtkTreePath *path;
+ GtkTreeIter iter;
- path =
- gtk_tree_model_sort_convert_path_to_child_path (GTK_TREE_MODEL_SORT
- (table->priv->sort_model),
- sort_path);
+ if (!gtr_message_table_get_message_iter (GTR_MESSAGE_TABLE_MODEL (table->priv->store),
+ msg, &iter))
+ return;
- gtr_message_table_model_update_row (table->priv->store, path);
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (table->priv->store), &iter);
+ gtr_message_table_model_update_row (GTR_MESSAGE_TABLE_MODEL (table->priv->store),
+ path);
+ gtk_tree_path_free (path);
}
static gint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]