mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Reverse undo buffer
Reverse all the code using the UndoBuffer class so that we can use the QUndoStack and QUndoCommand classes. These are Qt's own inbuild undo framework classes, offering a better undo/redo process. Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6374d9cc03
commit
013da6b0af
7 changed files with 3 additions and 152 deletions
|
@ -14,7 +14,6 @@
|
|||
#include <QKeyEvent>
|
||||
#include <QFileDialog>
|
||||
#include "qthelper.h"
|
||||
#include "undobuffer.h"
|
||||
|
||||
// # Date Rtg Dpth Dur Tmp Wght Suit Cyl Gas SAC OTU CNS Loc
|
||||
static int defaultWidth[] = { 70, 140, 90, 50, 50, 50, 50, 70, 50, 50, 70, 50, 50, 500};
|
||||
|
@ -735,9 +734,6 @@ void DiveListView::deleteDive()
|
|||
for_each_dive (i, d) {
|
||||
if (!d->selected)
|
||||
continue;
|
||||
struct dive* undo_entry = alloc_dive();
|
||||
copy_dive(get_dive(i), undo_entry);
|
||||
MainWindow::instance()->undoBuffer->recordbefore("Delete Dive", undo_entry);
|
||||
delete_single_dive(i);
|
||||
i--; // so the next dive isn't skipped... it's now #i
|
||||
lastDiveNr = i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue