From 396758d4896197be9dd9f6d71e094068203e52a6 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 24 Jan 2021 09:13:56 +0100 Subject: 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 --- profile-widget/divehandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profile-widget/divehandler.cpp') diff --git a/profile-widget/divehandler.cpp b/profile-widget/divehandler.cpp index 4a5088964..2f06ea661 100644 --- a/profile-widget/divehandler.cpp +++ b/profile-widget/divehandler.cpp @@ -22,7 +22,7 @@ DiveHandler::DiveHandler(const struct dive *d) : dive(d) int DiveHandler::parentIndex() { ProfileWidget2 *view = qobject_cast(scene()->views().first()); - return view->handles.indexOf(this); + return view->handleIndex(this); } void DiveHandler::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) -- cgit v1.2.3-70-g09d2