From b275f9c20d283c4d45fb08d4c306c8481d54565d Mon Sep 17 00:00:00 2001 From: senator Date: Tue, 18 Mar 2008 12:38:10 +0000 Subject: set command line behaviour to use macro, cpr and user --- client/macro.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'client/macro.cc') diff --git a/client/macro.cc b/client/macro.cc index 654557d..669674b 100644 --- a/client/macro.cc +++ b/client/macro.cc @@ -34,19 +34,23 @@ class MyEvent : public QEvent { public: - MyEvent(QString macro) : QEvent((QEvent::Type)MY_EVENT_ID) + MyEvent(QString macro, QString cpr, QString user) : QEvent((QEvent::Type)MY_EVENT_ID) { this->macro = macro; + this->cpr = cpr; + this->user = user; } QString macro; + QString cpr; + QString user; }; -static QDomDocument xml_request(QString name); +static QDomDocument xml_request(QString name, QString cpr, QString user); -void create_macro(QString name) +void create_macro(QString name, QString cpr, QString user) { // Build the XML request - QDomDocument xml_req = xml_request(name); + QDomDocument xml_req = xml_request(name, cpr, user); // Fetch the XML document SendRecieve xml_acquire; @@ -72,7 +76,7 @@ bool MyEventHandler::eventFilter( QObject *o, QEvent *e ) if ( e->type() == MY_EVENT_ID ) { MyEvent *event = (MyEvent*)e; - create_macro(event->macro); + create_macro(event->macro, event->cpr, event->user); // ... DO SOMETHING WITH EVENT return TRUE; // eat event } else { @@ -81,18 +85,19 @@ bool MyEventHandler::eventFilter( QObject *o, QEvent *e ) } } -void new_macro(QString macro) +void new_macro(QString macro, QString cpr, QString user) { - MyEvent *event = new MyEvent(macro); + MyEvent *event = new MyEvent(macro, cpr, user); qApp->postEvent(qApp, event); } -static QDomDocument xml_request(QString name) +static QDomDocument xml_request(QString name, QString cpr, QString user) { // Create the xml request array QByteArray xml_array; + printf("macro: %s, cpr: %s, user: %s\n", name.toStdString().c_str(), cpr.toStdString().c_str(), user.toStdString().c_str()); xml_array.append("\n"); - xml_array.append("\n"); + xml_array.append("\n"); xml_array.append(" \n"); xml_array.append(""); -- cgit v1.2.3