summary refs log tree commit diff
path: root/src/Cache.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-21 21:43:21 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-21 21:43:21 +0200
commitc59cd0e80bcbf1e37b7d6b021275d4c8f90f1914 (patch)
treee809690d042aca74c620b09f4a9f471cbe2240a3 /src/Cache.cc
parentRefactor avatar fetching in one function (diff)
downloadnheko-c59cd0e80bcbf1e37b7d6b021275d4c8f90f1914.tar.xz
Load the initial cache data without blocking the UI
Diffstat (limited to 'src/Cache.cc')
-rw-r--r--src/Cache.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Cache.cc b/src/Cache.cc

index fd6a5ee9..32176369 100644 --- a/src/Cache.cc +++ b/src/Cache.cc
@@ -33,8 +33,9 @@ static const lmdb::val CACHE_FORMAT_VERSION_KEY("cache_format_version"); using CachedReceipts = std::multimap<uint64_t, std::string, std::greater<uint64_t>>; using Receipts = std::map<std::string, std::map<std::string, uint64_t>>; -Cache::Cache(const QString &userId) - : env_{nullptr} +Cache::Cache(const QString &userId, QObject *parent) + : QObject{parent} + , env_{nullptr} , stateDb_{0} , roomDb_{0} , invitesDb_{0} @@ -248,7 +249,7 @@ Cache::removeInvite(const QString &room_id) txn.commit(); } -QMap<QString, RoomState> +void Cache::states() { QMap<QString, RoomState> states; @@ -301,7 +302,7 @@ Cache::states() txn.commit(); - return states; + emit statesLoaded(states); } void