mirror of https://github.com/KDE/kasts.git
Make EntryPage close when that entry is deleted from the DownloadListPage
This commit is contained in:
parent
bcafb26c8c
commit
265b3109cb
|
@ -13,9 +13,11 @@ import org.kde.kirigami 2.15 as Kirigami
|
|||
import org.kde.kasts 1.0
|
||||
|
||||
Kirigami.ScrollablePage {
|
||||
|
||||
title: i18n("Downloads")
|
||||
|
||||
property var lastEntry: ""
|
||||
property string pageName: "downloadpage"
|
||||
|
||||
supportsRefreshing: true
|
||||
onRefreshingChanged: {
|
||||
if(refreshing) {
|
||||
|
|
|
@ -32,10 +32,31 @@ Kirigami.ScrollablePage {
|
|||
if (!entry.queueStatus) {
|
||||
// this entry has just been removed from the queue
|
||||
if (pageStack.depth > 1) {
|
||||
if (pageStack.get(0).lastEntry) {
|
||||
if (pageStack.get(0).lastEntry === entry.id) {
|
||||
// if this EntryPage was open, then close it
|
||||
pageStack.pop()
|
||||
if (pageStack.get(0).pageName === "queuepage") {
|
||||
if (pageStack.get(0).lastEntry) {
|
||||
if (pageStack.get(0).lastEntry === entry.id) {
|
||||
// if this EntryPage was open, then close it
|
||||
pageStack.pop()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: entry.enclosure
|
||||
function onStatusChanged() {
|
||||
if (entry.enclosure.status === Enclosure.Downloadable) {
|
||||
// this entry has just been deleted on the downloadpage
|
||||
if (pageStack.depth > 1) {
|
||||
if (pageStack.get(0).pageName === "downloadpage") {
|
||||
if (pageStack.get(0).lastEntry) {
|
||||
if (pageStack.get(0).lastEntry === entry.id) {
|
||||
// if this EntryPage was open, then close it
|
||||
pageStack.pop()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ Kirigami.SwipeListItem {
|
|||
entry.read = true;
|
||||
entry.new = false;
|
||||
}
|
||||
if (isQueue) {
|
||||
if (isQueue || isDownloads) {
|
||||
lastEntry = entry.id;
|
||||
}
|
||||
pageStack.push("qrc:/EntryPage.qml", {"entry": entry})
|
||||
|
|
|
@ -17,6 +17,7 @@ Kirigami.ScrollablePage {
|
|||
title: i18n("Queue")
|
||||
|
||||
property var lastEntry: ""
|
||||
property string pageName: "queuepage"
|
||||
|
||||
supportsRefreshing: true
|
||||
onRefreshingChanged: {
|
||||
|
|
Loading…
Reference in New Issue