diff options
-rw-r--r-- | client/netcom.cc | 16 | ||||
-rw-r--r-- | client/netcom.h | 4 |
2 files changed, 15 insertions, 5 deletions
diff --git a/client/netcom.cc b/client/netcom.cc index 5cbcd22..be240e2 100644 --- a/client/netcom.cc +++ b/client/netcom.cc @@ -51,7 +51,9 @@ NetCom::NetCom(QString host, quint16 port, QString user, QString cpr) this->user = user; this->cpr = cpr; - connect(&http, SIGNAL(done(bool)), this, SLOT(done(bool))); + connect(&http, SIGNAL(readyRead(const QHttpResponseHeader &)), + this, SLOT(readyRead(const QHttpResponseHeader &))); + connect(&http, SIGNAL(stateChanged(int)), this, SLOT(stateChanged(int))); #ifdef USE_SSL connect(&http, SIGNAL(sslErrors(const QList<QSslError> &)), @@ -161,10 +163,16 @@ void NetCom::send(QVector< Widget* > widgets, QString templ, QString macro, QStr if(qApp->activeWindow()) qApp->activeWindow()->setEnabled(true); } -void NetCom::done(bool) +void NetCom::readyRead(const QHttpResponseHeader &) { - buffer = http.readAll(); - transfering = false; + // printf("STATE: readyRead\n"); + buffer += http.readAll(); +} + +void NetCom::stateChanged(int state) +{ + // printf("STATE: %d\n", state); + if(transfering && state == QHttp::Connected) transfering = false; } #ifdef USE_SSL diff --git a/client/netcom.h b/client/netcom.h index c40f85c..f1a8766 100644 --- a/client/netcom.h +++ b/client/netcom.h @@ -48,7 +48,9 @@ public: void send(QVector< Widget* > widgets, QString templ, QString macro, QString version); public slots: - void done(bool); + void stateChanged(int state); + void readyRead(const QHttpResponseHeader &resp); + #ifdef USE_SSL void sslError(const QList<QSslError> &errlst); #endif |