From 95c75f805ec5f22f5e876dc3fddf8a72d6afd014 Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 9 Jun 2008 14:50:00 +0000 Subject: Fixed macrowindow generation errors when multiple macroes (some empty) are sent. --- client/macro.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'client/macro.cc') 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 ) -- cgit v1.2.3