From 9b0348240dba15cf8ac7929ae637660b7c8e6451 Mon Sep 17 00:00:00 2001 From: Skagra42 <72851315+Skagra42@users.noreply.github.com> Date: Wed, 1 Jul 2026 00:46:37 -0600 Subject: [PATCH] Search by date. (#7027) --- cockatrice/src/interface/widgets/dialogs/dlg_manage_sets.cpp | 2 +- .../models/database/card_set/card_sets_model.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/interface/widgets/dialogs/dlg_manage_sets.cpp b/cockatrice/src/interface/widgets/dialogs/dlg_manage_sets.cpp index c693fb02e..b17a9306f 100644 --- a/cockatrice/src/interface/widgets/dialogs/dlg_manage_sets.cpp +++ b/cockatrice/src/interface/widgets/dialogs/dlg_manage_sets.cpp @@ -62,7 +62,7 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent) // search field searchField = new LineEditUnfocusable; searchField->setObjectName("searchEdit"); - searchField->setPlaceholderText(tr("Search by set name, code, or type")); + searchField->setPlaceholderText(tr("Search by set name, code, type, or release date")); searchField->addAction(QPixmap("theme:icons/search"), LineEditUnfocusable::LeadingPosition); searchField->setClearButtonEnabled(true); setFocusProxy(searchField); diff --git a/libcockatrice_models/libcockatrice/models/database/card_set/card_sets_model.cpp b/libcockatrice_models/libcockatrice/models/database/card_set/card_sets_model.cpp index 5e0cc31d8..8fd5311f2 100644 --- a/libcockatrice_models/libcockatrice/models/database/card_set/card_sets_model.cpp +++ b/libcockatrice_models/libcockatrice/models/database/card_set/card_sets_model.cpp @@ -303,12 +303,14 @@ bool SetsDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex &source auto typeIndex = sourceModel()->index(sourceRow, SetsModel::SetTypeCol, sourceParent); auto nameIndex = sourceModel()->index(sourceRow, SetsModel::LongNameCol, sourceParent); auto shortNameIndex = sourceModel()->index(sourceRow, SetsModel::ShortNameCol, sourceParent); + auto dateIndex = sourceModel()->index(sourceRow, SetsModel::ReleaseDateCol, sourceParent); const auto filter = filterRegularExpression(); return (sourceModel()->data(typeIndex).toString().contains(filter) || sourceModel()->data(nameIndex).toString().contains(filter) || - sourceModel()->data(shortNameIndex).toString().contains(filter)); + sourceModel()->data(shortNameIndex).toString().contains(filter) || + sourceModel()->data(dateIndex).toString().contains(filter)); } bool SetsDisplayModel::lessThan(const QModelIndex &left, const QModelIndex &right) const