summaryrefslogtreecommitdiff
path: root/client/macro.cc
diff options
context:
space:
mode:
authordeva <deva>2008-06-09 14:50:00 +0000
committerdeva <deva>2008-06-09 14:50:00 +0000
commit95c75f805ec5f22f5e876dc3fddf8a72d6afd014 (patch)
tree499e6ac228fe5ccd6c900ddafc9611b5d750b2e7 /client/macro.cc
parentbce7808fecc65d56b695be03f6b39fed51589562 (diff)
Fixed macrowindow generation errors when multiple macroes (some empty) are sent.
Diffstat (limited to 'client/macro.cc')
-rw-r--r--client/macro.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/client/macro.cc b/client/macro.cc
index d4ae0c0..08e44f4 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -123,9 +123,23 @@ static void create_macro(QString course, QString macro)
cleanup_macros();
+ //
+ // TODO: This is where the dependency checking should occur.
+ //
+
// Initiate the new macro window with the xml document and push
// it to the window list
- macrowindows.push_back( new MacroWindow(&xml_doc) );
+ QDomNodeList courses = xml_doc.documentElement().childNodes();
+ QDomNode coursenode = courses.at(0); // There can be only one!
+ QDomNodeList macros = coursenode.childNodes();
+ for(int j = 0; j < macros.count(); j++) {
+ QDomNode macronode = macros.at(j);
+ // Only create if the macro contains something.
+ if(macronode.childNodes().count())
+ macrowindows.push_back( new MacroWindow( macronode ) );
+ }
+ //}
+ }
}
bool MacroEventFilter::eventFilter( QObject *, QEvent *e )