Commit be2c1901 authored by Karel Slaný's avatar Karel Slaný
Browse files

Reopening database if toggling ephemeral value.

parent 218d2acc
......@@ -209,27 +209,32 @@ void Accounts::updateAccount(const QString &loginMetod,
acntData.setPassword(pwd.trimmed());
acntData.setTestAccount(isTestAccount);
acntData.setRememberPwd(rememberPwd);
#if 0
bool oldStoreToDisk = acntData.storeToDisk();
/* Reopen database if storeToDisk changed. */
if (acntData.storeToDisk() != storeToDisk) {
MessageDb *mDb = globMessageDbsPtr->accessMessageDb(
globSet.dbsLocation, userName);
globSet.dbsLocation, userName, oldStoreToDisk);
if (mDb != NULL) {
QString mDbFileName(mDb->fileName());
/* Reopen database. */
mDb->openDb(globSet.dbsLocation, storeToDisk);
if (!storeToDisk) {
globMessageDbsPtr->deleteDb(mDb);
globMessageDbsPtr->accessMessageDb(globSet.dbsLocation,
userName, storeToDisk);
if (oldStoreToDisk) {
/* Delete databases from storage. */
QFile::remove(mDbFileName);
}
}
FileDb *fDb = globFileDbsPtr->accessFileDb(
globSet.dbsLocation, userName);
globSet.dbsLocation, userName, oldStoreToDisk);
if (fDb != NULL) {
QString fDbFileName(fDb->fileName());
/* Reopen database. */
fDb->openDb(globSet.dbsLocation, storeToDisk);
if (!storeToDisk) {
globFileDbsPtr->deleteDb(fDb);
globFileDbsPtr->accessFileDb(globSet.dbsLocation,
userName, storeToDisk);
if (oldStoreToDisk) {
/* Delete databases from storage. */
QFile::remove(fDbFileName);
}
......@@ -238,7 +243,7 @@ void Accounts::updateAccount(const QString &loginMetod,
/* Inform the model that message counters have changed. */
globAccountsModelPtr->updateCounters(userName, 0, 0, 0, 0);
}
#endif
acntData.setStoreToDisk(storeToDisk);
QUrl url(certPath, QUrl::TolerantMode);
url.toLocalFile();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment