Commit bb7f35c7 authored by Erik van 't Wout's avatar Erik van 't Wout Committed by Jonathan Marten

Do not remove read messages from the unread filter immediately

Otherwise, when using the filter, the next message will also be selected
and immediately marked as read, until the feed is empty.

BUG:350731

Differential Revision: https://phabricator.kde.org/D7928
parent f475ea83
......@@ -386,7 +386,7 @@ void Article::setStatus(int stat)
d->archive->setStatus(d->guid, d->status);
}
if (d->feed) {
d->feed->setArticleChanged(*this, oldStatus);
d->feed->setArticleChanged(*this, oldStatus, stat != Read);
}
}
}
......
......@@ -828,10 +828,10 @@ void Akregator::Feed::setArticleDeleted(Article &a)
articlesModified();
}
void Akregator::Feed::setArticleChanged(Article &a, int oldStatus)
void Akregator::Feed::setArticleChanged(Article &a, int oldStatus, bool process)
{
int newStatus = a.status();
if (oldStatus != -1) {
int newStatus = a.status();
if (oldStatus == Read && newStatus != Read) {
setUnread(unread() + 1);
} else if (oldStatus != Read && newStatus == Read) {
......@@ -839,7 +839,9 @@ void Akregator::Feed::setArticleChanged(Article &a, int oldStatus)
}
}
d->updatedArticlesNotify.append(a);
articlesModified();
if (process) {
articlesModified();
}
}
int Akregator::Feed::totalCount() const
......
......@@ -264,11 +264,14 @@ private:
*/
void setArticleDeleted(Article &a);
/** notifies that article @c mya was changed
@param oldStatus if the status was changed, it contains the old status, -1 otherwise
/** Notifies that article @p a was changed.
@param oldStatus The old status if the status was changed,
or -1 if the status was not changed
@param process Set to @c false to disable processing the change
(updating article list and updating on-screen unread count)
To be called by @ref Article
*/
void setArticleChanged(Article &a, int oldStatus = -1);
void setArticleChanged(Article &a, int oldStatus = -1, bool process = true);
void appendArticles(const Syndication::FeedPtr &feed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment