From 4bdd811f06096c2420a05dd3cc78fffbd7f3a663 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 29 Jul 2018 17:40:53 +0200 Subject: Cleanup: remove DiveListView::fixMessyQtModelBehaviour() The function DiveListView::fixMessyQtModelBehaviour() was used to expand the first columns of dive-trips in the dive-list view. This function was called everytime that the dive-list was modified. It is kind of ludicrous that external callers would have to tell the DiveListView, when it has to update its column headers. Instead, place this functionality in the overriden reset() and rowsInserted() functions, as these are the only ways that rows can be added. Change the DiveTripModel to use the proper beginResetModel()/endResetModel() pair instead of the previous full deletion and full repopulation using the beginRemoveRows()/ endRemoveRows() and beginInsertRows()/endInsertRows(). Signed-off-by: Berthold Stoeger --- qt-models/filtermodels.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'qt-models/filtermodels.cpp') diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index 34345f381..12d755dc1 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -430,7 +430,6 @@ void MultiFilterSortModel::myInvalidate() divesDisplayed = 0; invalidateFilter(); - MainWindow::instance()->dive_list()->fixMessyQtModelBehaviour(); // first make sure the trips are no longer shown as selected // (but without updating the selection state of the dives... this just cleans -- cgit v1.2.3-70-g09d2