Re-added some search and filter code
I had previously removed some filtering code that would allow users to filter cards using our filtering tools. This functionality has now been re-added.
This commit is contained in:
parent
29ddd44334
commit
b91bab8356
1 changed files with 10 additions and 7 deletions
|
@ -146,14 +146,17 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
|
|||
{
|
||||
CardInfo const *info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
|
||||
|
||||
bool show = false;
|
||||
if (!cardName.isEmpty()) {
|
||||
if (info->getName().contains(cardName, Qt::CaseInsensitive))
|
||||
show = true;
|
||||
} else
|
||||
return true;// search is empty, show all
|
||||
if (((isToken == ShowTrue) && !info->getIsToken()) || ((isToken == ShowFalse) && info->getIsToken()))
|
||||
return false;
|
||||
|
||||
return show;
|
||||
if (!cardName.isEmpty())
|
||||
if (!info->getName().contains(cardName, Qt::CaseInsensitive))
|
||||
return false;
|
||||
|
||||
if (filterTree != NULL)
|
||||
return filterTree->acceptsCard(info);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CardDatabaseDisplayModel::clearSearch()
|
||||
|
|
Loading…
Reference in a new issue