Verified Commit bef212dd authored by Umar Javed's avatar Umar Javed
Browse files

Add search bar option to filter search by read articles

parent 47a131bb
Pipeline #89372 passed with stage
in 8 minutes and 38 seconds
......@@ -158,6 +158,11 @@ void SearchBar::slotActivateSearch()
statusCriteria << crit2;
break;
}
case StatusSearchLine::ReadArticles: {
Criterion crit(Criterion::Status, Criterion::Equals, Read);
statusCriteria << crit;
break;
}
case StatusSearchLine::ImportantArticles: {
Criterion crit(Criterion::KeepFlag, Criterion::Equals, true);
statusCriteria << crit;
......
......@@ -37,16 +37,19 @@ void StatusSearchLine::initializeHash()
const QIcon iconAll = QIcon::fromTheme(QStringLiteral("system-run"));
const QIcon iconNew = QIcon::fromTheme(QStringLiteral("mail-mark-unread-new"));
const QIcon iconUnread = QIcon::fromTheme(QStringLiteral("mail-mark-unread"));
const QIcon iconRead = QIcon::fromTheme(QStringLiteral("mail-mark-read"));
const QIcon iconKeep = QIcon::fromTheme(QStringLiteral("mail-mark-important"));
StatusInfo statusAll(i18n("All Articles"), iconAll);
StatusInfo statusUnread(i18nc("Unread articles filter", "Unread"), iconUnread);
StatusInfo statusNew(i18nc("New articles filter", "New"), iconNew);
StatusInfo statusRead(i18nc("Read articles filter", "Read"), iconRead);
StatusInfo statusImportant(i18nc("Important articles filter", "Important"), iconKeep);
mHashStatus.insert(AllArticles, statusAll);
mHashStatus.insert(NewArticles, statusNew);
mHashStatus.insert(UnreadArticles, statusUnread);
mHashStatus.insert(ReadArticles, statusRead);
mHashStatus.insert(ImportantArticles, statusImportant);
}
......
......@@ -16,7 +16,7 @@ class StatusSearchLine : public KLineEdit
{
Q_OBJECT
public:
enum Status { AllArticles = 0, NewArticles, UnreadArticles, ImportantArticles };
enum Status { AllArticles = 0, NewArticles, UnreadArticles, ReadArticles, ImportantArticles };
explicit StatusSearchLine(QWidget *parent = nullptr);
~StatusSearchLine() override;
......
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