From 6cefab4cc51da9057f3105fe5a9b4689f9c03a54 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <uwelk@xhochy.com>
Date: Sat, 12 Apr 2014 13:47:11 +0100
Subject: [PATCH] Drop QJson usage from SpotifyParser

---
 src/libtomahawk/utils/SpotifyParser.cpp | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/libtomahawk/utils/SpotifyParser.cpp b/src/libtomahawk/utils/SpotifyParser.cpp
index e9849472f..703a95dc9 100644
--- a/src/libtomahawk/utils/SpotifyParser.cpp
+++ b/src/libtomahawk/utils/SpotifyParser.cpp
@@ -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;
         }