From f38d9ebb38620d1085951c2827d0d4b4c9d34bc6 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Fri, 28 Jul 2017 23:29:11 +0200 Subject: Gtk: Fix bug when removing the first row in listmodel --- src/gui_gtk.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui_gtk.cc') diff --git a/src/gui_gtk.cc b/src/gui_gtk.cc index 12972cf..2a37306 100644 --- a/src/gui_gtk.cc +++ b/src/gui_gtk.cc @@ -382,8 +382,8 @@ void ListModelListener::rows_removed(GuiListModel*, size_t first, size_t last) { auto path = gtk_tree_path_new(); auto tree_model = GTK_TREE_MODEL(model_); - for (size_t row = last; row >= first; --row) { - gtk_tree_path_append_index(path, row); + for (size_t row = last + 1; row > first; --row) { + gtk_tree_path_append_index(path, row - 1); gtk_tree_model_row_deleted(tree_model, path); gtk_tree_path_up(path); } -- cgit v1.2.3-70-g09d2