1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 11:04:01 +02:00

Remove QJson usage from Connection

This commit is contained in:
Uwe L. Korn
2014-04-13 21:42:45 +01:00
parent a41e604f83
commit ef9a20bcc6

View File

@@ -25,12 +25,11 @@
#include "network/Servent.h" #include "network/Servent.h"
#include "network/Msg.h" #include "network/Msg.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/TomahawkUtils.h"
#include "QTcpSocketExtra.h" #include "QTcpSocketExtra.h"
#include "Source.h" #include "Source.h"
#include <qjson/serializer.h>
#include <QTime> #include <QTime>
#include <QThread> #include <QThread>
@@ -92,8 +91,7 @@ Connection::handleIncomingQueueEmpty()
void void
Connection::setFirstMessage( const QVariant& m ) Connection::setFirstMessage( const QVariant& m )
{ {
QJson::Serializer ser; const QByteArray ba = TomahawkUtils::toJson( m );
const QByteArray ba = ser.serialize( m );
//qDebug() << "first msg json len:" << ba.length(); //qDebug() << "first msg json len:" << ba.length();
setFirstMessage( Msg::factory( ba, Msg::JSON ) ); setFirstMessage( Msg::factory( ba, Msg::JSON ) );
} }
@@ -632,8 +630,7 @@ Connection::sendMsg( QVariant j )
if ( d->do_shutdown ) if ( d->do_shutdown )
return; return;
QJson::Serializer serializer; const QByteArray payload = TomahawkUtils::toJson( j );
const QByteArray payload = serializer.serialize( j );
tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Sending to" << id() << ":" << payload; tLog( LOGVERBOSE ) << Q_FUNC_INFO << "Sending to" << id() << ":" << payload;
sendMsg( Msg::factory( payload, Msg::JSON ) ); sendMsg( Msg::factory( payload, Msg::JSON ) );
} }