mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02:00
Remove QJson usage from Hatchet
This commit is contained in:
@@ -20,11 +20,11 @@
|
||||
#include <QHostInfo>
|
||||
|
||||
#include "HatchetAccountConfig.h"
|
||||
#include "sip/HatchetSip.h"
|
||||
#include "utils/Closure.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "sip/HatchetSip.h"
|
||||
#include "utils/TomahawkUtils.h"
|
||||
#include "utils/NetworkAccessManager.h"
|
||||
#include "utils/TomahawkUtils.h"
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QFile>
|
||||
@@ -34,9 +34,6 @@
|
||||
#include <QUrl>
|
||||
#include <QUuid>
|
||||
|
||||
#include <qjson/parser.h>
|
||||
#include <qjson/serializer.h>
|
||||
|
||||
using namespace Tomahawk;
|
||||
using namespace Accounts;
|
||||
|
||||
@@ -538,9 +535,8 @@ HatchetAccount::parseReply( QNetworkReply* reply, bool& okRet ) const
|
||||
return resp;
|
||||
}
|
||||
|
||||
QJson::Parser p;
|
||||
QByteArray replyData = reply->readAll();
|
||||
resp = p.parse( replyData, &ok ).toMap();
|
||||
resp = TomahawkUtils::parseJson( replyData, &ok ).toMap();
|
||||
|
||||
if ( !ok )
|
||||
{
|
||||
|
@@ -32,9 +32,6 @@
|
||||
#include <utils/Logger.h>
|
||||
#include <SourceList.h>
|
||||
|
||||
#include <qjson/parser.h>
|
||||
#include <qjson/serializer.h>
|
||||
|
||||
#include <QFile>
|
||||
#include <QHostInfo>
|
||||
#include <QUuid>
|
||||
@@ -248,8 +245,7 @@ HatchetSipPlugin::sendBytes( const QVariantMap& jsonMap ) const
|
||||
return false;
|
||||
}
|
||||
|
||||
QJson::Serializer serializer;
|
||||
QByteArray bytes = serializer.serialize( jsonMap );
|
||||
QByteArray bytes = TomahawkUtils::toJson( jsonMap );
|
||||
if ( bytes.isEmpty() )
|
||||
{
|
||||
tLog() << Q_FUNC_INFO << "could not serialize register structure to JSON";
|
||||
@@ -267,9 +263,8 @@ HatchetSipPlugin::messageReceived( const QByteArray &msg )
|
||||
{
|
||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "WebSocket message: " << msg;
|
||||
|
||||
QJson::Parser parser;
|
||||
bool ok;
|
||||
QVariant jsonVariant = parser.parse( msg, &ok );
|
||||
QVariant jsonVariant = TomahawkUtils::parseJson( msg, &ok );
|
||||
if ( !jsonVariant.isValid() )
|
||||
{
|
||||
tLog() << Q_FUNC_INFO << "Failed to parse message back from server";
|
||||
|
Reference in New Issue
Block a user