From 1e31fe896524513577911e382897b841e40a4814 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sat, 7 Sep 2019 22:08:54 +0000 Subject: removed foreach macro git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9067 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/scrobbler/scrobbler.cpp | 10 +++++----- src/plugins/General/scrobbler/scrobblercache.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/General/scrobbler') 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 &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"); -- cgit v1.2.3-13-gbd6f