mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
03a6440b2a
commit
be3d7bffc6
2 changed files with 3 additions and 8 deletions
|
@ -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}
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue