Save cache before feed update.

This commit is contained in:
Martin Rotter 2017-10-10 13:27:14 +02:00
parent 0814528e03
commit d7ba368a02
5 changed files with 8 additions and 13 deletions

View file

@ -1,3 +1,10 @@
3.5.1
—————
Added:
▪ Inoreader plugin can mark messages starred.
▪ All cached online service data are synchronously saved when any feed is updated.
3.5.0 3.5.0
————— —————

View file

@ -53,7 +53,7 @@ void FeedDownloader::updateAvailableFeeds() {
foreach (const Feed* feed, m_feeds) { foreach (const Feed* feed, m_feeds) {
CacheForServiceRoot* cache = dynamic_cast<CacheForServiceRoot*>(feed->getParentServiceRoot()); CacheForServiceRoot* cache = dynamic_cast<CacheForServiceRoot*>(feed->getParentServiceRoot());
if (cache != nullptr && caches.contains(cache)) { if (cache != nullptr && !caches.contains(cache)) {
caches.append(cache); caches.append(cache);
} }
} }

View file

@ -166,10 +166,6 @@ void InoreaderServiceRoot::addNewFeed(const QString& url) {
void InoreaderServiceRoot::addNewCategory() {} void InoreaderServiceRoot::addNewCategory() {}
void InoreaderServiceRoot::saveAllCachedData(bool async) { void InoreaderServiceRoot::saveAllCachedData(bool async) {
Q_UNUSED(async)
// TODO: implementovat toto, aby bylo možno ukládat data i synchronně
QPair<QMap<RootItem::ReadStatus, QStringList>, QMap<RootItem::Importance, QList<Message>>> msgCache = takeMessageCache(); QPair<QMap<RootItem::ReadStatus, QStringList>, QMap<RootItem::Importance, QList<Message>>> msgCache = takeMessageCache();
QMapIterator<RootItem::ReadStatus, QStringList> i(msgCache.first); QMapIterator<RootItem::ReadStatus, QStringList> i(msgCache.first);

View file

@ -107,10 +107,6 @@ OwnCloudNetworkFactory* OwnCloudServiceRoot::network() const {
} }
void OwnCloudServiceRoot::saveAllCachedData(bool async) { void OwnCloudServiceRoot::saveAllCachedData(bool async) {
Q_UNUSED(async)
// TODO: implementovat toto, aby bylo možno ukládat data i synchronně
QPair<QMap<RootItem::ReadStatus, QStringList>, QMap<RootItem::Importance, QList<Message>>> msgCache = takeMessageCache(); QPair<QMap<RootItem::ReadStatus, QStringList>, QMap<RootItem::Importance, QList<Message>>> msgCache = takeMessageCache();
QMapIterator<RootItem::ReadStatus, QStringList> i(msgCache.first); QMapIterator<RootItem::ReadStatus, QStringList> i(msgCache.first);

View file

@ -126,10 +126,6 @@ bool TtRssServiceRoot::canBeDeleted() const {
} }
void TtRssServiceRoot::saveAllCachedData(bool async) { void TtRssServiceRoot::saveAllCachedData(bool async) {
Q_UNUSED(async)
// TODO: implementovat toto, aby bylo možno ukládat data i synchronně
QPair<QMap<RootItem::ReadStatus, QStringList>, QMap<RootItem::Importance, QList<Message>>> msgCache = takeMessageCache(); QPair<QMap<RootItem::ReadStatus, QStringList>, QMap<RootItem::Importance, QList<Message>>> msgCache = takeMessageCache();
QMapIterator<RootItem::ReadStatus, QStringList> i(msgCache.first); QMapIterator<RootItem::ReadStatus, QStringList> i(msgCache.first);