Merge pull request #6509 from jonaski/tolist

Replace QSet::toList() with QSet::values()
This commit is contained in:
John Maguire 2020-01-05 15:13:33 +00:00 committed by GitHub
commit 10e807dd7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 8 deletions

View File

@ -264,7 +264,7 @@ QStringList SpotifySearchProvider::GetSuggestions(int count) {
return QStringList();
}
QStringList all_suggestions = suggestions_.toList();
QStringList all_suggestions = suggestions_.values();
std::mt19937 gen(std::time(0));
std::uniform_int_distribution<> random(0, all_suggestions.size() - 1);

View File

@ -344,14 +344,14 @@ void GPodderSync::FlushUpdateQueue() {
flushing_queue_ = true;
mygpo::AddRemoveResultPtr reply(api_->addRemoveSubscriptions(
username_, DeviceId(), queued_add_subscriptions_.toList(),
queued_remove_subscriptions_.toList()));
username_, DeviceId(), queued_add_subscriptions_.values(),
queued_remove_subscriptions_.values()));
qLog(Info) << "Sending" << all_urls.count() << "changes to gpodder.net";
NewClosure(reply, SIGNAL(finished()), this,
SLOT(AddRemoveFinished(mygpo::AddRemoveResultPtr, QList<QUrl>)),
reply, all_urls.toList());
reply, all_urls.values());
connect(reply.data(), SIGNAL(parseError()), SLOT(AddRemoveParseError()));
connect(reply.data(), SIGNAL(requestError(QNetworkReply::NetworkError)),
SLOT(AddRemoveRequestError(QNetworkReply::NetworkError)));

View File

@ -558,7 +558,7 @@ QStringList LibraryBackend::GetAllArtistsWithAlbums(const QueryOptions& opt) {
artists << query2.Value(0).toString();
}
return QStringList(artists.toList());
return QStringList(artists.values());
}
LibraryBackend::AlbumList LibraryBackend::GetAllAlbums(

View File

@ -387,7 +387,7 @@ MusicBrainzClient::ResultList MusicBrainzClient::UniqueResults(
const ResultList& results, UniqueResultsSortOption opt) {
ResultList ret;
if (opt == SortResults) {
ret = QSet<Result>::fromList(results).toList();
ret = QSet<Result>::fromList(results).values();
std::sort(ret.begin(), ret.end());
} else { // KeepOriginalOrder
// Qt doesn't provide a ordered set (QSet "stores values in an unspecified

View File

@ -2093,7 +2093,7 @@ void Playlist::ReshuffleIndices() {
}
// Shuffle them
QStringList shuffled_album_keys = album_key_set.toList();
QStringList shuffled_album_keys = album_key_set.values();
std::random_shuffle(shuffled_album_keys.begin(),
shuffled_album_keys.end());

View File

@ -547,7 +547,7 @@ QString PlaylistManager::GetNameForNewPlaylist(const SongList& songs) {
}
if (!various_artists && albums.size() == 1) {
result += " - " + albums.toList().first();
result += " - " + albums.values().first();
}
return result;