diff options
Diffstat (limited to 'client/macro.cc')
-rw-r--r-- | client/macro.cc | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/client/macro.cc b/client/macro.cc index 669674b..5e3b83d 100644 --- a/client/macro.cc +++ b/client/macro.cc @@ -32,25 +32,24 @@ #define MY_EVENT_ID 65432 +extern QString cpr; +extern QString user; + class MyEvent : public QEvent { public: - MyEvent(QString macro, QString cpr, QString user) : QEvent((QEvent::Type)MY_EVENT_ID) + MyEvent(QString macro) : 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, QString cpr, QString user); +static QDomDocument xml_request(QString name); -void create_macro(QString name, QString cpr, QString user) +void create_macro(QString name) { // Build the XML request - QDomDocument xml_req = xml_request(name, cpr, user); + QDomDocument xml_req = xml_request(name); // Fetch the XML document SendRecieve xml_acquire; @@ -76,7 +75,7 @@ bool MyEventHandler::eventFilter( QObject *o, QEvent *e ) if ( e->type() == MY_EVENT_ID ) { MyEvent *event = (MyEvent*)e; - create_macro(event->macro, event->cpr, event->user); + create_macro(event->macro); // ... DO SOMETHING WITH EVENT return TRUE; // eat event } else { @@ -85,13 +84,15 @@ bool MyEventHandler::eventFilter( QObject *o, QEvent *e ) } } -void new_macro(QString macro, QString cpr, QString user) +void new_macro(QString macro) { - MyEvent *event = new MyEvent(macro, cpr, user); + MyEvent *event = new MyEvent(macro); qApp->postEvent(qApp, event); + qApp->processEvents(); /* To prevent QT from closing when + no windows are present */ } -static QDomDocument xml_request(QString name, QString cpr, QString user) +static QDomDocument xml_request(QString name) { // Create the xml request array QByteArray xml_array; |