1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 06:07:37 +02:00

Remove QJson usage from Playdar API

This commit is contained in:
Uwe L. Korn
2014-04-13 21:19:46 +01:00
parent 1e2ecc532a
commit ddf00b5991
4 changed files with 5 additions and 7 deletions

View File

@@ -455,9 +455,10 @@ Api_v1::get_results( QxtWebRequestEvent* event )
void void
Api_v1::sendJSON( const QVariantMap& m, QxtWebRequestEvent* event ) Api_v1::sendJSON( const QVariantMap& m, QxtWebRequestEvent* event )
{ {
QJson::Serializer ser;
QByteArray ctype; QByteArray ctype;
QByteArray body = ser.serialize( m ); bool ok;
QByteArray body = TomahawkUtils::toJson( m, &ok );
Q_ASSERT( ok );
if ( urlHasQueryItem( event->url, "jsonp" ) && !urlQueryItemValue( event->url, "jsonp" ).isEmpty() ) if ( urlHasQueryItem( event->url, "jsonp" ) && !urlQueryItemValue( event->url, "jsonp" ).isEmpty() )
{ {

View File

@@ -31,8 +31,6 @@
#include <QxtWeb/QxtWebSlotService> #include <QxtWeb/QxtWebSlotService>
#include <QxtWeb/QxtWebPageEvent> #include <QxtWeb/QxtWebPageEvent>
#include <qjson/serializer.h>
#include <QFile> #include <QFile>
#include <QSharedPointer> #include <QSharedPointer>
#include <QStringList> #include <QStringList>

View File

@@ -104,9 +104,8 @@ Api_v1_5::playback( QxtWebRequestEvent* event, const QString& command )
trackInfo.insert( "duration", currentTrack->track()->duration() ); trackInfo.insert( "duration", currentTrack->track()->duration() );
trackInfo.insert( "track", currentTrack->track()->track() ); trackInfo.insert( "track", currentTrack->track()->track() );
QJson::Serializer serializer;
bool ok; bool ok;
json = serializer.serialize( trackInfo, &ok ); json = TomahawkUtils::toJson( trackInfo, &ok );
Q_ASSERT( ok ); Q_ASSERT( ok );
} }

View File

@@ -10,7 +10,7 @@ list(APPEND ${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_SOURCES
list(APPEND ${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_UI list(APPEND ${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_UI
) )
include_directories(${QXTWEB_INCLUDE_DIRS} ${QJSON_INCLUDE_DIR}) include_directories(${QXTWEB_INCLUDE_DIRS})
tomahawk_add_library(${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET} tomahawk_add_library(${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}
SOURCES ${${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_SOURCES} SOURCES ${${TOMAHAWK_PLAYDARAPI_LIBRARY_TARGET}_SOURCES}