mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Remove QJson usage from Playdar API
This commit is contained in:
@@ -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() )
|
||||||
{
|
{
|
||||||
|
@@ -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>
|
||||||
|
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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}
|
||||||
|
Reference in New Issue
Block a user