summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-11-13 18:46:12 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2019-11-14 09:37:27 +0100
commit1163fd18c4783803a6dd69963ec7387b543d6ed8 (patch)
treec447231b462623f6b6af52bf6c50514082224314
parentef2f682c67e214895dd1047999ab71105ade8be9 (diff)
downloadsubsurface-1163fd18c4783803a6dd69963ec7387b543d6ed8.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
-rw-r--r--desktop-widgets/command_divelist.cpp9
1 files changed, 4 insertions, 5 deletions
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()