Fix compile with Qt 5.14 and above

This commit is contained in:
Jonas Kvinge 2019-12-30 02:28:54 +01:00
parent 0e12c8249e
commit 8818f24114
3 changed files with 3 additions and 3 deletions

View File

@ -464,7 +464,7 @@ void CollectionView::ShowInVarious(bool on) {
}
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
for (const QString &album : QSet<QString>(albums.begin(), albums.end())) {
for (const QString &album : QSet<QString>(albums.keyBegin(), albums.keyEnd())) {
#else
for (const QString &album : QSet<QString>::fromList(albums.keys())) {
#endif

View File

@ -88,7 +88,7 @@ void StandardItemIconLoader::RowsAboutToBeRemoved(const QModelIndex &parent, int
void StandardItemIconLoader::ModelReset() {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
cover_loader_->CancelTasks(QSet<quint64>(pending_covers_.begin(), pending_covers_.end()));
cover_loader_->CancelTasks(QSet<quint64>(pending_covers_.keyBegin(), pending_covers_.keyEnd()));
#else
cover_loader_->CancelTasks(QSet<quint64>::fromList(pending_covers_.keys()));
#endif

View File

@ -252,7 +252,7 @@ void AlbumCoverManager::closeEvent(QCloseEvent *e) {
void AlbumCoverManager::CancelRequests() {
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
app_->album_cover_loader()->CancelTasks(QSet<quint64>(cover_loading_tasks_.begin(), cover_loading_tasks_.end()));
app_->album_cover_loader()->CancelTasks(QSet<quint64>(cover_loading_tasks_.keyBegin(), cover_loading_tasks_.keyEnd()));
#else
app_->album_cover_loader()->CancelTasks(QSet<quint64>::fromList(cover_loading_tasks_.keys()));
#endif