diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-12-21 20:21:56 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-10 09:25:57 -0700 |
commit | dd8d8edc45dad1316aa5b5470247e14fb75d67e1 (patch) | |
tree | 2d0080fc49633750b46fbf65b145c44afa40f92f /mobile-widgets | |
parent | d55ea8f8750a7952d4e9e003bef57decc513d2d4 (diff) | |
download | subsurface-dd8d8edc45dad1316aa5b5470247e14fb75d67e1.tar.gz |
mobile/divelist: don't set currentIndex on undo of dive deletion
The core sets the current dive when undoing something.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DiveDetails.qml | 3 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 3 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index da2b30cf7..66e082163 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -155,12 +155,11 @@ Kirigami.Page { } onTriggered: { var deletedId = currentItem.modelData.id - var deletedIndex = diveDetailsListView.currentIndex manager.deleteDive(deletedId) pageStack.pop() showPassiveNotification("Dive deleted", 5000, "Undo", function() { - diveDetailsListView.currentIndex = manager.undoDelete(deletedId) ? deletedIndex : diveDetailsListView.currentIndex + manager.undoDelete(deletedId) }); } } diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index d064c1807..0c434a4a9 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1398,11 +1398,10 @@ void QMLManager::saveChangesCloud(bool forceRemoteSync) git_local_only = glo; } -bool QMLManager::undoDelete(int) +void QMLManager::undoDelete(int) { undoAction->activate(QAction::Trigger); changesNeedSaving(); - return true; } void QMLManager::selectDive(int id) diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 482ba7ecc..5a3662bfb 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -198,7 +198,7 @@ public slots: bool toggleTags(bool toggle); bool toggleCylinders(bool toggle); bool toggleWeights(bool toggle); - bool undoDelete(int id); + void undoDelete(int id); QString addDive(); void addDiveAborted(int id); void applyGpsData(); |