Convert all foreach() to range-based for()

This commit is contained in:
thalieht
2018-11-18 20:40:37 +02:00
parent d668a4fe6d
commit 6b1d26d555
64 changed files with 326 additions and 292 deletions

View File

@@ -28,6 +28,8 @@
#include "searchsortmodel.h"
#include "base/global.h"
SearchSortModel::SearchSortModel(QObject *parent)
: base(parent)
, m_isNameFilterEnabled(false)
@@ -126,7 +128,7 @@ bool SearchSortModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceP
const QAbstractItemModel *const sourceModel = this->sourceModel();
if (m_isNameFilterEnabled && !m_searchTerm.isEmpty()) {
QString name = sourceModel->data(sourceModel->index(sourceRow, NAME, sourceParent)).toString();
for (const QString &word : m_searchTermWords) {
for (const QString &word : qAsConst(m_searchTermWords)) {
int i = name.indexOf(word, 0, Qt::CaseInsensitive);
if (i == -1) {
return false;