From c59cd0e80bcbf1e37b7d6b021275d4c8f90f1914 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sun, 21 Jan 2018 21:43:21 +0200 Subject: Load the initial cache data without blocking the UI --- src/Cache.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Cache.cc') 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>; using Receipts = std::map>; -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 +void Cache::states() { QMap states; @@ -301,7 +302,7 @@ Cache::states() txn.commit(); - return states; + emit statesLoaded(states); } void -- cgit 1.5.1