mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 16:44:05 +02:00
Remove QJson usage from SipInfo
This commit is contained in:
@@ -20,9 +20,7 @@
|
|||||||
#include "SipInfo.h"
|
#include "SipInfo.h"
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/TomahawkUtils.h"
|
||||||
#include <qjson/parser.h>
|
|
||||||
#include <qjson/serializer.h>
|
|
||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
@@ -202,8 +200,7 @@ SipInfo::toJson() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// serialize
|
// serialize
|
||||||
QJson::Serializer serializer;
|
QByteArray ba = TomahawkUtils::toJson( m );
|
||||||
QByteArray ba = serializer.serialize( m );
|
|
||||||
|
|
||||||
return QString::fromLatin1( ba );
|
return QString::fromLatin1( ba );
|
||||||
}
|
}
|
||||||
@@ -214,9 +211,8 @@ SipInfo::fromJson( QString json )
|
|||||||
{
|
{
|
||||||
SipInfo info;
|
SipInfo info;
|
||||||
|
|
||||||
QJson::Parser parser;
|
|
||||||
bool ok;
|
bool ok;
|
||||||
QVariant v = parser.parse( json.toLatin1(), &ok );
|
QVariant v = TomahawkUtils::parseJson( json.toLatin1(), &ok );
|
||||||
if ( !ok || v.type() != QVariant::Map )
|
if ( !ok || v.type() != QVariant::Map )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO << "Invalid JSON: " << json;
|
qDebug() << Q_FUNC_INFO << "Invalid JSON: " << json;
|
||||||
|
Reference in New Issue
Block a user