Index: trunk/BNC/bncgetthread.cpp
===================================================================
--- trunk/BNC/bncgetthread.cpp	(revision 87)
+++ trunk/BNC/bncgetthread.cpp	(revision 88)
@@ -32,17 +32,7 @@
 // Constructor
 ////////////////////////////////////////////////////////////////////////////
-bncGetThread::bncGetThread(const QString& host, int port,
-                           const QString& proxyHost, int proxyPort,
-                           const QByteArray& mountPoint,
-                           const QByteArray& user, 
-                           const QByteArray& password,
-                           const QByteArray& format) {
-  _host       = host;
-  _port       = port;
-  _proxyHost  = proxyHost;
-  _proxyPort  = proxyPort;
+bncGetThread::bncGetThread(const QUrl& mountPoint, const QByteArray& format) {
   _mountPoint = mountPoint;
-  _user       = user;
-  _password   = password;
+  _staID      = mountPoint.path().toAscii();
   _format     = format;
   _socket     = 0;
@@ -57,31 +47,19 @@
 // Connect to Caster, send the Request (static)
 ////////////////////////////////////////////////////////////////////////////
-QTcpSocket* bncGetThread::request(const QString& host, int port,
-                                  const QString& proxyHost, int proxyPort,
-                                  const QByteArray& mountPoint,
-                                  const QByteArray& user, 
-                                  const QByteArray& password,
-                                  QString& msg) {
+QTcpSocket* bncGetThread::request(const QUrl& mountPoint, QString& msg) {
 
-  msg.clear();
-
+  // Connect the Socket
+  // ------------------
+  QSettings settings;
+  QString proxyHost = settings.value("proxyHost").toString();
+  int     proxyPort = settings.value("proxyPort").toInt();
+ 
   QTcpSocket* socket = new QTcpSocket();
-
-  QByteArray l_mountPoint = mountPoint;
-
   if ( proxyHost.isEmpty() ) {
-    socket->connectToHost(host, port);
+    socket->connectToHost(mountPoint.host(), mountPoint.port());
   }
   else {
     socket->connectToHost(proxyHost, proxyPort);
-    if (!proxyHost.isEmpty()) {
-      QUrl proxyUrl;
-      proxyUrl.setScheme("http");
-      proxyUrl.setHost(host);
-      proxyUrl.setPort(port);
-      l_mountPoint = proxyUrl.resolved(QUrl(mountPoint)).toEncoded();
-    }
   }
-
   if (!socket->waitForConnected(timeOut)) {
     msg += "Connect timeout\n";
@@ -92,9 +70,11 @@
   // Send Request
   // ------------
-  QByteArray userAndPwd = user + ":" + password;
-  QByteArray reqStr = "GET " + l_mountPoint + " HTTP/1.0\r\n"
-                      "User-Agent: NTRIP BNC 1.0\r\n"
-                      "Authorization: Basic " + userAndPwd.toBase64() + 
-                      "\r\n\r\n";
+  QByteArray userAndPwd = mountPoint.userName().toAscii() + ":" + 
+                          mountPoint.password().toAscii();
+  QByteArray  reqStr = "GET " + mountPoint.path().toAscii() + 
+                       " HTTP/1.0\r\n"
+                       "User-Agent: NTRIP BNC 1.0\r\n"
+                       "Authorization: Basic " +
+                       userAndPwd.toBase64() + "\r\n\r\n";
 
   msg += reqStr;
@@ -118,6 +98,7 @@
   // ----------------
   QString msg;
-  _socket = bncGetThread::request(_host, _port, _proxyHost, _proxyPort, 
-                                  _mountPoint, _user, _password, msg);
+
+  _socket = bncGetThread::request(_mountPoint, msg);
+
   emit(newMessage(msg.toAscii()));
 
@@ -146,17 +127,17 @@
 
   if      (_format.indexOf("RTCM_2") != -1) {
-    emit(newMessage("Get Data: " + _mountPoint + " in RTCM 2.x format"));
+    emit(newMessage("Get Data: " + _staID + " in RTCM 2.x format"));
     decoder = new RTCM('A',true);
   }
   else if (_format.indexOf("RTCM_3") != -1) {
-    emit(newMessage("Get Data: " + _mountPoint + " in RTCM 3.0 format"));
+    emit(newMessage("Get Data: " + _staID + " in RTCM 3.0 format"));
     decoder = new rtcm3();
   }
   else if (_format.indexOf("RTIGS") != -1) {
-    emit(newMessage("Get Data: " + _mountPoint + " in RTIGS format"));
+    emit(newMessage("Get Data: " + _staID + " in RTIGS format"));
     decoder = new rtigs();
   }
   else {
-    emit(newMessage(_mountPoint + " Unknown data format " + _format));
+    emit(newMessage(_staID + " Unknown data format " + _format));
     return exit(1);
   }
@@ -174,5 +155,5 @@
       for (list<Observation*>::iterator it = decoder->m_lObsList.begin(); 
            it != decoder->m_lObsList.end(); it++) {
-        emit newObs(_mountPoint, *it);
+        emit newObs(_staID, *it);
       }
       decoder->m_lObsList.clear();
@@ -190,5 +171,5 @@
 void bncGetThread::exit(int exitCode) {
   if (exitCode!= 0) {
-    emit error(_mountPoint);
+    emit error(_staID);
   }
   QThread::exit(exitCode);
