From 1163fd18c4783803a6dd69963ec7387b543d6ed8 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 13 Nov 2019 18:46:12 +0100 Subject: Undo: remove superfluous dive replot in DiveComputerBase::redoit() Removing / moving a dive computer needs a profile replot. This was done explicitly in DiveComputerBase::redoit(). This is unnecessary, as a profile replot is performed implicitly by the setSelection() call. Signed-off-by: Berthold Stoeger --- desktop-widgets/command_divelist.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'desktop-widgets/command_divelist.cpp') diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp index a08a6f797..9438107dd 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/desktop-widgets/command_divelist.cpp @@ -2,7 +2,6 @@ #include "command_divelist.h" #include "command_private.h" -#include "desktop-widgets/mainwindow.h" #include "desktop-widgets/divelistview.h" #include "core/divelist.h" #include "core/display.h" // for amount_selected @@ -856,13 +855,13 @@ void DiveComputerBase::redoit() diveToAdd = removeDives(diveToRemove); diveToRemove = std::move(addedDive); - // Select added dive and make it current + dc_number = dc_nr_after; + + // Select added dive and make it current. + // This automatically replots the profile. setSelection(diveToRemove.dives, diveToRemove.dives[0]); - // Update the profile to show the first dive computer - dc_number = dc_nr_after; std::swap(dc_nr_before, dc_nr_after); - MainWindow::instance()->graphics->replot(current_dive); } void DiveComputerBase::undoit() -- cgit v1.2.3-70-g09d2