Make main thread more responsive when updating feeds

This commit is contained in:
Bart De Vries 2021-04-11 13:30:21 +02:00
parent ee13a29d10
commit 16c052250c
2 changed files with 4 additions and 2 deletions

View File

@ -132,11 +132,12 @@ void Fetcher::processFeed(Syndication::FeedPtr feed, const QString &url)
query.bindValue(QStringLiteral(":image"), image);
Database::instance().execute(query);
qDebug() << "Updated feed title:" << feed->title();
qDebug() << "Updated feed:" << feed->title();
Q_EMIT feedDetailsUpdated(url, feed->title(), image, feed->link(), feed->description(), current);
for (const auto &entry : feed->items()) {
QCoreApplication::processEvents(); // keep the main thread semi-responsive
processEntry(entry, url, isNewFeed);
}

View File

@ -19,11 +19,12 @@ Kirigami.ScrollablePage {
property var lastFeed: ""
supportsRefreshing: true
onRefreshingChanged:
onRefreshingChanged: {
if(refreshing) {
Fetcher.fetchAll()
refreshing = false
}
}
contextualActions: [
Kirigami.Action {