From 88349eae90cc842427392ababb7903a242f17a94 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Tue, 3 Oct 2017 21:16:31 +0300 Subject: Recover from corrupted cache data Make Cache constructor exception free fixes #74 --- include/Cache.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include/Cache.h') diff --git a/include/Cache.h b/include/Cache.h index 0f6e5cd2..3a98fddc 100644 --- a/include/Cache.h +++ b/include/Cache.h @@ -35,9 +35,9 @@ public: inline void deleteData(); inline void unmount(); - inline QString memberDbName(const QString &roomid); void removeRoom(const QString &roomid); + void setup(); private: void setNextBatchToken(lmdb::txn &txn, const QString &token); @@ -59,15 +59,11 @@ Cache::unmount() isMounted_ = false; } -inline QString -Cache::memberDbName(const QString &roomid) -{ - return QString("m.%1").arg(roomid); -} - inline void Cache::deleteData() { + qInfo() << "Deleting cache data"; + if (!cacheDirectory_.isEmpty()) QDir(cacheDirectory_).removeRecursively(); } -- cgit 1.5.1