Browse Source

Merge pull request #377 from Gelmir/feedreader_statesave

Save article 'read' state on exit
adaptive-webui-19844
Christophe Dumez 12 years ago
parent
commit
3e7329fb07
  1. 1
      src/rss/rssarticle.cpp
  2. 9
      src/rss/rssfeed.cpp
  3. 1
      src/rss/rssfeed.h

1
src/rss/rssarticle.cpp

@ -108,6 +108,7 @@ void RssArticle::markAsRead() { @@ -108,6 +108,7 @@ void RssArticle::markAsRead() {
m_read = true;
m_parent->decrementUnreadCount();
m_parent->markAsDirty();
}
const QString& RssArticle::guid() const

9
src/rss/rssfeed.cpp

@ -83,7 +83,7 @@ void RssFeed::saveItemsToDisk() @@ -83,7 +83,7 @@ void RssFeed::saveItemsToDisk()
qDebug() << Q_FUNC_INFO << m_url;
if (!m_dirty)
return;
m_dirty = false;
markAsDirty(false);
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
QVariantList old_items;
@ -248,6 +248,11 @@ void RssFeed::markAsRead() @@ -248,6 +248,11 @@ void RssFeed::markAsRead()
m_manager->forwardFeedInfosChanged(m_url, displayName(), 0);
}
void RssFeed::markAsDirty(bool dirty)
{
m_dirty = dirty;
}
uint RssFeed::unreadCount() const
{
return m_unreadCount;
@ -356,7 +361,7 @@ void RssFeed::handleNewArticle(const QString& feedUrl, const QVariantHash& artic @@ -356,7 +361,7 @@ void RssFeed::handleNewArticle(const QString& feedUrl, const QVariantHash& artic
if (m_articles.contains(guid))
return;
m_dirty = true;
markAsDirty();
RssArticlePtr article = hashToRssArticle(this, articleData);
Q_ASSERT(article);

1
src/rss/rssfeed.h

@ -72,6 +72,7 @@ public: @@ -72,6 +72,7 @@ public:
RssArticlePtr getItem(const QString &guid) const;
uint count() const;
virtual void markAsRead();
void markAsDirty(bool dirty = true);
virtual uint unreadCount() const;
virtual RssArticleList articleListByDateDesc() const;
const RssArticleHash& articleHash() const { return m_articles; }

Loading…
Cancel
Save