From 0bc96905bf92de5e7bac88efde181d93d95998f1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 19 May 2019 14:27:10 +0200 Subject: Undo: make "delete dive computer" undoable Simply reuse the code for "move dive computer" by creating a DiveComputerBase base class. Signed-off-by: Berthold Stoeger --- profile-widget/profilewidget2.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'profile-widget') diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 46a1eb1a0..c233b2b44 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1575,12 +1575,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event) void ProfileWidget2::deleteCurrentDC() { - delete_current_divecomputer(); - mark_divelist_changed(true); - // we need to force it since it's likely the same dive and same dc_number - but that's a different dive computer now - plotDive(0, true, false); - - emit refreshDisplay(true); + Command::deleteDiveComputer(current_dive, dc_number); } void ProfileWidget2::splitCurrentDC() -- cgit v1.2.3-70-g09d2