diff options
Diffstat (limited to 'client/macro.cc')
-rw-r--r-- | client/macro.cc | 10 |
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"); |