From 4f922f70aadeec22caa03f32d7e43ec82c1c39cd Mon Sep 17 00:00:00 2001 From: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com> Date: Thu, 27 Oct 2016 13:24:31 -0400 Subject: [PATCH] GtkQTreeModel: insert all children on rowsInserted In the case of a QSortFilterProxy model, when rows which were previously filtered are re-inserted, no rowsInserted signal is emitted on their children. To handle this case, we need to explicitly re-insert any children. Change-Id: If46288356a8697477643671d142fe846aa656ae1 Tuleap: #651 --- src/models/gtkqtreemodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/models/gtkqtreemodel.cpp b/src/models/gtkqtreemodel.cpp index d00d9201..9ce73568 100644 --- a/src/models/gtkqtreemodel.cpp +++ b/src/models/gtkqtreemodel.cpp @@ -345,6 +345,11 @@ gtk_q_tree_model_new(QAbstractItemModel *model, size_t n_columns, ...) GtkTreePath *path = gtk_q_tree_model_get_path(GTK_TREE_MODEL(retval), &iter); gtk_tree_model_row_inserted(GTK_TREE_MODEL(retval), path, &iter); gtk_tree_path_free(path); + + // in certain cases (eg: proxy models), its possible for rows to be inserted that + // already have children; however no rowsInserted will be emitted for the children, + // in these cases we check for the existence of chilren and insert them + insert_children(idx, retval); } } ); -- GitLab