Persistent msg cache, do not save on exit.

This commit is contained in:
Martin Rotter 2017-09-13 08:16:04 +02:00
parent 3e4b23886c
commit 49fda7a6b6
5 changed files with 6 additions and 6 deletions

View File

@ -271,8 +271,6 @@ void FeedReader::quit() {
m_autoUpdateTimer->stop();
}
checkServicesForAsyncOperations(false, true);
// Close worker threads.
if (m_feedDownloaderThread != nullptr && m_feedDownloaderThread->isRunning()) {
m_feedDownloader->stopRunningUpdate();

View File

@ -125,8 +125,6 @@ void CacheForServiceRoot::loadCacheFromFile(int accId) {
file.remove();
}
// TODO: TODO
m_cacheSaveMutex->unlock();
}

View File

@ -40,6 +40,7 @@ bool ServiceRoot::deleteViaGui() {
QSqlDatabase database = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings);
if (DatabaseQueries::deleteAccount(database, accountId())) {
stop();
requestItemRemoval(this);
return true;
}

View File

@ -92,7 +92,7 @@ RecycleBin* OwnCloudServiceRoot::recycleBin() const {
void OwnCloudServiceRoot::start(bool freshly_activated) {
Q_UNUSED(freshly_activated)
loadFromDatabase();
//loadCacheFromFile(accountId());
loadCacheFromFile(accountId());
if (qApp->isFirstRun(QSL("3.1.1")) || (childCount() == 1 && child(0)->kind() == RootItemKind::Bin)) {
syncIn();
@ -100,7 +100,7 @@ void OwnCloudServiceRoot::start(bool freshly_activated) {
}
void OwnCloudServiceRoot::stop() {
//saveCacheToFile(accountId());
saveCacheToFile(accountId());
}
QString OwnCloudServiceRoot::code() const {

View File

@ -51,6 +51,7 @@ TtRssServiceRoot::~TtRssServiceRoot() {
void TtRssServiceRoot::start(bool freshly_activated) {
Q_UNUSED(freshly_activated)
loadFromDatabase();
loadCacheFromFile(accountId());
if (qApp->isFirstRun(QSL("3.1.1")) || (childCount() == 1 && child(0)->kind() == RootItemKind::Bin)) {
syncIn();
@ -58,6 +59,8 @@ void TtRssServiceRoot::start(bool freshly_activated) {
}
void TtRssServiceRoot::stop() {
saveCacheToFile(accountId());
m_network->logout();
qDebug("Stopping Tiny Tiny RSS account, logging out with result '%d'.", (int) m_network->lastError());
}