mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
d55ea8f875
commit
dd8d8edc45
3 changed files with 3 additions and 5 deletions
|
@ -155,12 +155,11 @@ Kirigami.Page {
|
||||||
}
|
}
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
var deletedId = currentItem.modelData.id
|
var deletedId = currentItem.modelData.id
|
||||||
var deletedIndex = diveDetailsListView.currentIndex
|
|
||||||
manager.deleteDive(deletedId)
|
manager.deleteDive(deletedId)
|
||||||
pageStack.pop()
|
pageStack.pop()
|
||||||
showPassiveNotification("Dive deleted", 5000, "Undo",
|
showPassiveNotification("Dive deleted", 5000, "Undo",
|
||||||
function() {
|
function() {
|
||||||
diveDetailsListView.currentIndex = manager.undoDelete(deletedId) ? deletedIndex : diveDetailsListView.currentIndex
|
manager.undoDelete(deletedId)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1398,11 +1398,10 @@ void QMLManager::saveChangesCloud(bool forceRemoteSync)
|
||||||
git_local_only = glo;
|
git_local_only = glo;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QMLManager::undoDelete(int)
|
void QMLManager::undoDelete(int)
|
||||||
{
|
{
|
||||||
undoAction->activate(QAction::Trigger);
|
undoAction->activate(QAction::Trigger);
|
||||||
changesNeedSaving();
|
changesNeedSaving();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMLManager::selectDive(int id)
|
void QMLManager::selectDive(int id)
|
||||||
|
|
|
@ -198,7 +198,7 @@ public slots:
|
||||||
bool toggleTags(bool toggle);
|
bool toggleTags(bool toggle);
|
||||||
bool toggleCylinders(bool toggle);
|
bool toggleCylinders(bool toggle);
|
||||||
bool toggleWeights(bool toggle);
|
bool toggleWeights(bool toggle);
|
||||||
bool undoDelete(int id);
|
void undoDelete(int id);
|
||||||
QString addDive();
|
QString addDive();
|
||||||
void addDiveAborted(int id);
|
void addDiveAborted(int id);
|
||||||
void applyGpsData();
|
void applyGpsData();
|
||||||
|
|
Loading…
Add table
Reference in a new issue