aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-04-13 20:32:08 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-04-13 20:33:00 +0900
commit139a6743a4e7a3b2e380d4f3e8f43558bc3164fa (patch)
tree7bf5321a78d731299d68973316a1843c0d238f85 /lib/connection.cpp
parentbf1dc1484ad5aefd5b86f7f79f23f5d6fc9b940a (diff)
downloadlibquotient-139a6743a4e7a3b2e380d4f3e8f43558bc3164fa.tar.gz
libquotient-139a6743a4e7a3b2e380d4f3e8f43558bc3164fa.zip
Support Qt 5.4
That is until ubports move to xenial.
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 600ab396..241fa43d 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -84,7 +84,7 @@ class Connection::Private
QVector<QString> roomIdsToForget;
QMap<QString, User*> userMap;
DirectChatsMap directChats;
- QHash<QString, QVariantHash> accountData;
+ QHash<QString, AccountDataMap> accountData;
QString userId;
SyncJob* syncJob = nullptr;
@@ -336,7 +336,7 @@ void Connection::onSyncSuccess(SyncData &&data) {
continue;
}
d->accountData[accountEvent->jsonType()] =
- accountEvent->contentJson().toVariantHash();
+ fromJson<AccountDataMap>(accountEvent->contentJson());
emit accountDataChanged(accountEvent->jsonType());
}
}
@@ -657,7 +657,7 @@ bool Connection::hasAccountData(const QString& type) const
return d->accountData.contains(type);
}
-QVariantHash Connection::accountData(const QString& type) const
+Connection::AccountDataMap Connection::accountData(const QString& type) const
{
return d->accountData.value(type);
}
@@ -909,7 +909,7 @@ void Connection::saveState(const QUrl &toFile) const
for (auto it = d->accountData.begin(); it != d->accountData.end(); ++it)
accountDataEvents.append(QJsonObject {
{"type", it.key()},
- {"content", QJsonObject::fromVariantHash(it.value())}
+ {"content", QMatrixClient::toJson(it.value())}
});
rootObj.insert("account_data",
QJsonObject {{ QStringLiteral("events"), accountDataEvents }});