diff options
| author | deva <deva> | 2009-11-12 12:25:28 +0000 | 
|---|---|---|
| committer | deva <deva> | 2009-11-12 12:25:28 +0000 | 
| commit | 90fe99277f0300eb7f0b80545d6a21f94198d45f (patch) | |
| tree | 5fa0d5e16a3aae2c20e334921a10b955d3811c49 /client/netcom.cc | |
| parent | ef8ca720c38d91e9892eb3ed85f4b7d459d43b83 (diff) | |
Improved (fixed) http communication.
Diffstat (limited to 'client/netcom.cc')
| -rw-r--r-- | client/netcom.cc | 16 | 
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  | 
