Index: trunk/BNC/bnc.pro
===================================================================
--- trunk/BNC/bnc.pro	(revision 1369)
+++ trunk/BNC/bnc.pro	(revision 1370)
@@ -2,6 +2,6 @@
 # Switch to debug configuration
 # -----------------------------
-CONFIG -= release
-CONFIG += debug
+CONFIG -= debug
+CONFIG += release
 
 DEFINES += NO_RTCM3_MAIN 
Index: trunk/BNC/bncnetrequest.cpp
===================================================================
--- trunk/BNC/bncnetrequest.cpp	(revision 1369)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/* -------------------------------------------------------------------------
- * BKG NTRIP Client
- * -------------------------------------------------------------------------
- *
- * Class:      bncNetRequest
- *
- * Purpose:    Prepare and submit network request
- *
- * Author:     L. Mervart
- *
- * Created:    09-Dec-2008
- *
- * Changes:    
- *
- * -----------------------------------------------------------------------*/
-
-#include <iostream>
-#include <iomanip>
-
-#include "bncnetrequest.h"
-#include "RTCM3/RTCM3Decoder.h"
-
-using namespace std;
-
-// Constructor
-////////////////////////////////////////////////////////////////////////////
-bncNetRequest::bncNetRequest() {
-  _manager = 0;
-  _reply   = 0;
-  _decoder = new RTCM3Decoder("TEST1");
-  connect((RTCM3Decoder*) _decoder, SIGNAL(newMessage(QByteArray,bool)), 
-          this, SIGNAL(slotNewMessage(QByteArray,bool)));
-}
-
-// Destructor
-////////////////////////////////////////////////////////////////////////////
-bncNetRequest::~bncNetRequest() {
-  cout << "~bncNetRequest" << endl;
-  delete _reply;
-  delete _manager;
-}
-
-// Network Request
-////////////////////////////////////////////////////////////////////////////
-t_irc bncNetRequest::request(const QUrl& url) {
-
-  // Network Access Manager
-  // ----------------------
-  if (_manager == 0) {
-    _manager = new QNetworkAccessManager(this);
-  }
-  else {
-    return failure;
-  }
-
-  // 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");
-  if (!url.userName().isEmpty()) {
-    request.setRawHeader("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>&)), 
-          this, SLOT(slotSslErrors(const QList<QSslError>&)));
-
-
-  return success;
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncNetRequest::slotReplyFinished() {
-  cout << "slotReplyFinished" << endl;
-  this->deleteLater();
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncNetRequest::slotReadyRead() {
-  cout << "slotReadyRead" << endl;
-  QByteArray buffer = _reply->readAll();
-<<<<<<< bncnetrequest.cpp
-  cerr << buffer.data();
-=======
-
-  vector<string> errmsg;
-  _decoder->Decode(buffer.data(), buffer.length(), errmsg);
-
-  QListIterator<p_obs> it(_decoder->_obsList);
-  while (it.hasNext()) {
-    p_obs obs = it.next();
-    cout << obs->_o.satSys   << obs->_o.satNum   << " " 
-         << obs->_o.GPSWeek  << " " 
-         << obs->_o.GPSWeeks << " " 
-         << obs->_o.C1       << " " 
-         << obs->_o.C2       << " "
-         << obs->_o.P1       << " " 
-         << obs->_o.P2       << " "
-         << obs->_o.L1       << " " 
-         << obs->_o.L2       << endl;
-    delete obs;
-  }
-  _decoder->_obsList.clear();
->>>>>>> 1.9
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncNetRequest::slotError(QNetworkReply::NetworkError) {
-  cout << "slotError " << _reply->error() << endl
-       << _reply->errorString().toAscii().data() << endl;
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncNetRequest::slotSslErrors(const QList<QSslError>&) {
-  cout << "slotSslError" << endl;
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncNetRequest::slotNewMessage(QByteArray msg, bool) {
-  cout << "Message: " << msg.data() << endl;
-}
Index: trunk/BNC/bncnetrequest.h
===================================================================
--- trunk/BNC/bncnetrequest.h	(revision 1369)
+++ 	(revision )
@@ -1,31 +1,0 @@
-#ifndef BNCNETREQUEST_H
-#define BNCNETREQUEST_H
-
-#include <QtNetwork>
-#include "bncconst.h"
-#include "RTCM/GPSDecoder.h"
-
-class bncNetRequest : public QObject {
- Q_OBJECT
-
- public:
-  bncNetRequest();
-  ~bncNetRequest();
-  t_irc request(const QUrl& mountPoint);
-
- signals:
-
- private slots:
-  void slotReplyFinished();
-  void slotReadyRead();
-  void slotError(QNetworkReply::NetworkError);
-  void slotSslErrors(const QList<QSslError>&);
-  void slotNewMessage(QByteArray,bool);
-
- private:
-  QNetworkAccessManager* _manager;
-  QNetworkReply*         _reply;
-  GPSDecoder*            _decoder;
-};
-
-#endif
Index: trunk/BNC/bncsocket.cpp
===================================================================
--- trunk/BNC/bncsocket.cpp	(revision 1369)
+++ trunk/BNC/bncsocket.cpp	(revision 1370)
@@ -32,6 +32,8 @@
                app, SLOT(slotMessage(const QByteArray,bool)));
   _socket    = 0;
-  _http      = 0;
-  connect(this, SIGNAL(quitEventLoop()), &_eventLoop, SLOT(quit()));
+  _manager   = 0;
+  _reply     = 0;
+  _eventLoop = new QEventLoop();
+  connect(this, SIGNAL(quitEventLoop()), _eventLoop, SLOT(quit()));
 }
 
@@ -39,6 +41,8 @@
 ////////////////////////////////////////////////////////////////////////////
 bncSocket::~bncSocket() {
+  delete _eventLoop;
+  delete _reply;
+  delete _manager;
   delete _socket;
-  delete _http;
 }
 
@@ -46,6 +50,6 @@
 ////////////////////////////////////////////////////////////////////////////
 QAbstractSocket::SocketState bncSocket::state() const {
-  if      (_http) {
-    if (_http->state() != QHttp::Unconnected) {
+  if      (_manager) {
+    if (_reply) {
       return QAbstractSocket::ConnectedState;
     }
@@ -73,5 +77,5 @@
 ////////////////////////////////////////////////////////////////////////////
 qint64 bncSocket::bytesAvailable() const {
-  if      (_http) { 
+  if      (_manager) { 
     return _buffer.size();
   }
@@ -87,5 +91,5 @@
 ////////////////////////////////////////////////////////////////////////////
 bool bncSocket::canReadLine() const {
-  if      (_http) {
+  if      (_manager) {
     if (_buffer.indexOf('\n') != -1) {
       return true;
@@ -106,5 +110,5 @@
 ////////////////////////////////////////////////////////////////////////////
 QByteArray bncSocket::readLine() {
-  if      (_http) {
+  if      (_manager) {
     int ind = _buffer.indexOf('\n');
     if (ind != -1) {
@@ -128,10 +132,10 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncSocket::waitForReadyRead(int msecs) {
-  if      (_http) {
+  if      (_manager) {
     if (bytesAvailable() > 0) {
       return;
     }
     else {
-      _eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
+      _eventLoop->exec(QEventLoop::ExcludeUserInputEvents);
     }
   }
@@ -144,5 +148,5 @@
 ////////////////////////////////////////////////////////////////////////////
 QByteArray bncSocket::read(qint64 maxSize) {
-  if      (_http) {
+  if      (_manager) {
     QByteArray ret = _buffer.left(maxSize);
     _buffer = _buffer.right(_buffer.size()-maxSize);
@@ -289,15 +293,6 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-void bncSocket::slotRequestFinished(int /* id */, bool error) {
-  if (error) {
-    emit newMessage("slotRequestFinished " + 
-                    _http->errorString().toAscii(), true);
-  }
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncSocket::slotReadyRead(const QHttpResponseHeader&) {
-  _buffer.append(_http->readAll());
+void bncSocket::slotReadyRead() {
+  _buffer.append(_reply->readAll());
   emit quitEventLoop();
 }
@@ -305,9 +300,18 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-void bncSocket::slotDone(bool error) {
-  if (error) {
-    emit newMessage("slotDone " + _http->errorString().toAscii(), true);
-  }
+void bncSocket::slotReplyFinished() {
   emit quitEventLoop();
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncSocket::slotError(QNetworkReply::NetworkError) {
+  emit newMessage("slotError " + _reply->errorString().toAscii(), true);
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncSocket::slotSslErrors(const QList<QSslError>&) {
+  emit newMessage("slotSslErrors", true);
 }
 
@@ -318,34 +322,45 @@
                          int timeOut, QString& msg) {
 
-
-  delete _http;
-  _http = new QHttp();
-  
-  _http->setHost(url.host());
+  // Network Access Manager
+  // ----------------------
+  if (_manager == 0) {
+    _manager = new QNetworkAccessManager(this);
+  }
+  else {
+    return failure;
+  }
+
+  // Default scheme and path
+  // -----------------------
+  QUrl urlLoc(url);
+  if (urlLoc.scheme().isEmpty()) {
+    urlLoc.setScheme("http");
+  }
+  if (urlLoc.path().isEmpty()) {
+    urlLoc.setPath("/");
+  }
 
   // Network Request
   // ---------------
-  QString path = url.path();
-  if (path.isEmpty()) {
-    path = "/";
-  }
-  QHttpRequestHeader request("GET", path);
-  request.addValue("Host"         , url.host().toAscii());
-  request.addValue("Ntrip-Version", "NTRIP/2.0");
-  request.addValue("User-Agent"   , "NTRIP BNC/" BNCVERSION);
-  if (!url.userName().isEmpty()) {
-    request.addValue("Authorization", "Basic " + 
-                 (url.userName() + ":" + url.password()).toAscii().toBase64());
+  QNetworkRequest request;
+  request.setUrl(urlLoc);
+  request.setRawHeader("Host"         , urlLoc.host().toAscii());
+  request.setRawHeader("Ntrip-Version", "NTRIP/2.0");
+  request.setRawHeader("User-Agent"   , "NTRIP BNC/1.7");
+  if (!urlLoc.userName().isEmpty()) {
+    request.setRawHeader("Authorization", "Basic " + 
+           (urlLoc.userName() + ":" + urlLoc.password()).toAscii().toBase64());
   } 
-  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&)));
-
-  _http->request(request);
+  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>&)), 
+          this, SLOT(slotSslErrors(const QList<QSslError>&)));
+
 
   return success;
Index: trunk/BNC/bncsocket.h
===================================================================
--- trunk/BNC/bncsocket.h	(revision 1369)
+++ trunk/BNC/bncsocket.h	(revision 1370)
@@ -29,7 +29,8 @@
 
  private slots:
-  void slotDone(bool);
-  void slotRequestFinished(int, bool);
-  void slotReadyRead(const QHttpResponseHeader&);
+  void slotReplyFinished();
+  void slotReadyRead();
+  void slotError(QNetworkReply::NetworkError);
+  void slotSslErrors(const QList<QSslError>&);
 
  private:
@@ -38,8 +39,9 @@
                  int timeOut, QString& msg);
 
-  QTcpSocket* _socket;
-  QHttp*      _http;      
-  QByteArray  _buffer;
-  QEventLoop  _eventLoop;
+  QTcpSocket*            _socket;
+  QNetworkAccessManager* _manager;
+  QNetworkReply*         _reply;
+  QEventLoop*            _eventLoop;
+  QByteArray             _buffer;
 };
 
Index: trunk/BNC/ntrip2test.cpp
===================================================================
--- trunk/BNC/ntrip2test.cpp	(revision 1369)
+++ 	(revision )
@@ -1,24 +1,0 @@
-
-#include <QApplication>
-
-#include "bncnetrequest.h"
-
-using namespace std;
-
-// Main Program
-/////////////////////////////////////////////////////////////////////////////
-int main(int argc, char *argv[]) {
-
-  QApplication app(argc, argv, false);
-
-
-  bncNetRequest* req1 = new bncNetRequest();
-  QUrl url1("http://euref-ip.bkg.bund.de:2111/");
-  req1->request(url1);
-
-  bncNetRequest* req2 = new bncNetRequest();
-  QUrl url2("http://ntrip2c:rtcm2c@euref-ip.bkg.bund.de:2111/TEST2");
-  req2->request(url2);
-
-  return app.exec();
-}
Index: trunk/BNC/ntrip2test.pro
===================================================================
--- trunk/BNC/ntrip2test.pro	(revision 1369)
+++ 	(revision )
@@ -1,35 +1,0 @@
-
-# Switch to debug configuration
-# -----------------------------
-CONFIG -= release
-CONFIG += debug
-
-DEFINES += NO_RTCM3_MAIN 
-
-# Get rid of mingwm10.dll
-# -----------------------
-win32:QMAKE_LFLAGS                 -= -mthreads
-win32:QMAKE_CXXFLAGS_EXCEPTIONS_ON -= -mthreads
-win32:QMAKE_LFLAGS_EXCEPTIONS_ON   -= -mthreads
-
-debug:OBJECTS_DIR=.obj/debug
-debug:MOC_DIR=.moc/debug
-release:OBJECTS_DIR=.obj/release
-release:MOC_DIR=.moc/release
-
-HEADERS =                bncnetrequest.h   bncutils.h   bncrinex.h    \
-          RTCM/GPSDecoder.h RTCM/RTCM2.h RTCM/RTCM2Decoder.h          \
-          RTCM/RTCM2_2021.h RTCM/rtcm_utils.h                         \
-          RTCM3/RTCM3Decoder.h RTCM3/rtcm3torinex.h                   \
-          RTCM3/RTCM3coDecoder.h RTCM3/clock_orbit_rtcm.h             \
-          RTCM3/ephemeris.h RTCM3/timeutils.h                         \
-
-SOURCES = ntrip2test.cpp bncnetrequest.cpp bncutils.cpp bncrinex.cpp  \
-          RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp                        \
-          RTCM/RTCM2_2021.cpp RTCM/rtcm_utils.cpp                     \
-          RTCM3/RTCM3Decoder.cpp RTCM3/rtcm3torinex.c                 \
-          RTCM3/RTCM3coDecoder.cpp RTCM3/clock_orbit_rtcm.c           \
-          RTCM3/ephemeris.cpp RTCM3/timeutils.cpp                     
-
-QT += network
-
