Commit 3d0be510 authored by Michael Pyne's avatar Michael Pyne

scrobbler: Don't create QNAM unless we need it (most don't).

parent 3394f39c
......@@ -34,7 +34,7 @@
Scrobbler::Scrobbler(QObject* parent)
: QObject(parent)
, m_startedPlaying(0)
, m_networkAccessManager(new QNetworkAccessManager(this))
, m_networkAccessManager(0)
{
KConfigGroup config(KGlobal::config(), "Scrobbling");
......@@ -91,6 +91,9 @@ void Scrobbler::getAuthToken(QString username, QString password)
url.addQueryItem(key, params[key]);
}
if (!m_networkAccessManager)
m_networkAccessManager = new QNetworkAccessManager(this);
QNetworkReply *reply = m_networkAccessManager->get(QNetworkRequest(url));
connect(reply, SIGNAL(finished()), this, SLOT(handleAuthenticationReply()));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment