From 8d05c71ca2aaffeae46d41ecc7c854d33b0bcc8e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 14 Jun 2015 21:49:34 -0700 Subject: Fix renumbering of dives The implementation in commit 182fe790c9e8 ("Add ability to undo renumbering of dives") looks perfectly reasonable, but it depends on an implementation detail: it assumes that the keys of the QMap are returned in the same order in which they were placed there. Which apparently isn't the case for some version of Qt. With this commit we simply remember both the old and the new number for each dive and therefore the order in which they are processed doesn't matter. Signed-off-by: Dirk Hohndel --- qt-ui/undocommands.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'qt-ui/undocommands.h') diff --git a/qt-ui/undocommands.h b/qt-ui/undocommands.h index bd8530d77..62fb2d22b 100644 --- a/qt-ui/undocommands.h +++ b/qt-ui/undocommands.h @@ -28,13 +28,12 @@ private: class UndoRenumberDives : public QUndoCommand { public: - UndoRenumberDives(QMap originalNumbers, int startNumber); + UndoRenumberDives(QMap > originalNumbers); virtual void undo(); virtual void redo(); private: - QMap oldNumbers; - int start; + QMap > oldNumbers; }; class UndoRemoveDivesFromTrip : public QUndoCommand { -- cgit v1.2.3-70-g09d2