From 5f591bf81f626e9ac4bd47641662bfddda0ef9b4 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 17 Aug 2010 07:22:38 +0000 Subject: Add extra pointercheck. --- client/macro.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'client') 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 ¯os, } // 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 ¯os, 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); -- cgit v1.2.3