mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02:00
Remove QJson usage from ScriptResolver
This commit is contained in:
@@ -158,7 +158,7 @@ ScriptResolver::sendConfig()
|
||||
hosts << host;
|
||||
m.insert( "noproxyhosts", hosts );
|
||||
|
||||
QByteArray data = m_serializer.serialize( m );
|
||||
QByteArray data = TomahawkUtils::toJson( m );
|
||||
sendMsg( data );
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ ScriptResolver::running() const
|
||||
void
|
||||
ScriptResolver::sendMessage( const QVariantMap& map )
|
||||
{
|
||||
QByteArray data = m_serializer.serialize( map );
|
||||
QByteArray data = TomahawkUtils::toJson( map );
|
||||
sendMsg( data );
|
||||
}
|
||||
|
||||
@@ -253,10 +253,10 @@ ScriptResolver::handleMsg( const QByteArray& msg )
|
||||
return;
|
||||
|
||||
bool ok;
|
||||
QVariant v = m_parser.parse( msg, &ok );
|
||||
QVariant v = TomahawkUtils::parseJson( msg, &ok );
|
||||
if ( !ok || v.type() != QVariant::Map )
|
||||
{
|
||||
Q_ASSERT(false);
|
||||
Q_ASSERT( false );
|
||||
return;
|
||||
}
|
||||
QVariantMap m = v.toMap();
|
||||
@@ -382,7 +382,7 @@ ScriptResolver::resolve( const Tomahawk::query_ptr& query )
|
||||
m.insert( "resultHint", query->resultHint() );
|
||||
}
|
||||
|
||||
const QByteArray msg = m_serializer.serialize( QVariant( m ) );
|
||||
const QByteArray msg = TomahawkUtils::toJson( QVariant( m ) );
|
||||
sendMsg( msg );
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ ScriptResolver::saveConfig()
|
||||
m.insert( "_msgtype", "setpref" );
|
||||
QVariant widgets = configMsgFromWidget( m_configWidget.data() );
|
||||
m.insert( "widgets", widgets );
|
||||
QByteArray data = m_serializer.serialize( m );
|
||||
QByteArray data = TomahawkUtils::toJson( m );
|
||||
|
||||
sendMsg( data );
|
||||
}
|
||||
|
@@ -28,10 +28,6 @@
|
||||
#include "ExternalResolverGui.h"
|
||||
#include "DllMacro.h"
|
||||
|
||||
#include <qjson/parser.h>
|
||||
#include <qjson/serializer.h>
|
||||
#include <qjson/qobjecthelper.h>
|
||||
|
||||
#include <QProcess>
|
||||
|
||||
class QWidget;
|
||||
@@ -109,9 +105,6 @@ private:
|
||||
|
||||
bool m_ready, m_stopped, m_configSent, m_deleting;
|
||||
ExternalResolver::ErrorState m_error;
|
||||
|
||||
QJson::Parser m_parser;
|
||||
QJson::Serializer m_serializer;
|
||||
};
|
||||
|
||||
#endif // SCRIPTRESOLVER_H
|
||||
|
Reference in New Issue
Block a user