summaryrefslogtreecommitdiff
path: root/client/macro.cc
diff options
context:
space:
mode:
authorsenator <senator>2007-10-09 08:07:55 +0000
committersenator <senator>2007-10-09 08:07:55 +0000
commit4060888474e49cc0716cdd59d4d1a73c06c5b3bc (patch)
tree647c604988e145d6fb2c40d6c0cff58719e37181 /client/macro.cc
parent8dadd3a9f18b6d4e8884862658fe8a1d042f631c (diff)
Code cleanup and commenting
Diffstat (limited to 'client/macro.cc')
-rw-r--r--client/macro.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/macro.cc b/client/macro.cc
index bc97d1c..ec520f0 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -41,30 +41,34 @@ void macro(QString name)
xml_acquire.makeConnection(&xml_req);
QByteArray ba = xml_acquire.getResult();
+ // Print to stdout, for debug purposes
char *test = ba.data();
printf("%s\n", test);
- // Parse the XML document
+ // Parse the XML document using setContent of QDomDocument
QDomDocument xml_doc;
if (!xml_doc.setContent(ba)) {
printf("ERROR: Invalid XML recieved!\n");
}
+ // Initiate the macro builder with the xml document
Builder *builder = new Builder(&xml_doc);
}
static QDomDocument xml_request(QString name)
{
- // Create the xml request document here
+ // Create the xml request array
QByteArray xml_array;
xml_array.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
xml_array.append("<pracro version=\"1.0\" cpr=\"1505050505\" user=\"tux\">\n");
- xml_array.append(" <request macro=\"example\"/>\n");
+ xml_array.append(" <request macro=\"" + name + "\"/>\n");
xml_array.append("</pracro>");
+ // Print to stdout for debug purposes
char *test = xml_array.data();
printf("%s\n", test);
+ // Parse the XML document using setContent of QDomDocument
QDomDocument xml_req;
if (!xml_req.setContent(xml_array)) {
printf("Error: Invalid XML found in request\n");