summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2010-08-17 07:22:38 +0000
committerdeva <deva>2010-08-17 07:22:38 +0000
commit5f591bf81f626e9ac4bd47641662bfddda0ef9b4 (patch)
treed7393b5c55bede3ef204c3f8e241301234af728e
parentfd7451d278d4d90afd185e7f7418d89cbcc5ba3d (diff)
Add extra pointercheck.
-rw-r--r--client/macro.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/client/macro.cc b/client/macro.cc
index 0037044..3994a42 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -38,7 +38,8 @@
Macro::Macro(QDomNode &n)
{
window = NULL;
-
+ drawer = NULL;
+
update(n);
}
@@ -93,7 +94,7 @@ void Macro::init(QBoxLayout *layout, Macros &macros,
}
// if(macros.find(name) == macros.end()) {
- if(window == NULL) {
+ if(window == NULL && drawer == NULL) {
window = new MacroWindow(netcom, node, templ, !isstatic, iscompact);
/*
@@ -107,9 +108,11 @@ void Macro::init(QBoxLayout *layout, Macros &macros,
layout->addWidget(edge);
*/
- drawer = new MacroDrawer(this, xml_elem.attribute("caption", name), NULL/*edge*/);
+ drawer = new MacroDrawer(this, xml_elem.attribute("caption", name),
+ NULL/*edge*/);
drawer->connect(drawer, SIGNAL(toggle()), window, SLOT(toggleMacro()));
- drawer->connect(window, SIGNAL(activationChanged(bool)), drawer, SLOT(activationChange(bool)));
+ drawer->connect(window, SIGNAL(activationChanged(bool)), drawer,
+ SLOT(activationChange(bool)));
//drawer->setAutoFillBackground(true);
//drawer->setContentsMargins(1,1,1,1);
window->setActive(false);