diff --git a/src/datamanager.cpp b/src/datamanager.cpp index 4ff4a6db..113ce60d 100644 --- a/src/datamanager.cpp +++ b/src/datamanager.cpp @@ -62,8 +62,14 @@ DataManager::DataManager() query.bindValue(QStringLiteral(":new"), true); Database::instance().execute(query); while (query.next()) { - addtoQueue(feedurl, query.value(QStringLiteral("id")).toString()); + QString const id = query.value(QStringLiteral("id")).toString(); + addtoQueue(feedurl, id); + if (AlligatorSettings::self()->autoDownload()) { + if (getEntry(id)->hasEnclosure()) + getEntry(id)->enclosure()->download(); + } } + } Q_EMIT feedEntriesUpdated(feedurl); @@ -322,7 +328,12 @@ void DataManager::moveQueueItem(const int &from, const int &to) void DataManager::removeQueueItem(const int &index) { qDebug() << m_queuemap; - // First remove the item from the internal data structure + // Unset "new" state + getEntry(m_queuemap[index])->setNew(false); + // TODO: Make sure to unset the pointer in the Audio class once it's been + // ported to c++ + + // Remove the item from the internal data structure const QString id = m_queuemap[index]; m_queuemap.removeAt(index); @@ -347,6 +358,7 @@ void DataManager::removeQueueItem(Entry* entry) { removeQueueItem(m_queuemap.indexOf(entry->id())); } + void DataManager::importFeeds(const QString &path) { QUrl url(path); diff --git a/src/qml/QueueDelegate.qml b/src/qml/QueueDelegate.qml index 0ab1d85c..26e8c3bd 100644 --- a/src/qml/QueueDelegate.qml +++ b/src/qml/QueueDelegate.qml @@ -24,7 +24,7 @@ Kirigami.SwipeListItem { } Image { asynchronous: true - source: entry.image === "" ? "rss" : "file://"+Fetcher.image(entry.image) + source: entry.image === "" ? "logo.png" : "file://"+Fetcher.image(entry.image) fillMode: Image.PreserveAspectFit property int size: Kirigami.Units.gridUnit * 3 sourceSize.width: size diff --git a/src/qml/SettingsPage.qml b/src/qml/SettingsPage.qml index d10904b3..14fadbae 100644 --- a/src/qml/SettingsPage.qml +++ b/src/qml/SettingsPage.qml @@ -38,7 +38,13 @@ Kirigami.ScrollablePage { checked: AlligatorSettings.autoQueue text: i18n("Automatically queue new episodes") - onToggled: AlligatorSettings.autoQueue = checked + onToggled: { + AlligatorSettings.autoQueue = checked + if (!checked) { + autoDownload.checked = false + AlligatorSettings.autoDownload = false + } + } } Controls.CheckBox { @@ -46,6 +52,7 @@ Kirigami.ScrollablePage { checked: AlligatorSettings.autoDownload text: i18n("Automatically download new episodes") + enabled: autoQueue.checked onToggled: AlligatorSettings.autoDownload = checked }