mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-06 18:14:23 -08:00
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:
@@ -125,7 +125,7 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
|
||||
QString leftString = sourceModel()->data(left).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
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user