Qtification "lite" - first round

This commit is contained in:
miodragpop
2020-06-15 13:11:39 +02:00
parent efa216a131
commit e20efde2ed
29 changed files with 859 additions and 19772 deletions

View File

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