mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile use unique_ptr to manage dive handler objects
Instead of manually deleting them (and the gases). Currently there is only one point where these are deleted, but if we implement proper Qt model/view semantics, this makes things less headachy. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1b14a211f0
commit
396758d489
3 changed files with 31 additions and 26 deletions
|
@ -22,7 +22,7 @@ DiveHandler::DiveHandler(const struct dive *d) : dive(d)
|
|||
int DiveHandler::parentIndex()
|
||||
{
|
||||
ProfileWidget2 *view = qobject_cast<ProfileWidget2 *>(scene()->views().first());
|
||||
return view->handles.indexOf(this);
|
||||
return view->handleIndex(this);
|
||||
}
|
||||
|
||||
void DiveHandler::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue