Changeset View
Changeset View
Standalone View
Standalone View
src/feed/feed.cpp
Show First 20 Lines • Show All 822 Lines • ▼ Show 20 Line(s) | 821 | { | |||
---|---|---|---|---|---|
823 | if (!d->deletedArticles.contains(a)) { | 823 | if (!d->deletedArticles.contains(a)) { | ||
824 | d->deletedArticles.append(a); | 824 | d->deletedArticles.append(a); | ||
825 | } | 825 | } | ||
826 | 826 | | |||
827 | d->updatedArticlesNotify.append(a); | 827 | d->updatedArticlesNotify.append(a); | ||
828 | articlesModified(); | 828 | articlesModified(); | ||
829 | } | 829 | } | ||
830 | 830 | | |||
831 | void Akregator::Feed::setArticleChanged(Article &a, int oldStatus) | 831 | void Akregator::Feed::setArticleChanged(Article &a, int oldStatus, bool process) | ||
832 | { | 832 | { | ||
833 | if (oldStatus != -1) { | | |||
834 | int newStatus = a.status(); | 833 | int newStatus = a.status(); | ||
834 | if (oldStatus != -1) { | ||||
anthonyfieroni: You get status from here, then check for it's read below, e.g. it does not need a 3-th parameter | |||||
835 | if (oldStatus == Read && newStatus != Read) { | 835 | if (oldStatus == Read && newStatus != Read) { | ||
836 | setUnread(unread() + 1); | 836 | setUnread(unread() + 1); | ||
837 | } else if (oldStatus != Read && newStatus == Read) { | 837 | } else if (oldStatus != Read && newStatus == Read) { | ||
838 | setUnread(unread() - 1); | 838 | setUnread(unread() - 1); | ||
839 | } | 839 | } | ||
840 | } | 840 | } | ||
841 | d->updatedArticlesNotify.append(a); | 841 | d->updatedArticlesNotify.append(a); | ||
842 | if (process) { | ||||
842 | articlesModified(); | 843 | articlesModified(); | ||
843 | } | 844 | } | ||
845 | } | ||||
844 | 846 | | |||
845 | int Akregator::Feed::totalCount() const | 847 | int Akregator::Feed::totalCount() const | ||
846 | { | 848 | { | ||
847 | if (d->totalCount == -1) { | 849 | if (d->totalCount == -1) { | ||
848 | d->totalCount = std::count_if(d->articles.constBegin(), d->articles.constEnd(), [](const Article &art) -> bool { | 850 | d->totalCount = std::count_if(d->articles.constBegin(), d->articles.constEnd(), [](const Article &art) -> bool { | ||
849 | return !art.isDeleted(); | 851 | return !art.isDeleted(); | ||
850 | }); | 852 | }); | ||
851 | } | 853 | } | ||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |
You get status from here, then check for it's read below, e.g. it does not need a 3-th parameter