Index: /trunk/BNC/bnc.pro
===================================================================
--- /trunk/BNC/bnc.pro	(revision 1356)
+++ /trunk/BNC/bnc.pro	(revision 1357)
@@ -2,6 +2,6 @@
 # Switch to debug configuration
 # -----------------------------
-CONFIG += release
-###CONFIG += debug
+CONFIG -= release
+CONFIG += debug
 
 DEFINES += NO_RTCM3_MAIN 
Index: /trunk/BNC/bncsocket.cpp
===================================================================
--- /trunk/BNC/bncsocket.cpp	(revision 1356)
+++ /trunk/BNC/bncsocket.cpp	(revision 1357)
@@ -32,8 +32,5 @@
                app, SLOT(slotMessage(const QByteArray,bool)));
   _socket = 0;
-#if QT_VERSION >= 0x040400
-  _manager = 0;
-  _reply   = 0;
-#endif
+  _http   = 0;
 }
 
@@ -41,9 +38,7 @@
 ////////////////////////////////////////////////////////////////////////////
 bncSocket::~bncSocket() {
+  cout << "~bncSocket" << endl;
   delete _socket;
-#if QT_VERSION >= 0x040400
-  _reply->deleteLater();
-  _manager->deleteLater();
-#endif
+  delete _http;
 }
 
@@ -52,9 +47,4 @@
 void bncSocket::connectToHost(const QString &hostName, quint16 port, 
                               QIODevice::OpenMode mode) {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-  }
-  else
-#endif
   if (_socket) {
     _socket->connectToHost(hostName, port, mode);
@@ -65,10 +55,4 @@
 ////////////////////////////////////////////////////////////////////////////
 bool bncSocket::waitForConnected(int msecs) {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return true;
-  }
-  else
-#endif
   if (_socket) {
     return _socket->waitForConnected(msecs);
@@ -82,10 +66,4 @@
 ////////////////////////////////////////////////////////////////////////////
 QAbstractSocket::SocketState bncSocket::state() const {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return QAbstractSocket::ConnectedState;
-  }
-  else
-#endif
   if (_socket) {
     return _socket->state();
@@ -99,10 +77,4 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncSocket::close() {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    _reply->close();
-  }
-  else
-#endif
   if (_socket) {
     _socket->close();
@@ -113,10 +85,4 @@
 ////////////////////////////////////////////////////////////////////////////
 qint64 bncSocket::bytesAvailable() const {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return _reply->bytesAvailable();
-  }
-  else
-#endif
   if (_socket) {
     return _socket->bytesAvailable();
@@ -130,10 +96,4 @@
 ////////////////////////////////////////////////////////////////////////////
 bool bncSocket::canReadLine() const {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return _reply->canReadLine();
-  }
-  else
-#endif
   if (_socket) {
     return _socket->canReadLine();
@@ -147,10 +107,4 @@
 ////////////////////////////////////////////////////////////////////////////
 QByteArray bncSocket::readLine(qint64 maxlen) {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return _reply->readLine(maxlen);
-  }
-  else
-#endif
   if (_socket) {
     return _socket->readLine(maxlen);
@@ -164,10 +118,4 @@
 ////////////////////////////////////////////////////////////////////////////
 bool bncSocket::waitForReadyRead(int msecs) {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return _reply->waitForReadyRead(msecs);
-  }
-  else
-#endif
   if (_socket) {
     return _socket->waitForReadyRead(msecs);
@@ -181,10 +129,4 @@
 ////////////////////////////////////////////////////////////////////////////
 qint64 bncSocket::read(char* data, qint64 maxlen) {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return _reply->read(data, maxlen);
-  }
-  else
-#endif
   if (_socket) {
     return _socket->read(data, maxlen);
@@ -198,10 +140,4 @@
 ////////////////////////////////////////////////////////////////////////////
 qint64 bncSocket::write(const char* data, qint64 len) {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return -1;
-  }
-  else
-#endif
   if (_socket) {
     return _socket->write(data, len);
@@ -215,10 +151,4 @@
 ////////////////////////////////////////////////////////////////////////////
 bool bncSocket::waitForBytesWritten(int msecs) {
-#if QT_VERSION >= 0x040400
-  if (_reply) {
-    return _reply->waitForBytesWritten(msecs);
-  }
-  else
-#endif
   if (_socket) {
     return _socket->waitForBytesWritten(msecs);
@@ -361,35 +291,26 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-#if QT_VERSION >= 0x040400
-void bncSocket::slotReplyFinished() {
-  cout << "slotReplyFinished" << endl;
+void bncSocket::slotRequestFinished(int id, bool error) {
+  cout << "slotRequestFinished " << id << " " << error << endl;
   this->deleteLater();
 }
-#endif
-
-// 
-////////////////////////////////////////////////////////////////////////////
-#if QT_VERSION >= 0x040400
-void bncSocket::slotReadyRead() {
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncSocket::slotReadyRead(const QHttpResponseHeader&) {
   cout << "slotReadyRead" << endl;
 }
-#endif
-
-// 
-////////////////////////////////////////////////////////////////////////////
-#if QT_VERSION >= 0x040400
-void bncSocket::slotError(QNetworkReply::NetworkError) {
-  cout << "slotError " << _reply->error() << endl
-       << _reply->errorString().toAscii().data() << endl;
-}
-#endif
-
-// 
-////////////////////////////////////////////////////////////////////////////
-#if QT_VERSION >= 0x040400
+
+// 
+////////////////////////////////////////////////////////////////////////////
 void bncSocket::slotSslErrors(const QList<QSslError>&) {
   cout << "slotSslError" << endl;
 }
-#endif
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncSocket::slotDone(bool error) {
+  cout << "slotDone " << error << endl;
+}
 
 // Connect to Caster NTRIP Version 2
@@ -398,40 +319,34 @@
                          const QByteArray& longitude, const QByteArray& nmea,
                          int timeOut, QString& msg) {
-#if QT_VERSION < 0x040400
-  emit newMessage("NTRIP v2 requires Qt Version 4.4 or higher", "true");
-  return failure;
-#else
-  // Network Access Manager
-  // ----------------------
-  if (_manager == 0) {
-    _manager = new QNetworkAccessManager(this);
-  }
-  else {
-    return failure;
-  }
+
+  delete _socket;
+  _socket = new QTcpSocket();
+
+  delete _http;
+  _http = new QHttp();
+  
+  _http->setSocket(_socket);
 
   // Network Request
   // ---------------
-  QNetworkRequest request;
-  request.setUrl(url);
-  request.setRawHeader("Host"         , url.host().toAscii());
-  request.setRawHeader("Ntrip-Version", "NTRIP/2.0");
-  request.setRawHeader("User-Agent"   , "NTRIP BNC/1.7");
+  QHttpRequestHeader request("GET", url.path());
+  request.addValue("Host"         , url.host().toAscii());
+  request.addValue("Ntrip-Version", "NTRIP/2.0");
+  request.addValue("User-Agent"   , "NTRIP BNC/1.7");
   if (!url.userName().isEmpty()) {
-    request.setRawHeader("Authorization", "Basic " + 
+    request.addValue("Authorization", "Basic " + 
                  (url.userName() + ":" + url.password()).toAscii().toBase64());
   } 
-  request.setRawHeader("Connection"   , "close");
-
-  _reply = _manager->get(request);
-
-  connect(_reply, SIGNAL(finished()), this, SLOT(slotReplyFinished()));
-  connect(_reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead()));
-  connect(_reply, SIGNAL(error(QNetworkReply::NetworkError)),
-          this, SLOT(slotError(QNetworkReply::NetworkError)));
-  connect(_reply, SIGNAL(sslErrors(const QList<QSslError>&)), 
+  request.addValue("Connection"   , "close");
+
+
+  connect(_http, SIGNAL(done(bool)), this, SLOT(slotDone(bool)));
+  connect(_http, SIGNAL(requestFinished(int, bool)), 
+          this, SLOT(slotRequestFinished(int, bool)));
+  connect(_http, SIGNAL(readyRead(const QHttpResponseHeader&)), 
+          this, SLOT(slotReadyRead(const QHttpResponseHeader&)));
+  connect(_http, SIGNAL(sslErrors(const QList<QSslError>&)), 
           this, SLOT(slotSslErrors(const QList<QSslError>&)));
 
   return success;
-#endif
-}
+}
Index: /trunk/BNC/bncsocket.h
===================================================================
--- /trunk/BNC/bncsocket.h	(revision 1356)
+++ /trunk/BNC/bncsocket.h	(revision 1357)
@@ -5,5 +5,5 @@
 #include "bncconst.h"
 
-class bncSocket : public QObject {
+class bncSocket : public QThread {
  Q_OBJECT
 
@@ -33,10 +33,8 @@
 
  private slots:
-#if QT_VERSION >= 0x040400
-  void slotReplyFinished();
-  void slotReadyRead();
-  void slotError(QNetworkReply::NetworkError);
+  void slotDone(bool);
+  void slotRequestFinished(int, bool);
+  void slotReadyRead(const QHttpResponseHeader&);
   void slotSslErrors(const QList<QSslError>&);
-#endif
 
  private:
@@ -45,9 +43,6 @@
                  int timeOut, QString& msg);
 
-  QTcpSocket*            _socket;
-#if QT_VERSION >= 0x040400
-  QNetworkAccessManager* _manager;
-  QNetworkReply*         _reply;
-#endif
+  QTcpSocket* _socket;
+  QHttp*      _http;      
 };
 
