Changeset View
Changeset View
Standalone View
Standalone View
src/lib/query.cpp
Show First 20 Lines • Show All 240 Lines • ▼ Show 20 Line(s) | 240 | if (d->m_sortingOption != SortAuto) | |||
---|---|---|---|---|---|
241 | map[QStringLiteral("sortingOption")] = static_cast<int>(d->m_sortingOption); | 241 | map[QStringLiteral("sortingOption")] = static_cast<int>(d->m_sortingOption); | ||
242 | 242 | | |||
243 | if (!d->m_includeFolder.isEmpty()) | 243 | if (!d->m_includeFolder.isEmpty()) | ||
244 | map[QStringLiteral("includeFolder")] = d->m_includeFolder; | 244 | map[QStringLiteral("includeFolder")] = d->m_includeFolder; | ||
245 | 245 | | |||
246 | QJsonObject jo = QJsonObject::fromVariantMap(map); | 246 | QJsonObject jo = QJsonObject::fromVariantMap(map); | ||
247 | QJsonDocument jdoc; | 247 | QJsonDocument jdoc; | ||
248 | jdoc.setObject(jo); | 248 | jdoc.setObject(jo); | ||
249 | return jdoc.toJson(); | 249 | return jdoc.toJson(QJsonDocument::JsonFormat::Compact); | ||
250 | } | 250 | } | ||
251 | 251 | | |||
252 | // static | 252 | // static | ||
253 | Query Query::fromJSON(const QByteArray& arr) | 253 | Query Query::fromJSON(const QByteArray& arr) | ||
254 | { | 254 | { | ||
255 | QJsonDocument jdoc = QJsonDocument::fromJson(arr); | 255 | QJsonDocument jdoc = QJsonDocument::fromJson(arr); | ||
256 | const QVariantMap map = jdoc.object().toVariantMap(); | 256 | const QVariantMap map = jdoc.object().toVariantMap(); | ||
257 | 257 | | |||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |