1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

Drop QJson usage from SpotifyParser

This commit is contained in:
Uwe L. Korn 2014-04-12 13:47:11 +01:00
parent da230fc26e
commit 6cefab4cc5

@ -21,8 +21,6 @@
#include <QtNetwork/QNetworkAccessManager>
#include <qjson/parser.h>
#include "Query.h"
#include "SourceList.h"
#include "DropJob.h"
@ -228,13 +226,13 @@ SpotifyParser::spotifyBrowseFinished()
if ( r->reply()->error() == QNetworkReply::NoError )
{
QJson::Parser p;
bool ok;
QVariantMap res = p.parse( r->reply(), &ok ).toMap();
QByteArray jsonData = r->reply()->readAll();
QVariantMap res = TomahawkUtils::parseJson( jsonData, &ok ).toMap();
if ( !ok )
{
tLog() << "Failed to parse json from Spotify browse item:" << p.errorString() << "On line" << p.errorLine();
tLog() << "Failed to parse json from Spotify browse item:" << jsonData;
checkTrackFinished();
return;
}
@ -300,13 +298,13 @@ SpotifyParser::spotifyTrackLookupFinished()
if ( r->reply()->error() == QNetworkReply::NoError )
{
QJson::Parser p;
bool ok;
QVariantMap res = p.parse( r->reply(), &ok ).toMap();
QByteArray jsonData = r->reply()->readAll();
QVariantMap res = TomahawkUtils::parseJson( jsonData, &ok ).toMap();
if ( !ok )
{
tLog() << "Failed to parse json from Spotify track lookup:" << p.errorString() << "On line" << p.errorLine();
tLog() << "Failed to parse json from Spotify track lookup:" << jsonData;
checkTrackFinished();
return;
}