diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-09-20 13:40:21 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-09-20 18:21:56 -0700 |
commit | 43390d4a9aa1a6c78e36ae2dd32e8421f9060c92 (patch) | |
tree | 199b52d722be2358ed2eb762b7977eb6488e4599 /qt-models | |
parent | 77781b936aeffec5d96e8cb7f75c12020cb2b6c3 (diff) | |
download | subsurface-43390d4a9aa1a6c78e36ae2dd32e8421f9060c92.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/divetripmodel.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |