Commit 2e5ecd84 authored by Matt Lowe's avatar Matt Lowe
Browse files

Removed check

When searching for a card the line edit will not be empty, so this check
is not needed. The performance when the line edit IS empty will take a
slight hit, but you really want additional performance when searching,
not when the line edit is empty.

Removing will increase performance.
parent 778ad8de
......@@ -125,13 +125,13 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
if (!cardName.isEmpty())
{
if (leftString.compare(cardName, Qt::CaseInsensitive) == 0) {// exact match should be at top
// exact match should be at top
if (leftString.compare(cardName, Qt::CaseInsensitive) == 0)
return true;
}
if (rightString.compare(cardName, Qt::CaseInsensitive) == 0) {// exact match should be at top
// exact match should be at top
if (rightString.compare(cardName, Qt::CaseInsensitive) == 0)
return false;
}
bool isLeftType2 = leftString.startsWith(cardName, Qt::CaseInsensitive);
bool isRightType2 = rightString.startsWith(cardName, Qt::CaseInsensitive);
......@@ -141,7 +141,6 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
return false;
}
return QString::localeAwareCompare(leftString, rightString) < 0;
}
bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex & /*sourceParent*/) const
......@@ -151,7 +150,6 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
if (((isToken == ShowTrue) && !info->getIsToken()) || ((isToken == ShowFalse) && info->getIsToken()))
return false;
if (!cardName.isEmpty())
if (!CardInfo::simplifyName(info->getName()).contains(cardName, Qt::CaseInsensitive))
return false;
......
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