mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-02-03 18:57:37 +01:00
fix qt5 build
This commit is contained in:
parent
8a4ac8f09f
commit
b91db35eb5
@ -157,7 +157,12 @@ void FeedDownloader::updateFeeds(const QList<Feed*>& feeds) {
|
||||
return updateThreadedFeed(fd);
|
||||
};
|
||||
|
||||
m_watcherLookup.setFuture(QtConcurrent::mapped(qApp->workHorsePool(), m_feeds, func));
|
||||
m_watcherLookup.setFuture(QtConcurrent::mapped(
|
||||
#if QT_VERSION_MAJOR > 5
|
||||
qApp->workHorsePool(),
|
||||
#endif
|
||||
m_feeds,
|
||||
func));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -967,6 +967,14 @@ void Application::setupWorkHorsePool() {
|
||||
// NOTE: Do not expire threads so that their IDs are not reused.
|
||||
// This fixes cross-thread QSqlDatabase access.
|
||||
m_workHorsePool->setExpiryTimeout(-1);
|
||||
|
||||
#if QT_VERSION_MAJOR == 5
|
||||
// NOTE: Qt 5 sadly does not allow to specify custom thread pool for
|
||||
// QtConcurrent::mapped() method, so we have to use global thread pool
|
||||
// there.
|
||||
QThreadPool::globalInstance()->setMaxThreadCount(m_workHorsePool->maxThreadCount());
|
||||
QThreadPool::globalInstance()->setExpiryTimeout(m_workHorsePool->expiryTimeout());
|
||||
#endif
|
||||
}
|
||||
|
||||
void Application::onAdBlockFailure() {
|
||||
|
@ -380,7 +380,11 @@ void FeedsImportExportModel::importAsOPML20(const QByteArray& data,
|
||||
return produceFeed(lookup);
|
||||
};
|
||||
|
||||
#if QT_VERSION_MAJOR == 5
|
||||
QFuture<bool> fut = QtConcurrent::mapped(m_lookup, func);
|
||||
#else
|
||||
QFuture<bool> fut = QtConcurrent::mapped(qApp->workHorsePool(), m_lookup, func);
|
||||
#endif
|
||||
|
||||
m_watcherLookup.setFuture(fut);
|
||||
|
||||
@ -445,7 +449,11 @@ void FeedsImportExportModel::importAsTxtURLPerLine(const QByteArray& data,
|
||||
return produceFeed(lookup);
|
||||
};
|
||||
|
||||
#if QT_VERSION_MAJOR == 5
|
||||
QFuture<bool> fut = QtConcurrent::mapped(m_lookup, func);
|
||||
#else
|
||||
QFuture<bool> fut = QtConcurrent::mapped(qApp->workHorsePool(), m_lookup, func);
|
||||
#endif
|
||||
|
||||
m_watcherLookup.setFuture(fut);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user