Remove cache data when the user logs out

This commit is contained in:
Konstantinos Sideris 2017-08-26 14:31:23 +03:00
parent 7fbfe3af15
commit 177dd6a5b0
3 changed files with 16 additions and 1 deletions

View file

@ -83,7 +83,10 @@ Cache::Cache(const QString &userId)
txn.commit();
isMounted_ = true;
isMounted_ = true;
cacheDirectory_ = QString("%1/%2")
.arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation))
.arg(QString::fromUtf8(userId_.toUtf8().toHex()));
}
void

View file

@ -194,6 +194,8 @@ ChatPage::logout()
settings.remove("");
settings.endGroup();
cache_->deleteData();
// Clear the environment.
room_list_->clear();
view_manager_->clearAll();