diff --git a/docs/source/donations.md b/docs/source/donations.md index 8c723736a..35d64fab6 100644 --- a/docs/source/donations.md +++ b/docs/source/donations.md @@ -1,3 +1,7 @@ Donations ========= -You can support author of RSS Guard via [donations](https://github.com/sponsors/martinrotter). \ No newline at end of file +You can support author of RSS Guard via [donations](https://github.com/sponsors/martinrotter). + +Or you can use: +* Liberapay - [https://liberapay.com/martinrotter](https://liberapay.com/martinrotter) +* Patreon - [https://www.patreon.com/c/martinrotter](https://www.patreon.com/c/martinrotter) \ No newline at end of file diff --git a/src/librssguard/core/feedsproxymodel.cpp b/src/librssguard/core/feedsproxymodel.cpp index 146594735..3c7e4075b 100644 --- a/src/librssguard/core/feedsproxymodel.cpp +++ b/src/librssguard/core/feedsproxymodel.cpp @@ -400,37 +400,48 @@ bool FeedsProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source } void FeedsProxyModel::initializeFilters() { - m_filters[FeedListFilter::ShowEmpty] = [this](const Feed* feed) { - return feed->countOfAllMessages() == 0; + m_filters[FeedListFilter::ShowEmpty] = [this](const RootItem* item) { + return item->countOfAllMessages() == 0; }; - m_filters[FeedListFilter::ShowNonEmpty] = [this](const Feed* feed) { - return feed->countOfAllMessages() != 0; + m_filters[FeedListFilter::ShowNonEmpty] = [this](const RootItem* item) { + return item->countOfAllMessages() != 0; }; - m_filters[FeedListFilter::ShowQuiet] = [this](const Feed* feed) { - return feed->isQuiet(); + m_filters[FeedListFilter::ShowQuiet] = [this](const RootItem* item) { + Feed* feed = item->toFeed(); + + return feed == nullptr || feed->isQuiet(); }; - m_filters[FeedListFilter::ShowSwitchedOff] = [this](const Feed* feed) { - return feed->isSwitchedOff(); + m_filters[FeedListFilter::ShowSwitchedOff] = [this](const RootItem* item) { + Feed* feed = item->toFeed(); + + return feed == nullptr || feed->isSwitchedOff(); }; - m_filters[FeedListFilter::ShowUnread] = [this](const Feed* feed) { - return feed->countOfUnreadMessages() > 0; + m_filters[FeedListFilter::ShowUnread] = [this](const RootItem* item) { + return item->countOfUnreadMessages() > 0; }; - m_filters[FeedListFilter::ShowWithArticleFilters] = [this](const Feed* feed) { - return !feed->messageFilters().isEmpty(); + m_filters[FeedListFilter::ShowWithArticleFilters] = [this](const RootItem* item) { + Feed* feed = item->toFeed(); + + return feed == nullptr || !feed->messageFilters().isEmpty(); }; - m_filters[FeedListFilter::ShowWithError] = [this](const Feed* feed) { - return feed->status() == Feed::Status::AuthError || feed->status() == Feed::Status::NetworkError || - feed->status() == Feed::Status::OtherError || feed->status() == Feed::Status::ParsingError; + m_filters[FeedListFilter::ShowWithError] = [this](const RootItem* item) { + Feed* feed = item->toFeed(); + + return feed == nullptr || feed->status() == Feed::Status::AuthError || + feed->status() == Feed::Status::NetworkError || feed->status() == Feed::Status::OtherError || + feed->status() == Feed::Status::ParsingError; }; - m_filters[FeedListFilter::ShowWithNewArticles] = [this](const Feed* feed) { - return feed->status() == Feed::Status::NewMessages; + m_filters[FeedListFilter::ShowWithNewArticles] = [this](const RootItem* item) { + Feed* feed = item->toFeed(); + + return feed == nullptr || feed->status() == Feed::Status::NewMessages; }; m_filterKeys = m_filters.keys(); @@ -473,26 +484,26 @@ bool FeedsProxyModel::filterAcceptsRowInternal(int source_row, const QModelIndex bool should_show = QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent); - if (item->kind() == RootItem::Kind::Feed) { - const Feed* feed = item->toFeed(); + // if (item->kind() == RootItem::Kind::Feed) { + // const Feed* feed = item->toFeed(); - for (FeedListFilter val : m_filterKeys) { - if (Globals::hasFlag(m_filter, val)) { - // This particular filter is enabled. - if (m_filters[val](feed)) { - // The item matches the feed filter. - // Display it if it matches internal string-based filter too. - return should_show; - } + for (FeedListFilter val : m_filterKeys) { + if (Globals::hasFlag(m_filter, val)) { + // This particular filter is enabled. + if (m_filters[val](item)) { + // The item matches the feed filter. + // Display it if it matches internal string-based filter too. + return should_show; } } - - if (m_filter != FeedListFilter::NoFiltering) { - // Some filter is enabled but this item does not meet it. - return false; - } } + if (m_filter != FeedListFilter::NoFiltering) { + // Some filter is enabled but this item does not meet it. + return false; + } + //} + return should_show; } diff --git a/src/librssguard/core/feedsproxymodel.h b/src/librssguard/core/feedsproxymodel.h index a15c36f8c..8451351cd 100644 --- a/src/librssguard/core/feedsproxymodel.h +++ b/src/librssguard/core/feedsproxymodel.h @@ -93,7 +93,9 @@ class FeedsProxyModel : public QSortFilterProxyModel { QList> m_hiddenIndices; FeedListFilter m_filter; - QMap> m_filters; + + // NOTE: The parameter type can be Category, Feed or Label only. + QMap> m_filters; QList m_filterKeys; }; diff --git a/src/librssguard/miscellaneous/application.cpp b/src/librssguard/miscellaneous/application.cpp index 327d3b7d8..c083b0109 100644 --- a/src/librssguard/miscellaneous/application.cpp +++ b/src/librssguard/miscellaneous/application.cpp @@ -374,9 +374,11 @@ void Application::loadDynamicShortcuts() { } void Application::offerPolls() const { + /* if (isFirstRunCurrentVersion()) { qApp->web()->openUrlInExternalBrowser(QSL("https://forms.gle/3CZm95W6vrBLfi5K9")); } + */ } void Application::offerChanges() const {