aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/scrobbler
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2019-09-07 22:08:54 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2019-09-07 22:08:54 +0000
commit1e31fe896524513577911e382897b841e40a4814 (patch)
tree153483337dcab82e0bc32cc19f7876a7eb9593c7 /src/plugins/General/scrobbler
parent1d6f69e20769d902a70001277199129361d0a761 (diff)
downloadqmmp-1e31fe896524513577911e382897b841e40a4814.tar.gz
qmmp-1e31fe896524513577911e382897b841e40a4814.tar.bz2
qmmp-1e31fe896524513577911e382897b841e40a4814.zip
removed foreach macro
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9067 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/scrobbler')
-rw-r--r--src/plugins/General/scrobbler/scrobbler.cpp10
-rw-r--r--src/plugins/General/scrobbler/scrobblercache.cpp2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/General/scrobbler/scrobbler.cpp b/src/plugins/General/scrobbler/scrobbler.cpp
index cc40e9c3f..510f2e6aa 100644
--- a/src/plugins/General/scrobbler/scrobbler.cpp
+++ b/src/plugins/General/scrobbler/scrobbler.cpp
@@ -298,7 +298,7 @@ void Scrobbler::submit()
params.insert("sk", m_session);
QStringList keys = params.keys();
- foreach (QString key, keys) //removes empty keys
+ for(const QString &key : qAsConst(keys)) //removes empty keys
{
if(params.value(key).isEmpty() || params.value(key) == "0")
params.remove(key);
@@ -309,7 +309,7 @@ void Scrobbler::submit()
QUrlQuery body("");
QByteArray data;
- foreach (QString key, params.keys())
+ for(const QString &key : params.keys())
{
body.addQueryItem(key, params.value(key));
data.append(key.toUtf8() + params.value(key).toUtf8());
@@ -347,7 +347,7 @@ void Scrobbler::sendNotification(const SongInfo &info)
params.insert("method", "track.updateNowPlaying");
params.insert("sk", m_session);
- foreach (QString key, params) //removes empty keys
+ for(const QString &key : qAsConst(params)) //removes empty keys
{
if(params.value(key).isEmpty())
params.remove(key);
@@ -358,7 +358,7 @@ void Scrobbler::sendNotification(const SongInfo &info)
QUrlQuery body("");
QByteArray data;
- foreach (QString key, params.keys())
+ for(const QString &key : params.keys())
{
body.addQueryItem(key, params.value(key));
data.append(key.toUtf8() + params.value(key).toUtf8());
@@ -469,7 +469,7 @@ void ScrobblerAuth::checkSession(const QString &session)
QUrlQuery body("");
QByteArray data;
- foreach (QString key, params.keys())
+ for(const QString &key : params.keys())
{
body.addQueryItem(key, params.value(key));
data.append(key.toUtf8() + params.value(key).toUtf8());
diff --git a/src/plugins/General/scrobbler/scrobblercache.cpp b/src/plugins/General/scrobbler/scrobblercache.cpp
index 05319e2a3..9ede37e67 100644
--- a/src/plugins/General/scrobbler/scrobblercache.cpp
+++ b/src/plugins/General/scrobbler/scrobblercache.cpp
@@ -129,7 +129,7 @@ void ListenCache::save(const QList<SongInfo> &songs)
qWarning("ScrobblerCache: error %d: %s", file.error(), qPrintable(file.errorString()));
return;
}
- foreach(SongInfo m, songs)
+ for(const SongInfo &m : qAsConst(songs))
{
file.write(QString("title=%1").arg(m.value(Qmmp::TITLE)).toUtf8() +"\n");
file.write(QString("artist=%1").arg(m.value(Qmmp::ARTIST)).toUtf8() +"\n");