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

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.
parent 29ddd443
...@@ -146,14 +146,17 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex ...@@ -146,14 +146,17 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
{ {
CardInfo const *info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow); CardInfo const *info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
bool show = false; if (((isToken == ShowTrue) && !info->getIsToken()) || ((isToken == ShowFalse) && info->getIsToken()))
if (!cardName.isEmpty()) { return false;
if (info->getName().contains(cardName, Qt::CaseInsensitive))
show = true; if (!cardName.isEmpty())
} else if (!info->getName().contains(cardName, Qt::CaseInsensitive))
return true;// search is empty, show all return false;
return show; if (filterTree != NULL)
return filterTree->acceptsCard(info);
return true;
} }
void CardDatabaseDisplayModel::clearSearch() void CardDatabaseDisplayModel::clearSearch()
......
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