* FWCmdChange.cpp (FWCmdChange::notify): fixes #1139

GUI crash on click in undo panel view. Sequence that caused crash:
1) new firewall next next finish
2) rename firewall couple of times
3) click to top of undo stack and it crashes
This commit is contained in:
Vadim Kurland
2010-01-26 22:02:36 +00:00
parent 11d74639b8
commit 455b7d6be3
4 changed files with 19 additions and 8 deletions
+1 -1
View File
@@ -1 +1 @@
#define BUILD_NUM 2440
#define BUILD_NUM 2441
+6
View File
@@ -1,5 +1,11 @@
2010-01-26 vadim <vadim@vk.crocodile.org>
* FWCmdChange.cpp (FWCmdChange::notify): fixes #1139
GUI crash on click in undo panel view. Sequence that caused crash:
1) new firewall next next finish
2) rename firewall couple of times
3) click to top of undo stack and it crashes
* DiscoveryDruid.cpp (DiscoveryDruid::createRealObjects): fixes #1144
after snmp discovery object attributes are not shown properly
in the tree
+3 -6
View File
@@ -30,7 +30,6 @@ using namespace libfwbuilder;
FWCmdBasic::FWCmdBasic(ProjectPanel *project, QUndoCommand* macro):QUndoCommand(macro)
{
this->project = project;
}
@@ -46,21 +45,19 @@ FWObject* FWCmdBasic::getObject(int id)
bool FWCmdBasic::mergeWith(const QUndoCommand *other)
{
qDebug() << "FWCmdBasic::mergeWith(const QUndoCommand *other)";
qDebug() << "FWCmdBasic::mergeWith(const QUndoCommand *other) other=" << other;
qDebug() << "cmd:" << other->text();
const FWCmdTerm* term = dynamic_cast<const FWCmdTerm*> (other);
const FWCmdTerm* term = dynamic_cast<const FWCmdTerm*>(other);
return term != 0;
}
bool FWCmdMacro::mergeWith(const QUndoCommand *other)
{
qDebug() << "FWCmdMacro::mergeWith(const QUndoCommand *other)";
qDebug() << "FWCmdMacro::mergeWith(const QUndoCommand *other) other=" << other;
qDebug() << "cmd:" << other->text();
const FWCmdTerm* term = dynamic_cast<const FWCmdTerm*> (other);
return term != 0;
}
+9 -1
View File
@@ -110,7 +110,15 @@ void FWCmdChange::notify()
// automatic renaming of child objects. This should only be
// done once, even if we have the same data file opened in
// several project panels.
QCoreApplication::postEvent(
//
// Use sendEvent to make sure event is processed right now and
// is not postponed. This is important when this command is
// executed as part of a group undo/redo (when user clicks in
// the undo panel). If this command is posted to event queue,
// it is executed after bunch of objects are deleted and may
// need to operate on one of them.
//
QCoreApplication::sendEvent(
mw->activeProject(), new objectNameChangedEvent(
filename, obj->getId(),
QString::fromUtf8(oldState->getName().c_str()),