Dont hide other online services / streams when searching.

This commit is contained in:
craig.p.drummond
2013-10-09 18:45:01 +00:00
parent f2ca72df1c
commit 9fa96846fb
13 changed files with 111 additions and 33 deletions

View File

@@ -96,6 +96,37 @@ bool ProxyModel::update(const QString &text, const QString &genre)
return false;
}
bool ProxyModel::updateWithFilter(const QString &text, const QString &genre, const void *f)
{
bool wasEmpty=isEmpty();
filterStrings = text.split(' ', QString::SkipEmptyParts, Qt::CaseInsensitive);
unmatchedStrings = 0;
const int n = qMin(filterStrings.count(), (int)sizeof(uint));
for ( int i = 0; i < n; ++i ) {
unmatchedStrings |= (1<<i);
}
origFilterText=text;
filterGenre=genre;
filter=f;
if (text.length()<2 && genre.isEmpty() && !filter) {
if (filterEnabled) {
filterEnabled=false;
if (!wasEmpty) {
invalidate();
}
return true;
}
} else {
filterEnabled=true;
invalidate();
return true;
}
return false;
}
bool ProxyModel::isChildOfRoot(const QModelIndex &idx) const
{
if (!rootIndex.isValid()) {