From f2a1b2e0384ca06c89d52111ea1eb11519a5f625 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 3 Jul 2009 06:24:12 +0000 Subject: Fixed bug, where requirements were not updated on commits. --- client/macro.cc | 5 +++++ client/macro.h | 2 ++ client/mainwindow.cc | 13 ++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/client/macro.cc b/client/macro.cc index dbe34f5..650a352 100644 --- a/client/macro.cc +++ b/client/macro.cc @@ -35,7 +35,12 @@ Macro::Macro(QDomNode &n) { window = NULL; + + update(n); +} +void Macro::update(QDomNode &n) +{ node = n.cloneNode(true); QDomElement xml_elem = node.toElement(); diff --git a/client/macro.h b/client/macro.h index f79583c..4adaf09 100644 --- a/client/macro.h +++ b/client/macro.h @@ -46,6 +46,8 @@ public: void init(QBoxLayout *layout, Macros ¯os, bool initialising, NetCom &netcom, QString course); + void update(QDomNode &node); + QString name; QString caption; diff --git a/client/mainwindow.cc b/client/mainwindow.cc index c59a877..39921b0 100644 --- a/client/mainwindow.cc +++ b/client/mainwindow.cc @@ -131,7 +131,6 @@ void MainWindow::update() QString macroname = macroelement.attribute("name"); bool found = false; - Macros::iterator i = macros.begin(); while(i != macros.end()) { if(i->name == macroname) found |= true; @@ -144,6 +143,18 @@ void MainWindow::update() Macro macro(macronode); macros[num + macro.name] = macro; } + + if(found) { + + Macros::iterator i = macros.begin(); + while(i != macros.end()) { + if(i->name == macroname) { + i->update(macronode); + } + i++; + } + + } } { -- cgit v1.2.3