From e4735623cbddcc4fa041d8f0327af41975263a1d Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Mon, 20 Apr 2020 14:37:30 +0200 Subject: [PATCH] Close EntryListPage when feed is deleted --- src/qml/FeedListPage.qml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qml/FeedListPage.qml b/src/qml/FeedListPage.qml index 72cd8e8d..829a48f2 100644 --- a/src/qml/FeedListPage.qml +++ b/src/qml/FeedListPage.qml @@ -29,6 +29,8 @@ import org.kde.alligator 1.0 Kirigami.ScrollablePage { title: "Alligator" + property var lastFeed: "" + contextualActions: [ Kirigami.Action { text: i18n("Add feed") @@ -103,12 +105,19 @@ Kirigami.ScrollablePage { actions: [ Kirigami.Action { icon.name: "delete" - onTriggered: feedListModel.removeFeed(index) + onTriggered: { + if(pageStack.depth > 1 && model.url === lastFeed) + pageStack.pop() + feedListModel.removeFeed(index) + } } ] - onClicked: pageStack.push("qrc:/EntryListPage.qml", {"data": model}) + onClicked: { + lastFeed = model.url + pageStack.push("qrc:/EntryListPage.qml", {"data": model}) + } } } }