mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Implement trip-filtering.
Trips will be filtered if it doesn't find any tags for dives. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f1e7c12e8a
commit
bef8dc6f4b
1 changed files with 7 additions and 1 deletions
|
@ -2162,8 +2162,14 @@ bool TagFilterSortModel::filterAcceptsRow(int source_row, const QModelIndex &sou
|
|||
QModelIndex index0 = sourceModel()->index(source_row, 0, source_parent);
|
||||
QVariant diveVariant = sourceModel()->data(index0, DiveTripModel::DIVE_ROLE);
|
||||
struct dive* d = (struct dive* ) diveVariant.value<void*>();
|
||||
if(!d)
|
||||
|
||||
if (!d) { // It's a trip, only show the ones that have dives to be shown.
|
||||
for(int i = 0; i < sourceModel()->rowCount(index0); i++){
|
||||
if (filterAcceptsRow(i, index0))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Checked means 'Show', Unchecked means 'Hide'.
|
||||
struct tag_entry *head = d->tag_list;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue