summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-02-10 21:00:26 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-02-22 15:18:31 -0800
commitbe3d7bffc610a0e6e70cd00919197a0adf213d70 (patch)
tree42fe8e57849f0716499d4a02e380308bd16f6910 /qt-models
parent03a6440b2a1001d0ab1ff7958d42217dd07b1603 (diff)
downloadsubsurface-be3d7bffc610a0e6e70cd00919197a0adf213d70.tar.gz
Cleanup: remove shown flag of DiveTripModelTree items
Since we now filter at the model level, items are by definition shown. No need for a flag. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divetripmodel.cpp10
-rw-r--r--qt-models/divetripmodel.h1
2 files changed, 3 insertions, 8 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 23292384e..09755a9e5 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -702,19 +702,15 @@ QModelIndex DiveTripModelTree::parent(const QModelIndex &index) const
}
DiveTripModelTree::Item::Item(dive_trip *t, const QVector<dive *> &divesIn) : d_or_t{nullptr, t},
- dives(std::vector<dive *>(divesIn.begin(), divesIn.end())),
- shown(std::any_of(dives.begin(), dives.end(), [](dive *d){ return !d->hidden_by_filter; }))
+ dives(std::vector<dive *>(divesIn.begin(), divesIn.end()))
{
}
-DiveTripModelTree::Item::Item(dive_trip *t, dive *d) : d_or_t{nullptr, t},
- dives({ d }),
- shown(!d->hidden_by_filter)
+DiveTripModelTree::Item::Item(dive_trip *t, dive *d) : d_or_t{nullptr, t}, dives({ d })
{
}
-DiveTripModelTree::Item::Item(dive *d) : d_or_t{d, nullptr},
- shown(!d->hidden_by_filter)
+DiveTripModelTree::Item::Item(dive *d) : d_or_t{d, nullptr}
{
}
diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h
index 4182f0bd1..39589a8e6 100644
--- a/qt-models/divetripmodel.h
+++ b/qt-models/divetripmodel.h
@@ -137,7 +137,6 @@ private:
struct Item {
dive_or_trip d_or_t;
std::vector<dive *> dives; // std::vector<> instead of QVector for insert() with three iterators
- bool shown;
Item(dive_trip *t, const QVector<dive *> &dives);
Item(dive_trip *t, dive *d); // Initialize a trip with one dive
Item(dive *d); // Initialize a top-level dive