summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/builder.cc10
-rw-r--r--client/builder.h1
-rw-r--r--client/macro.cc3
-rw-r--r--client/pracro.ini2
4 files changed, 6 insertions, 10 deletions
diff --git a/client/builder.cc b/client/builder.cc
index b5a9928..63cdcb9 100644
--- a/client/builder.cc
+++ b/client/builder.cc
@@ -27,12 +27,8 @@ extern QString user;
Builder::Builder(QDomDocument *xml_doc)
: QObject()
{
- // Assign root element from xml_doc
- this->xml_doc = xml_doc;
- QDomElement xml_elem = xml_doc->documentElement();
-
// Execute the recursive function with documentElement
- recurser(xml_elem, NULL);
+ recurser(xml_doc->documentElement(), NULL);
}
Builder::~Builder()
@@ -224,8 +220,8 @@ void Builder::cont(QString name)
mainwidget->close();
} else {
QMessageBox::critical(NULL, "Fejl",
- "Makroen er ikke udfyldt korrekt, prøv igen.\n"
- , QMessageBox::Ok);
+ "Makroen er ikke udfyldt korrekt, prøv igen.\n",
+ QMessageBox::Ok);
}
printf("%s : Builder -> continuing...\n", macro.toStdString().c_str());
}
diff --git a/client/builder.h b/client/builder.h
index 735b58d..1fbbb86 100644
--- a/client/builder.h
+++ b/client/builder.h
@@ -52,7 +52,6 @@ public slots:
private:
bool doCommit();
void recurser(QDomNode xml_node, QWidget *parent);
- QDomDocument *xml_doc;
QVector< Widget* > widgets;
QString macro;
QString version;
diff --git a/client/macro.cc b/client/macro.cc
index 08a956a..d06e4c0 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -64,6 +64,7 @@ void create_macro(QString name)
QDomDocument xml_doc;
if (!xml_doc.setContent(ba)) {
printf("ERROR: Invalid XML recieved!\n");
+ fwrite(ba.data(), ba.size(), 1, stdout);
}
// Initiate the macro builder with the xml document
@@ -99,7 +100,7 @@ static QDomDocument xml_request(QString name)
printf("macro: %s, cpr: %s, user: %s\n", name.toStdString().c_str(), cpr.toStdString().c_str(), user.toStdString().c_str());
xml_array.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
xml_array.append("<pracro version=\"1.0\" cpr=\"" + cpr + "\" user=\"" + user + "\">\n");
- xml_array.append(" <request macro=\"" + name + "\"/>\n");
+ xml_array.append(" <request course=\"example2\" macro=\"" + name + "\"/>\n");
xml_array.append("</pracro>");
// Print to stdout for debug purposes
diff --git a/client/pracro.ini b/client/pracro.ini
index 8c33be6..8192ea5 100644
--- a/client/pracro.ini
+++ b/client/pracro.ini
@@ -1,3 +1,3 @@
[server]
-host=gargamel.j.auh.dk
+host=127.0.0.1
port=12345