mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-26 15:34:59 +01:00
Save cached data before feed update too.
This commit is contained in:
parent
a2e1043d85
commit
49f76775f4
@ -160,6 +160,9 @@ void Feed::run() {
|
|||||||
<< customId() << " in thread: \'"
|
<< customId() << " in thread: \'"
|
||||||
<< QThread::currentThreadId() << "\'.";
|
<< QThread::currentThreadId() << "\'.";
|
||||||
|
|
||||||
|
// Save all cached data first.
|
||||||
|
getParentServiceRoot()->saveAllCachedData();
|
||||||
|
|
||||||
bool error_during_obtaining;
|
bool error_during_obtaining;
|
||||||
QList<Message> msgs = obtainNewMessages(&error_during_obtaining);
|
QList<Message> msgs = obtainNewMessages(&error_during_obtaining);
|
||||||
|
|
||||||
|
@ -135,13 +135,14 @@ void OwnCloudServiceRoot::addMessageStatesToCache(const QStringList &ids_of_mess
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OwnCloudServiceRoot::saveAllCachedData() {
|
void OwnCloudServiceRoot::saveAllCachedData() {
|
||||||
|
m_cacheSaveMutex->lock();
|
||||||
|
|
||||||
if (m_cachedStatesRead.isEmpty() && m_cachedStatesImportant.isEmpty()) {
|
if (m_cachedStatesRead.isEmpty() && m_cachedStatesImportant.isEmpty()) {
|
||||||
// No cached changes.
|
// No cached changes.
|
||||||
|
m_cacheSaveMutex->unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_cacheSaveMutex->lock();
|
|
||||||
|
|
||||||
// Make copy of changes.
|
// Make copy of changes.
|
||||||
QMap<RootItem::ReadStatus, QStringList> cached_data_read = m_cachedStatesRead;
|
QMap<RootItem::ReadStatus, QStringList> cached_data_read = m_cachedStatesRead;
|
||||||
cached_data_read.detach();
|
cached_data_read.detach();
|
||||||
|
Loading…
Reference in New Issue
Block a user