summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mobile-widgets/qml/DiveDetails.qml9
-rw-r--r--mobile-widgets/qmlmanager.cpp2
-rw-r--r--mobile-widgets/qmlmanager.h2
3 files changed, 3 insertions, 10 deletions
diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml
index 5d52b89ca..a886a2c50 100644
--- a/mobile-widgets/qml/DiveDetails.qml
+++ b/mobile-widgets/qml/DiveDetails.qml
@@ -152,14 +152,7 @@ Kirigami.Page {
icon {
name: ":/icons/trash-empty.svg"
}
- onTriggered: {
- var deletedId = currentItem.modelData.id
- manager.deleteDive(deletedId)
- showPassiveNotification("Dive deleted", 5000, "Undo",
- function() {
- manager.undoDelete(deletedId)
- });
- }
+ onTriggered: manager.deleteDive(currentItem.modelData.id)
}
property QtObject cancelAction: Kirigami.Action {
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 81806ddea..cbd82ade2 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1395,7 +1395,7 @@ void QMLManager::saveChangesCloud(bool forceRemoteSync)
git_local_only = glo;
}
-void QMLManager::undoDelete(int)
+void QMLManager::undo()
{
Command::getUndoStack()->undo();
changesNeedSaving();
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index c0a5c65c4..2548767b4 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -195,7 +195,7 @@ public slots:
bool toggleTags(bool toggle);
bool toggleCylinders(bool toggle);
bool toggleWeights(bool toggle);
- void undoDelete(int id);
+ void undo();
void redo();
int addDive();
void applyGpsData();