CollectionFilter: Move early return
This commit is contained in:
parent
3100b0c044
commit
32be33847c
|
@ -60,10 +60,6 @@ bool CollectionFilter::filterAcceptsRow(const int source_row, const QModelIndex
|
|||
CollectionItem *item = model->IndexToItem(idx);
|
||||
if (!item) return false;
|
||||
|
||||
if (item->type != CollectionItem::Type::Song) {
|
||||
return item->type == CollectionItem::Type::LoadingIndicator;
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QString filter_text = filterRegularExpression().pattern().remove(QLatin1Char('\\'));
|
||||
#else
|
||||
|
@ -72,6 +68,10 @@ bool CollectionFilter::filterAcceptsRow(const int source_row, const QModelIndex
|
|||
|
||||
if (filter_text.isEmpty()) return true;
|
||||
|
||||
if (item->type != CollectionItem::Type::Song) {
|
||||
return item->type == CollectionItem::Type::LoadingIndicator;
|
||||
}
|
||||
|
||||
for (const QString &foperator : Operators) {
|
||||
if (filter_text.contains(foperator + QLatin1Char(' '))) {
|
||||
filter_text = filter_text.replace(foperator + QLatin1Char(' '), foperator);
|
||||
|
|
Loading…
Reference in New Issue