mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:23:23 +00:00
divetripmodel: introduce CURRENT_ROLE
Use this role to test whether a dive is the currently displayed dive. This will be needed to transport changes of the current dive to the mobile list models. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
97e26fd51b
commit
a88ab64cf8
2 changed files with 4 additions and 1 deletions
|
@ -255,6 +255,8 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
|
||||||
return get_divenr(d);
|
return get_divenr(d);
|
||||||
case SELECTED_ROLE:
|
case SELECTED_ROLE:
|
||||||
return d->selected;
|
return d->selected;
|
||||||
|
case CURRENT_ROLE:
|
||||||
|
return d == current_dive;
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,8 @@ public:
|
||||||
DIVE_ROLE,
|
DIVE_ROLE,
|
||||||
TRIP_ROLE,
|
TRIP_ROLE,
|
||||||
DIVE_IDX,
|
DIVE_IDX,
|
||||||
SELECTED_ROLE
|
SELECTED_ROLE,
|
||||||
|
CURRENT_ROLE
|
||||||
};
|
};
|
||||||
enum Layout {
|
enum Layout {
|
||||||
TREE,
|
TREE,
|
||||||
|
|
Loading…
Add table
Reference in a new issue