From 43390d4a9aa1a6c78e36ae2dd32e8421f9060c92 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 20 Sep 2020 13:40:21 +0200 Subject: dive list: on reload update filter status At some time, when introducing the global reset signal the filter stopped being reloaded when loading a new log. This leads to very strange UI behavior: dives disappear when editing fields unrelated to the filter. Therefore, when reloading the model, reset the filter. One might argue whether this is the correct place. On the other hand, we might even make the filter a sub-object of the dive-list model. Let's think about this. Partially solves #2961 Signed-off-by: Berthold Stoeger --- qt-models/divetripmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-models') diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index a48c827dd..8671a62b6 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -714,6 +714,8 @@ DiveTripModelTree::DiveTripModelTree(QObject *parent) : DiveTripModelBase(parent void DiveTripModelTree::populate() { + DiveFilter::instance()->updateAll(); // The data was reset - update filter status. TODO: should this really be done here? + // we want this to be two calls as the second text is overwritten below by the lines starting with "\r" uiNotification(QObject::tr("populate data model")); uiNotification(QObject::tr("start processing")); @@ -1479,6 +1481,8 @@ DiveTripModelList::DiveTripModelList(QObject *parent) : DiveTripModelBase(parent void DiveTripModelList::populate() { + DiveFilter::instance()->updateAll(); // The data was reset - update filter status. TODO: should this really be done here? + // Fill model items.reserve(dive_table.nr); for (int i = 0; i < dive_table.nr; ++i) { -- cgit v1.2.3-70-g09d2