mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[VDD] Implement ExactMatch Name filter (#6409)
* [VDD] Implement ExactMatch Name filter Took 7 minutes Took 4 minutes * Update cockatrice/src/interface/widgets/visual_database_display/visual_database_display_name_filter_widget.cpp Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com> --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
This commit is contained in:
parent
2b690f8c87
commit
da70344547
5 changed files with 15 additions and 4 deletions
|
|
@ -60,6 +60,8 @@ const QString CardFilter::attrName(Attr a)
|
|||
switch (a) {
|
||||
case AttrName:
|
||||
return tr("Name");
|
||||
case AttrNameExact:
|
||||
return tr("Name (Exact)");
|
||||
case AttrType:
|
||||
return tr("Type");
|
||||
case AttrColor:
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public:
|
|||
AttrLoyalty,
|
||||
AttrManaCost,
|
||||
AttrName,
|
||||
AttrNameExact,
|
||||
AttrPow,
|
||||
AttrRarity,
|
||||
AttrSet,
|
||||
|
|
|
|||
|
|
@ -153,6 +153,11 @@ bool FilterItem::acceptName(const CardInfoPtr info) const
|
|||
return info->getName().contains(term, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
bool FilterItem::acceptNameExact(const CardInfoPtr info) const
|
||||
{
|
||||
return info->getName() == term;
|
||||
}
|
||||
|
||||
bool FilterItem::acceptType(const CardInfoPtr info) const
|
||||
{
|
||||
return info->getCardType().contains(term, Qt::CaseInsensitive);
|
||||
|
|
@ -401,6 +406,8 @@ bool FilterItem::acceptCardAttr(const CardInfoPtr info, CardFilter::Attr attr) c
|
|||
switch (attr) {
|
||||
case CardFilter::AttrName:
|
||||
return acceptName(info);
|
||||
case CardFilter::AttrNameExact:
|
||||
return acceptNameExact(info);
|
||||
case CardFilter::AttrType:
|
||||
return acceptType(info);
|
||||
case CardFilter::AttrColor:
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@ public:
|
|||
}
|
||||
|
||||
[[nodiscard]] bool acceptName(CardInfoPtr info) const;
|
||||
[[nodiscard]] bool acceptNameExact(CardInfoPtr info) const;
|
||||
[[nodiscard]] bool acceptType(CardInfoPtr info) const;
|
||||
[[nodiscard]] bool acceptMainType(CardInfoPtr info) const;
|
||||
[[nodiscard]] bool acceptSubType(CardInfoPtr info) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue