mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-08-25 10:14:16 -05:00
Merge pull request #809 from poixen/search_new_fix
Re-added some search and filter code
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user