Use QJsonValueRef

This commit is contained in:
Jonas Kvinge
2021-03-26 22:10:43 +01:00
parent 14fb647647
commit 91ab8e22b7
16 changed files with 50 additions and 48 deletions

View File

@@ -396,12 +396,12 @@ void TidalRequest::ArtistsReplyReceived(QNetworkReply *reply, const int limit_re
}
int artists_received = 0;
for (const QJsonValue value_item : array_items) {
for (const QJsonValueRef value_item : array_items) {
++artists_received;
if (!value_item.isObject()) {
Error("Invalid Json reply, item in array is not a object.", value_item);
Error("Invalid Json reply, item in array is not a object.");
continue;
}
QJsonObject obj_item = value_item.toObject();
@@ -574,12 +574,12 @@ void TidalRequest::AlbumsReceived(QNetworkReply *reply, const QString &artist_id
}
int albums_received = 0;
for (const QJsonValue value_item : array_items) {
for (const QJsonValueRef value_item : array_items) {
++albums_received;
if (!value_item.isObject()) {
Error("Invalid Json reply, item in array is not a object.", value_item);
Error("Invalid Json reply, item in array is not a object.");
continue;
}
QJsonObject obj_item = value_item.toObject();
@@ -861,10 +861,10 @@ void TidalRequest::SongsReceived(QNetworkReply *reply, const QString &artist_id,
bool multidisc = false;
SongList songs;
int songs_received = 0;
for (const QJsonValue value_item : json_items) {
for (const QJsonValueRef value_item : json_items) {
if (!value_item.isObject()) {
Error("Invalid Json reply, track is not a object.", value_item);
Error("Invalid Json reply, track is not a object.");
continue;
}
QJsonObject obj_item = value_item.toObject();