Add missing const
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
@@ -382,9 +383,9 @@ void GeniusLyricsProvider::HandleSearchReply(QNetworkReply *reply, const int id)
|
||||
EndSearch(search);
|
||||
return;
|
||||
}
|
||||
QJsonArray array_hits = obj_response[QLatin1String("hits")].toArray();
|
||||
const QJsonArray array_hits = obj_response[QLatin1String("hits")].toArray();
|
||||
|
||||
for (const QJsonValueRef value_hit : array_hits) {
|
||||
for (const QJsonValue &value_hit : array_hits) {
|
||||
if (!value_hit.isObject()) {
|
||||
continue;
|
||||
}
|
||||
@@ -491,7 +492,7 @@ void GeniusLyricsProvider::AuthError(const QString &error, const QVariant &debug
|
||||
|
||||
if (!error.isEmpty()) login_errors_ << error;
|
||||
|
||||
for (const QString &e : login_errors_) Error(e);
|
||||
for (const QString &e : std::as_const(login_errors_)) Error(e);
|
||||
if (debug.isValid()) qLog(Debug) << debug;
|
||||
|
||||
emit AuthenticationFailure(login_errors_);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
|
||||
#include <QObject>
|
||||
@@ -189,9 +190,9 @@ void MusixmatchLyricsProvider::HandleSearchReply(QNetworkReply *reply, LyricsSea
|
||||
EndSearch(search);
|
||||
return;
|
||||
}
|
||||
QJsonArray array_tracklist = obj_body[QLatin1String("track_list")].toArray();
|
||||
const QJsonArray array_tracklist = obj_body[QLatin1String("track_list")].toArray();
|
||||
|
||||
for (const QJsonValueRef value_track : array_tracklist) {
|
||||
for (const QJsonValue &value_track : array_tracklist) {
|
||||
if (!value_track.isObject()) {
|
||||
continue;
|
||||
}
|
||||
@@ -235,7 +236,7 @@ void MusixmatchLyricsProvider::HandleSearchReply(QNetworkReply *reply, LyricsSea
|
||||
EndSearch(search);
|
||||
}
|
||||
else {
|
||||
for (const QUrl &url : search->requests_lyrics_) {
|
||||
for (const QUrl &url : std::as_const(search->requests_lyrics_)) {
|
||||
SendLyricsRequest(search, url);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user