aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/profilewidget2.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-19 14:27:10 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-20 21:23:16 -0700
commit0bc96905bf92de5e7bac88efde181d93d95998f1 (patch)
treedbfda7a6c615d0b8452bb6ae87e3d98c618df40f /profile-widget/profilewidget2.cpp
parenteba6e76b963115a77b5f8607bc6c3ea1040a466f (diff)
downloadsubsurface-0bc96905bf92de5e7bac88efde181d93d95998f1.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r--profile-widget/profilewidget2.cpp7
1 files changed, 1 insertions, 6 deletions
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()