* newClusterDialog_create.cpp (newClusterDialog::createNewCluster):

fixed #1622 "Crash when configuring cluster". The GUI used to crash
if user created a cluster copying rules of one of the cluster members
while that rule set was opened in the rule set view.
This commit is contained in:
Vadim Kurland
2010-07-22 23:54:32 +00:00
parent e2a1d4df9f
commit 56ce332788
3 changed files with 44 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
#define BUILD_NUM 3131
#define BUILD_NUM 3133
+7
View File
@@ -1,3 +1,10 @@
2010-07-22 Vadim Kurland <vadim@vk.crocodile.org>
* newClusterDialog_create.cpp (newClusterDialog::createNewCluster):
fixed #1622 "Crash when configuring cluster". The GUI used to crash
if user created a cluster copying rules of one of the cluster members
while that rule set was opened in the rule set view.
2010-07-21 Vadim Kurland <vadim@vk.crocodile.org>
* iptadvanceddialog_q.ui: rearranged elements in the tab
+36 -2
View File
@@ -25,13 +25,15 @@
#include "../../config.h"
#include "global.h"
#include "events.h"
#include "FWWindow.h"
#include "newClusterDialog.h"
#include "InterfacesTabWidget.h"
#include "platforms.h"
#include "FWBTree.h"
#include "FWCmdAddObject.h"
#include "RuleSetModel.h"
#include "RuleSetView.h"
#include "fwbuilder/Cluster.h"
#include "fwbuilder/FailoverClusterGroup.h"
@@ -208,7 +210,35 @@ void newClusterDialog::createNewCluster()
if (fwbdebug) qDebug() << "newClusterDialog::createNewCluster() checkpoint 4";
if (source == NULL) return;
ProjectPanel *pp = mw->activeProject();
QString filename = pp->getFileName();
if (source == NULL)
{
FWObject *first_policy = ncl->getFirstByType(Policy::TYPENAME);
QCoreApplication::postEvent(
mw, new openRulesetEvent(filename, first_policy->getId()));
return;
}
// See #1622 If rule set view shows rules of the firewall
// <source>, need to close it because we are about to delete that
// rule set object
RuleSet* current_ruleset = NULL;
RuleSetView* rsv = pp->getCurrentRuleSetView();
RuleSetModel* md = NULL;
if (rsv)
{
md = (RuleSetModel*)rsv->model();
current_ruleset = md->getRuleSet();
}
if (current_ruleset && current_ruleset->isChildOf(source))
{
pp->closeRuleSet(current_ruleset);
}
FWObject *fwgroup =
FWBTree().getStandardSlotForObject(parent->getLibrary(), Firewall::TYPENAME);
@@ -244,6 +274,10 @@ void newClusterDialog::createNewCluster()
deleteRuleSets(NAT::TYPENAME, fw);
deleteRuleSets(Routing::TYPENAME, fw);
}
FWObject *first_policy = ncl->getFirstByType(Policy::TYPENAME);
QCoreApplication::postEvent(
mw, new openRulesetEvent(filename, first_policy->getId()));
}
void newClusterDialog::deleteRuleSets(const string &type, Firewall *fw)