Mobile/filtering: simplify the filter toggle

Simply make it always reset the filter. There's no point remembering the last
filter pattern and explicitly setting it, if the last thing we do is to reset
this pattern.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-10-20 12:01:21 -04:00
parent 466a0bf758
commit b0a0e1e374

View file

@ -510,12 +510,7 @@ Kirigami.ScrollablePage {
text: qsTr("Filter dives")
onTriggered: {
rootItem.filterToggle = !rootItem.filterToggle
if (rootItem.filterToggle) {
diveModel.setFilter(rootItem.filterPattern)
} else {
diveModel.resetFilter()
rootItem.filterPattern = ""
}
diveModel.resetFilter()
}
}