From 73aa3d5158bd806b249e6724e2b2c87d88fd62fb Mon Sep 17 00:00:00 2001 From: "mattm@chromium.org" Date: Wed, 24 Jun 2009 02:48:11 +0000 Subject: Fix Gtk TableModel adapters always appending or prepending. TEST=Open bookmark manager, drag bookmarks around. Review URL: http://codereview.chromium.org/147059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19096 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/bookmark_manager_gtk.cc | 8 ++++---- chrome/browser/gtk/options/url_picker_dialog_gtk.cc | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc index d35b586..66ddf38 100644 --- a/chrome/browser/gtk/bookmark_manager_gtk.cc +++ b/chrome/browser/gtk/bookmark_manager_gtk.cc @@ -618,12 +618,12 @@ void BookmarkManagerGtk::SetRightSideColumnValues(int row, GtkTreeIter* iter) { void BookmarkManagerGtk::AddNodeToRightStore(int row) { GtkTreeIter iter; if (row == 0) { - gtk_tree_model_get_iter_first(GTK_TREE_MODEL(right_store_), &iter); gtk_list_store_prepend(right_store_, &iter); } else { - gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(right_store_), &iter, NULL, - row - 1); - gtk_list_store_append(right_store_, &iter); + GtkTreeIter sibling; + gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(right_store_), &sibling, + NULL, row - 1); + gtk_list_store_insert_after(right_store_, &iter, &sibling); } SetRightSideColumnValues(row, &iter); diff --git a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc index 71091c0..7042853 100644 --- a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc +++ b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc @@ -236,12 +236,12 @@ void UrlPickerDialogGtk::SetColumnValues(int row, GtkTreeIter* iter) { void UrlPickerDialogGtk::AddNodeToList(int row) { GtkTreeIter iter; if (row == 0) { - gtk_tree_model_get_iter_first(GTK_TREE_MODEL(history_list_store_), &iter); gtk_list_store_prepend(history_list_store_, &iter); } else { - gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(history_list_store_), &iter, + GtkTreeIter sibling; + gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(history_list_store_), &sibling, NULL, row - 1); - gtk_list_store_append(history_list_store_, &iter); + gtk_list_store_insert_after(history_list_store_, &iter, &sibling); } SetColumnValues(row, &iter); -- cgit v1.1