mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Deselect dives that are no longer shown as the dive list is filtered
This cleans up the way we ensure that all dives are handled as the dive list is filtered. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
71b6de0523
commit
0b31854031
4 changed files with 22 additions and 8 deletions
|
@ -314,6 +314,8 @@ void DiveListView::selectDive(int i, bool scrollto, bool toggle)
|
|||
void DiveListView::selectDives(const QList<int> &newDiveSelection)
|
||||
{
|
||||
int firstInList, newSelection;
|
||||
struct dive *d;
|
||||
|
||||
if (!newDiveSelection.count())
|
||||
return;
|
||||
|
||||
|
@ -335,7 +337,8 @@ void DiveListView::selectDives(const QList<int> &newDiveSelection)
|
|||
newSelection = dive_table.nr - 1;
|
||||
if (newSelection == firstInList)
|
||||
break;
|
||||
selectDive(newSelection);
|
||||
if ((d = get_dive(newSelection)) != NULL && !d->hidden_by_filter)
|
||||
selectDive(newSelection);
|
||||
}
|
||||
QSortFilterProxyModel *m = qobject_cast<QSortFilterProxyModel *>(model());
|
||||
QModelIndexList idxList = m->match(m->index(0, 0), DiveTripModel::DIVE_IDX, selected_dive, 2, Qt::MatchRecursive);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue