mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 18:26:11 +03:00
Use compact style of JSON data
This commit is contained in:
parent
bed0784a2d
commit
ba86d16e78
1 changed files with 4 additions and 2 deletions
|
@ -45,9 +45,11 @@ namespace json {
|
|||
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(QJsonDocument::Compact);
|
||||
#else
|
||||
return QJson::Serializer().serialize(var);
|
||||
QJson::Serializer serializer;
|
||||
serializer.setIndentMode(QJson::IndentCompact);
|
||||
return serializer.serialize(var);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue