summaryrefslogtreecommitdiff
path: root/client/netcom.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/netcom.cc')
-rw-r--r--client/netcom.cc16
1 files changed, 12 insertions, 4 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