mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Save article 'read' state on exit
This commit is contained in:
parent
405885209b
commit
9b121fd5d0
@ -108,6 +108,7 @@ void RssArticle::markAsRead() {
|
|||||||
|
|
||||||
m_read = true;
|
m_read = true;
|
||||||
m_parent->decrementUnreadCount();
|
m_parent->decrementUnreadCount();
|
||||||
|
m_parent->markAsDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString& RssArticle::guid() const
|
const QString& RssArticle::guid() const
|
||||||
|
@ -83,7 +83,7 @@ void RssFeed::saveItemsToDisk()
|
|||||||
qDebug() << Q_FUNC_INFO << m_url;
|
qDebug() << Q_FUNC_INFO << m_url;
|
||||||
if (!m_dirty)
|
if (!m_dirty)
|
||||||
return;
|
return;
|
||||||
m_dirty = false;
|
markAsDirty(false);
|
||||||
|
|
||||||
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
QIniSettings qBTRSS("qBittorrent", "qBittorrent-rss");
|
||||||
QVariantList old_items;
|
QVariantList old_items;
|
||||||
@ -248,6 +248,11 @@ void RssFeed::markAsRead()
|
|||||||
m_manager->forwardFeedInfosChanged(m_url, displayName(), 0);
|
m_manager->forwardFeedInfosChanged(m_url, displayName(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RssFeed::markAsDirty(bool dirty)
|
||||||
|
{
|
||||||
|
m_dirty = dirty;
|
||||||
|
}
|
||||||
|
|
||||||
uint RssFeed::unreadCount() const
|
uint RssFeed::unreadCount() const
|
||||||
{
|
{
|
||||||
return m_unreadCount;
|
return m_unreadCount;
|
||||||
@ -356,7 +361,7 @@ void RssFeed::handleNewArticle(const QString& feedUrl, const QVariantHash& artic
|
|||||||
if (m_articles.contains(guid))
|
if (m_articles.contains(guid))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_dirty = true;
|
markAsDirty();
|
||||||
|
|
||||||
RssArticlePtr article = hashToRssArticle(this, articleData);
|
RssArticlePtr article = hashToRssArticle(this, articleData);
|
||||||
Q_ASSERT(article);
|
Q_ASSERT(article);
|
||||||
|
@ -72,6 +72,7 @@ public:
|
|||||||
RssArticlePtr getItem(const QString &guid) const;
|
RssArticlePtr getItem(const QString &guid) const;
|
||||||
uint count() const;
|
uint count() const;
|
||||||
virtual void markAsRead();
|
virtual void markAsRead();
|
||||||
|
void markAsDirty(bool dirty = true);
|
||||||
virtual uint unreadCount() const;
|
virtual uint unreadCount() const;
|
||||||
virtual RssArticleList articleListByDateDesc() const;
|
virtual RssArticleList articleListByDateDesc() const;
|
||||||
const RssArticleHash& articleHash() const { return m_articles; }
|
const RssArticleHash& articleHash() const { return m_articles; }
|
||||||
|
Loading…
Reference in New Issue
Block a user