mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-07 05:42:52 +01:00
Replace use of QSet::fromList with Qt 5.14 and above
This commit is contained in:
parent
6df38c389c
commit
be9bf5c173
@ -463,7 +463,11 @@ void CollectionView::ShowInVarious(bool on) {
|
||||
}
|
||||
}
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
for (const QString &album : QSet<QString>(albums.begin(), albums.end())) {
|
||||
#else
|
||||
for (const QString &album : QSet<QString>::fromList(albums.keys())) {
|
||||
#endif
|
||||
app_->collection_backend()->ForceCompilation(album, albums.values(album), on);
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,11 @@ 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()));
|
||||
#else
|
||||
cover_loader_->CancelTasks(QSet<quint64>::fromList(pending_covers_.keys()));
|
||||
#endif
|
||||
pending_covers_.clear();
|
||||
|
||||
}
|
||||
|
@ -251,7 +251,11 @@ 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()));
|
||||
#else
|
||||
app_->album_cover_loader()->CancelTasks(QSet<quint64>::fromList(cover_loading_tasks_.keys()));
|
||||
#endif
|
||||
cover_loading_tasks_.clear();
|
||||
|
||||
cover_exporter_->Cancel();
|
||||
|
@ -488,7 +488,11 @@ MusicBrainzClient::ResultList MusicBrainzClient::UniqueResults(const ResultList&
|
||||
|
||||
ResultList ret;
|
||||
if (opt == SortResults) {
|
||||
ret = QSet<Result>::fromList(results).toList();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
ret = QSet<Result>(results.begin(), results.end()).values();
|
||||
#else
|
||||
ret = QSet<Result>::fromList(results).values();
|
||||
#endif
|
||||
std::sort(ret.begin(), ret.end());
|
||||
}
|
||||
else { // KeepOriginalOrder
|
||||
|
Loading…
Reference in New Issue
Block a user