Improve PageStack stability

This commit is contained in:
Tobias Fella 2020-10-28 22:55:07 +01:00
parent 4b3cb345e3
commit 4ff3987e0f
3 changed files with 8 additions and 10 deletions

View File

@ -26,18 +26,10 @@ Kirigami.SwipeListItem {
bold: !model.entry.read
onClicked: {
if(pageStack.depth > 2)
while(pageStack.depth > 2)
pageStack.pop()
model.entry.read = true
pageStack.push("qrc:/EntryPage.qml", {"entry": model.entry})
}
}
actions: [
Kirigami.Action {
text: i18n("Open in Browser")
icon.name: "globe"
onTriggered: Qt.openUrlExternally(model.entry.link)
}
]
}

View File

@ -37,7 +37,11 @@ Kirigami.ScrollablePage {
Kirigami.Action {
iconName: "help-about-symbolic"
text: i18n("Details")
onTriggered: pageStack.push("qrc:/FeedDetailsPage.qml", {"feed": feed})
onTriggered: {
while(pageStack.depth > 2)
pageStack.pop()
pageStack.push("qrc:/FeedDetailsPage.qml", {"feed": feed})
}
}
]

View File

@ -26,6 +26,8 @@ Kirigami.SwipeListItem {
onClicked: {
lastFeed = model.feed.url
while(pageStack.depth > 1)
pageStack.pop()
pageStack.push("qrc:/EntryListPage.qml", {"feed": model.feed})
}
}