From 014c04f8bd30740e7711f3b3a01619fd27b5b613 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 21 Jul 2018 18:28:33 +0200 Subject: Undo: implement rudimentary support for undo of dive-merging For this, an output-parameter was added to the backend merge_dives() function. When non-zero, instead of adding the merged dive to the preferred trip, the preferred trip is returned to the caller. Since the new UndoObject, just like the delete-dives UndoObject, needs to remove/readd a set of dives, the corresponding functionality was split-off in a helper function. Signed-off-by: Berthold Stoeger --- desktop-widgets/tab-widgets/maintab.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'desktop-widgets/tab-widgets') diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index e5974a834..66ed33c0d 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -809,9 +809,8 @@ void MainTab::acceptChanges() MainWindow::instance()->dive_list()->verticalScrollBar()->setSliderPosition(scrolledBy); MainWindow::instance()->dive_list()->setFocus(); resetPallete(); - saveTags(QVector{ &displayed_dive }); + saveTags(); displayed_dive.divetrip = nullptr; // Should not be necessary, just in case! - Command::addDive(&displayed_dive, autogroup, true); return; } else if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) { /* now figure out if things have changed */ -- cgit v1.2.3-70-g09d2