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