mirror of https://github.com/KDE/kasts.git
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);
|
query.bindValue(QStringLiteral(":image"), image);
|
||||||
Database::instance().execute(query);
|
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);
|
Q_EMIT feedDetailsUpdated(url, feed->title(), image, feed->link(), feed->description(), current);
|
||||||
|
|
||||||
for (const auto &entry : feed->items()) {
|
for (const auto &entry : feed->items()) {
|
||||||
|
QCoreApplication::processEvents(); // keep the main thread semi-responsive
|
||||||
processEntry(entry, url, isNewFeed);
|
processEntry(entry, url, isNewFeed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,12 @@ Kirigami.ScrollablePage {
|
||||||
property var lastFeed: ""
|
property var lastFeed: ""
|
||||||
|
|
||||||
supportsRefreshing: true
|
supportsRefreshing: true
|
||||||
onRefreshingChanged:
|
onRefreshingChanged: {
|
||||||
if(refreshing) {
|
if(refreshing) {
|
||||||
Fetcher.fetchAll()
|
Fetcher.fetchAll()
|
||||||
refreshing = false
|
refreshing = false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
contextualActions: [
|
contextualActions: [
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
|
|
Loading…
Reference in New Issue