Make main thread more responsive when updating feeds
This commit is contained in:
parent
ee13a29d10
commit
16c052250c
@ -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);
|
||||
}
|
||||
|
||||
|
@ -19,11 +19,12 @@ Kirigami.ScrollablePage {
|
||||
property var lastFeed: ""
|
||||
|
||||
supportsRefreshing: true
|
||||
onRefreshingChanged:
|
||||
onRefreshingChanged: {
|
||||
if(refreshing) {
|
||||
Fetcher.fetchAll()
|
||||
refreshing = false
|
||||
}
|
||||
}
|
||||
|
||||
contextualActions: [
|
||||
Kirigami.Action {
|
||||
|
Loading…
x
Reference in New Issue
Block a user