mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive list: remember selected dives
Don't delesect dives, when unregistering them from the backend. If a previously selected dive is added, select it in the dive-list. For this purpose introduce a SELECTED_ROLE to query the DiveTripModel for selected dives. Unfortunately, when adding multiple selected dives, current_dive_changed is called for each of them, making this very slow. This will have to be fixed in subsequent commits. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
96d8727399
commit
0d98da5261
4 changed files with 29 additions and 12 deletions
|
|
@ -297,16 +297,18 @@ QVariant DiveItem::data(int column, int role) const
|
|||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (role == DiveTripModel::STAR_ROLE) {
|
||||
case DiveTripModel::STAR_ROLE:
|
||||
retVal = d->rating;
|
||||
}
|
||||
if (role == DiveTripModel::DIVE_ROLE) {
|
||||
break;
|
||||
case DiveTripModel::DIVE_ROLE:
|
||||
retVal = QVariant::fromValue<void *>(d);
|
||||
}
|
||||
if (role == DiveTripModel::DIVE_IDX) {
|
||||
break;
|
||||
case DiveTripModel::DIVE_IDX:
|
||||
retVal = get_divenr(d);
|
||||
break;
|
||||
case DiveTripModel::SELECTED_ROLE:
|
||||
retVal = d->selected;
|
||||
break;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue