Commit b27854e4 authored by Matt Lowe's avatar Matt Lowe
Browse files

Ignore punctuation in card search

It is awkward to have to use precise punctuation when searching for
cards. Planeswalkers and legendary creatures often have "," in the name
and you have to enter it.

This commit means you no longer need to do that.

+ Can use " " in place of "-" (example: Wilt-Leaf Liege)
+ Can use "" in place of non word chars (Example: Hero's Downfall and
Ajani, Caller of the Pride)
parent 81e4e089
...@@ -152,8 +152,9 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex ...@@ -152,8 +152,9 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
return false; return false;
if (!cardName.isEmpty()) if (!cardName.isEmpty())
if (!info->getName().contains(cardName, Qt::CaseInsensitive)) if (!info->getName().contains(cardName, Qt::CaseInsensitive))
return false; if (!CardInfo::simplifyName(info->getName()).contains(cardName, Qt::CaseInsensitive))
return false;
if (filterTree != NULL) if (filterTree != NULL)
return filterTree->acceptsCard(info); return filterTree->acceptsCard(info);
......
Supports Markdown
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