1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-18 09:18:23 +01:00

* Fixed #2440. Now when a firewall is matched in the quick

filter, all child elements (e.g. policies, interfaces) will be
	displayed as well.
This commit is contained in:
Theron Tock 2011-07-13 15:36:45 -07:00
parent 6b8eaef07b
commit 69bac5db2e
2 changed files with 18 additions and 1 deletions

View File

@ -11,6 +11,10 @@
However, if there is a path and it comes out blank in
getSourceNameAsPath() then that means %DATADIR% expansion failed.
* Fixed #2440. Now when a firewall is matched in the quick
filter, all child elements (e.g. policies, interfaces) will be
displayed as well.
2011-07-11 theron <theron@netcitadel.com>
* Implemented #2514, support for address table alternate paths.
There's a "data directory" setting under user preferences. If the

View File

@ -868,6 +868,7 @@ void ObjectTreeView::setFilter(QString text)
if (fwbdebug)
qDebug() << "ObjectTreeView::setFilter " << text;
list<QTreeWidgetItem *> expand;
for (QTreeWidgetItemIterator wit(this); *wit; ++wit) {
ObjectTreeViewItem *otvi = dynamic_cast<ObjectTreeViewItem *>(*wit);
if (otvi->getUserFolderParent() != 0) continue;
@ -876,6 +877,10 @@ void ObjectTreeView::setFilter(QString text)
if (filterMatches(text, otvi, obj)) {
(*wit)->setHidden(false);
if (Firewall::cast(obj) != 0) {
expand.push_back(otvi);
}
QTreeWidgetItem *parent = (*wit)->parent();
while (parent != 0) {
parent->setHidden(false);
@ -886,6 +891,14 @@ void ObjectTreeView::setFilter(QString text)
}
}
list<QTreeWidgetItem *>::const_iterator iter;
for (iter = expand.begin(); iter != expand.end(); ++iter) {
QTreeWidgetItem *item = *iter;
item->setHidden(false);
for (int ii = 0; ii < item->childCount(); ii++) {
expand.push_back(item->child(ii));
}
}
if (!text.isEmpty()) this->expandAll();
}