diff --git a/build_num b/build_num index 50e9b8499..b117dc231 100644 --- a/build_num +++ b/build_num @@ -1 +1 @@ -#define BUILD_NUM 2102 +#define BUILD_NUM 2104 diff --git a/src/gui/FWWindow.cpp b/src/gui/FWWindow.cpp index 59a66ec69..385b0e506 100644 --- a/src/gui/FWWindow.cpp +++ b/src/gui/FWWindow.cpp @@ -1313,30 +1313,24 @@ void FWWindow::enableBackAction() void FWWindow::activateRule(ProjectPanel* project, QString fwname, QString setname, int rule) { // Find firewall object tree item - ObjectTreeViewItem* firewall = NULL; + FWObject* firewall = NULL; foreach(QTreeWidgetItem* item, project->getCurrentObjectTree()->findItems(fwname, Qt::MatchExactly | Qt::MatchRecursive, 0)) { - if(Firewall::cast(dynamic_cast(item)->getFWObject())!=NULL) + if (Firewall::cast(dynamic_cast(item)->getFWObject())!=NULL) { - firewall = dynamic_cast(item); + firewall = dynamic_cast(item)->getFWObject(); break; } } if (firewall == NULL) return; - RuleSet *set = NULL; - for ( Firewall::iterator iter = Firewall::cast(firewall->getFWObject())->begin(); - iter!= Firewall::cast(firewall->getFWObject())->end(); - iter++) - { - if (setname == FWObject::cast(*iter)->getName().c_str()) - { - set = RuleSet::cast(*iter); - break; - } - } + FWObject::const_iterator i = + find_if(firewall->begin(), firewall->end(), + FWObjectNameEQPredicate(string(setname.toUtf8().constData()))); + if (i==firewall->end()) return; + RuleSet *set = RuleSet::cast(*i); if (set == NULL) return; QCoreApplication::postEvent(mw, new openRulesetEvent(project->getFileName(),