mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Remove QJson usage from Accounts
This commit is contained in:
@@ -28,8 +28,7 @@
|
|||||||
#else
|
#else
|
||||||
#include <qt5keychain/keychain.h>
|
#include <qt5keychain/keychain.h>
|
||||||
#endif
|
#endif
|
||||||
#include <qjson/serializer.h>
|
#include "utils/TomahawkUtils.h"
|
||||||
#include <qjson/parser.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@@ -218,9 +217,8 @@ CredentialsManager::setCredentials( const CredentialsStorageKey& csKey, const QV
|
|||||||
}
|
}
|
||||||
else if ( value.type() == QVariant::Hash )
|
else if ( value.type() == QVariant::Hash )
|
||||||
{
|
{
|
||||||
QJson::Serializer serializer;
|
|
||||||
bool ok;
|
bool ok;
|
||||||
QByteArray data = serializer.serialize( value.toHash(), &ok );
|
QByteArray data = TomahawkUtils::toJson( value.toHash(), &ok );
|
||||||
|
|
||||||
if ( ok )
|
if ( ok )
|
||||||
{
|
{
|
||||||
@@ -278,10 +276,9 @@ CredentialsManager::keychainJobFinished( QKeychain::Job* j )
|
|||||||
<< readJob->key() << "finished without errors";
|
<< readJob->key() << "finished without errors";
|
||||||
|
|
||||||
QVariant creds;
|
QVariant creds;
|
||||||
QJson::Parser parser;
|
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
creds = parser.parse( readJob->textData().toLatin1(), &ok );
|
creds = TomahawkUtils::parseJson( readJob->textData().toLatin1(), &ok );
|
||||||
|
|
||||||
QVariantMap map = creds.toMap();
|
QVariantMap map = creds.toMap();
|
||||||
QVariantHash hash;
|
QVariantHash hash;
|
||||||
|
@@ -39,8 +39,6 @@
|
|||||||
#include "TomahawkSettings.h"
|
#include "TomahawkSettings.h"
|
||||||
#include "TomahawkVersion.h"
|
#include "TomahawkVersion.h"
|
||||||
|
|
||||||
#include "qjson/parser.h"
|
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -228,9 +226,8 @@ ResolverAccountFactory::metadataFromJsonFile( const QString& path )
|
|||||||
QFile metadataFile( path );
|
QFile metadataFile( path );
|
||||||
if ( metadataFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
if ( metadataFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
||||||
{
|
{
|
||||||
QJson::Parser parser;
|
|
||||||
bool ok;
|
bool ok;
|
||||||
QVariantMap variant = parser.parse( metadataFile.readAll(), &ok ).toMap();
|
QVariantMap variant = TomahawkUtils::parseJson( metadataFile.readAll(), &ok ).toMap();
|
||||||
|
|
||||||
if ( ok )
|
if ( ok )
|
||||||
{
|
{
|
||||||
|
@@ -23,8 +23,6 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/NetworkAccessManager.h"
|
#include "utils/NetworkAccessManager.h"
|
||||||
|
|
||||||
#include <qjson/parser.h>
|
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
using namespace Tomahawk::InfoSystem;
|
using namespace Tomahawk::InfoSystem;
|
||||||
|
|
||||||
@@ -206,8 +204,7 @@ SpotifyInfoPlugin::albumIdLookupFinished( QNetworkReply* reply, const InfoReques
|
|||||||
|
|
||||||
if ( reply->error() == QNetworkReply::NoError )
|
if ( reply->error() == QNetworkReply::NoError )
|
||||||
{
|
{
|
||||||
QJson::Parser p;
|
const QVariantMap response = TomahawkUtils::parseJson( reply->readAll() ).toMap();
|
||||||
const QVariantMap response = p.parse( reply ).toMap();
|
|
||||||
if ( !response.contains( "albums" ) )
|
if ( !response.contains( "albums" ) )
|
||||||
{
|
{
|
||||||
dataError( requestData );
|
dataError( requestData );
|
||||||
@@ -254,8 +251,7 @@ SpotifyInfoPlugin::albumContentsLookupFinished( QNetworkReply* reply, const Info
|
|||||||
|
|
||||||
if ( reply->error() == QNetworkReply::NoError )
|
if ( reply->error() == QNetworkReply::NoError )
|
||||||
{
|
{
|
||||||
QJson::Parser p;
|
const QVariantMap response = TomahawkUtils::parseJson( reply->readAll() ).toMap();
|
||||||
const QVariantMap response = p.parse( reply ).toMap();
|
|
||||||
|
|
||||||
if ( !response.contains( "album" ) )
|
if ( !response.contains( "album" ) )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user