Separate search's card name matching out from token filter check
* Trying to eventually reuse card name filtering in "create token" dialog
This commit is contained in:
parent
e3fb308ea1
commit
d12c86d89c
2 changed files with 5 additions and 1 deletions
|
@ -186,6 +186,10 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
|
|||
if (((isToken == ShowTrue) && !info->getIsToken()) || ((isToken == ShowFalse) && info->getIsToken()))
|
||||
return false;
|
||||
|
||||
return rowMatchesCardName(info);
|
||||
}
|
||||
|
||||
bool CardDatabaseDisplayModel::rowMatchesCardName(CardInfo const *info) const {
|
||||
if (!cardName.isEmpty() && !info->getName().contains(cardName, Qt::CaseInsensitive))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
protected:
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
|
||||
bool rowMatchesCardName(CardInfo const *info) const;
|
||||
bool canFetchMore(const QModelIndex &parent) const;
|
||||
void fetchMore(const QModelIndex &parent);
|
||||
private slots:
|
||||
|
|
Loading…
Reference in a new issue