mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-13 22:12:15 -07:00
[Fix-Warnings] Local variable can be made const
This commit is contained in:
parent
8abd04dab1
commit
f2d3e81331
214 changed files with 1375 additions and 1355 deletions
|
|
@ -10,8 +10,8 @@ bool CardCompleterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex
|
|||
return true;
|
||||
}
|
||||
|
||||
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||
QString data = index.data(Qt::DisplayRole).toString();
|
||||
const QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||
const QString data = index.data(Qt::DisplayRole).toString();
|
||||
|
||||
// Ensure substring matching
|
||||
return data.contains(filterRegularExpression());
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ void CardSearchModel::updateSearchResults(const QString &query)
|
|||
for (int i = 0; i < sourceModel->rowCount(); ++i) {
|
||||
QModelIndex modelIndex = sourceModel->index(i, 0);
|
||||
QModelIndex sourceIndex = sourceModel->mapToSource(modelIndex);
|
||||
CardDatabaseModel *sourceDbModel = qobject_cast<CardDatabaseModel *>(sourceModel->sourceModel());
|
||||
const CardDatabaseModel *sourceDbModel = qobject_cast<CardDatabaseModel *>(sourceModel->sourceModel());
|
||||
|
||||
if (!sourceDbModel || !sourceIndex.isValid())
|
||||
return;
|
||||
|
|
@ -54,7 +54,7 @@ void CardSearchModel::updateSearchResults(const QString &query)
|
|||
if (!card)
|
||||
continue;
|
||||
|
||||
int distance = levenshteinDistance(query.toLower(), card->getName().toLower());
|
||||
const int distance = levenshteinDistance(query.toLower(), card->getName().toLower());
|
||||
searchResults.append({card, distance});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue