Search in dynamic page now also searches rules

This commit is contained in:
craig.p.drummond
2013-07-01 19:53:45 +00:00
committed by craig.p.drummond
parent 3728f5c080
commit c3fb74ec23
3 changed files with 17 additions and 1 deletions

View File

@@ -41,5 +41,19 @@ bool DynamicProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourc
if (!isChildOfRoot(sourceParent)) {
return true;
}
return matchesFilter(QStringList() << sourceModel()->data(sourceModel()->index(sourceRow, 0, sourceParent), Qt::DisplayRole).toString());
if (matchesFilter(QStringList() << sourceModel()->data(sourceModel()->index(sourceRow, 0, sourceParent), Qt::DisplayRole).toString())) {
return true;
}
Dynamic::Entry item = Dynamic::self()->entry(sourceRow);
foreach (const Dynamic::Rule & r, item.rules) {
Dynamic::Rule::ConstIterator it=r.constBegin();
Dynamic::Rule::ConstIterator end=r.constEnd();
for (; it!=end; ++it) {
if (matchesFilter(QStringList() << it.value())) {
return true;
}
}
}
return false;
}