switch back to json lohman - qtjson in new branch for more testing

This commit is contained in:
DenioD
2020-07-05 20:06:35 +02:00
parent 362e93f0b3
commit 460974f594
28 changed files with 19342 additions and 466 deletions

View File

@@ -59,16 +59,15 @@ void ChatDataStore::setPassword(QString password)
QString ChatDataStore::dump()
{
QJsonObject chats;
chats["count"] = (qint64)this->data.size();
QJsonArray j;
json chats;
chats["count"] = this->data.size();
json j = {};
for (auto &c: this->data)
{
j.push_back(c.second.toJson());
}
chats["chatitems"] = j;
QJsonDocument jd_chats = QJsonDocument(chats);
return QLatin1String(jd_chats.toJson(QJsonDocument::Compact));
return QString::fromStdString(chats.dump());
}
std::map<QString, ChatItem> ChatDataStore::getAllRawChatItems()