CardDatabaseDisplayModel: sort cards by search term only when the current sort column is NameColumn
When the list os sorted using another column, you don’t need to compare that column’s value with the searched term
This commit is contained in:
parent
013087a4eb
commit
0e203b3ac2
1 changed files with 1 additions and 1 deletions
|
@ -125,7 +125,7 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
|
||||||
QString leftString = sourceModel()->data(left).toString();
|
QString leftString = sourceModel()->data(left).toString();
|
||||||
QString rightString = sourceModel()->data(right).toString();
|
QString rightString = sourceModel()->data(right).toString();
|
||||||
|
|
||||||
if (!cardName.isEmpty())
|
if (!cardName.isEmpty() && left.column() == CardDatabaseModel::NameColumn)
|
||||||
{
|
{
|
||||||
if (leftString.compare(cardName, Qt::CaseInsensitive) == 0) {// exact match should be at top
|
if (leftString.compare(cardName, Qt::CaseInsensitive) == 0) {// exact match should be at top
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue