mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Follow project coding style. Issue #2192.
This commit is contained in:
@@ -42,23 +42,23 @@
|
||||
|
||||
namespace json {
|
||||
|
||||
inline QByteArray toJson(const QVariant& var)
|
||||
{
|
||||
inline QByteArray toJson(const QVariant& var)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
return QJsonDocument::fromVariant(var).toJson();
|
||||
return QJsonDocument::fromVariant(var).toJson();
|
||||
#else
|
||||
return QJson::Serializer().serialize(var);
|
||||
return QJson::Serializer().serialize(var);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
inline QVariant fromJson(const QString& json)
|
||||
{
|
||||
inline QVariant fromJson(const QString& json)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
return QJsonDocument::fromJson(json.toUtf8()).toVariant();
|
||||
return QJsonDocument::fromJson(json.toUtf8()).toVariant();
|
||||
#else
|
||||
return QJson::Parser().parse(json.toUtf8());
|
||||
return QJson::Parser().parse(json.toUtf8());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user