mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
Remove QJson::Parser usage from Rovi
This commit is contained in:
@@ -22,8 +22,6 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/NetworkAccessManager.h"
|
#include "utils/NetworkAccessManager.h"
|
||||||
|
|
||||||
#include <qjson/parser.h>
|
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
|
|
||||||
@@ -128,13 +126,13 @@ RoviPlugin::albumLookupFinished()
|
|||||||
|
|
||||||
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
|
Tomahawk::InfoSystem::InfoRequestData requestData = reply->property( "requestData" ).value< Tomahawk::InfoSystem::InfoRequestData >();
|
||||||
|
|
||||||
QJson::Parser p;
|
|
||||||
bool ok;
|
bool ok;
|
||||||
QVariantMap response = p.parse( reply, &ok ).toMap();
|
QByteArray jsonData = reply->readAll();
|
||||||
|
QVariantMap response = TomahawkUtils::parseJson( jsonData, &ok ).toMap();
|
||||||
|
|
||||||
if ( !ok || response.isEmpty() || !response.contains( "searchResponse" ) )
|
if ( !ok || response.isEmpty() || !response.contains( "searchResponse" ) )
|
||||||
{
|
{
|
||||||
tLog() << "Error parsing JSON from Rovi!" << p.errorString() << response;
|
tLog() << "Error parsing JSON from Rovi!" << jsonData;
|
||||||
emit info( requestData, QVariant() );
|
emit info( requestData, QVariant() );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -151,7 +149,7 @@ RoviPlugin::albumLookupFinished()
|
|||||||
|
|
||||||
if ( tracks.isEmpty() )
|
if ( tracks.isEmpty() )
|
||||||
{
|
{
|
||||||
tLog() << "Error parsing JSON from Rovi!" << p.errorString() << response;
|
tLog() << "Error parsing JSON from Rovi!" << jsonData;
|
||||||
emit info( requestData, QVariant() );
|
emit info( requestData, QVariant() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user