Changeset 8203 in ntrip for trunk/BNC/src
- Timestamp:
- Dec 11, 2017, 2:42:03 PM (7 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bnccore.cpp
r8127 r8203 269 269 QString decoder = hlp[1]; 270 270 comments.append("Source: " + decoder + 271 " " + url.encodedHost() +271 " " + QUrl::toAce(url.host()) + 272 272 "/" + url.path().mid(1).toLatin1()); 273 273 } -
trunk/BNC/src/bnchlpdlg.cpp
r4278 r8203 38 38 * 39 39 * -----------------------------------------------------------------------*/ 40 41 #include <QHBoxLayout> 42 #include <QVBoxLayout> 40 43 41 44 #include "bnchlpdlg.h" -
trunk/BNC/src/bnchlpdlg.h
r4278 r8203 29 29 #include <QtGui> 30 30 31 #include <QDialog> 32 #include <QPushButton> 33 31 34 class bncHtml; 32 35 -
trunk/BNC/src/bncnetqueryrtp.cpp
r6787 r8203 48 48 if (_socket) { 49 49 QByteArray reqStr = "TEARDOWN " + _url.toEncoded() + " RTSP/1.0\r\n" 50 + "CSeq: " + QString("%1").arg(++_CSeq).to Ascii() + "\r\n"50 + "CSeq: " + QString("%1").arg(++_CSeq).toLatin1() + "\r\n" 51 51 + "Session: " + _session + "\r\n" 52 52 + "\r\n"; … … 60 60 if (_socket) { 61 61 QByteArray reqStr = "GET_PARAMETER " + _url.toEncoded() + " RTSP/1.0\r\n" 62 + "CSeq: " + QString("%1").arg(++_CSeq).to Ascii() + "\r\n"62 + "CSeq: " + QString("%1").arg(++_CSeq).toLatin1() + "\r\n" 63 63 + "Session: " + _session + "\r\n" 64 64 + "\r\n"; … … 126 126 // -------------- 127 127 if (_socket->waitForConnected(timeOut)) { 128 QString uName = QUrl::fromPercentEncoding(_url.userName().to Ascii());129 QString passW = QUrl::fromPercentEncoding(_url.password().to Ascii());128 QString uName = QUrl::fromPercentEncoding(_url.userName().toLatin1()); 129 QString passW = QUrl::fromPercentEncoding(_url.password().toLatin1()); 130 130 QByteArray userAndPwd; 131 131 132 132 if(!uName.isEmpty() || !passW.isEmpty()) { 133 userAndPwd = "Authorization: Basic " + (uName.to Ascii() + ":" +134 passW.to Ascii()).toBase64() + "\r\n";133 userAndPwd = "Authorization: Basic " + (uName.toLatin1() + ":" + 134 passW.toLatin1()).toBase64() + "\r\n"; 135 135 } 136 136 … … 141 141 _udpSocket->bind(0); 142 142 connect(_udpSocket, SIGNAL(readyRead()), _eventLoop, SLOT(quit())); 143 QByteArray clientPort = QString("%1").arg(_udpSocket->localPort()).to Ascii();143 QByteArray clientPort = QString("%1").arg(_udpSocket->localPort()).toLatin1(); 144 144 145 145 QByteArray reqStr; 146 146 reqStr = "SETUP " + _url.toEncoded() + " RTSP/1.0\r\n" 147 + "CSeq: " + QString("%1").arg(++_CSeq).to Ascii() + "\r\n"147 + "CSeq: " + QString("%1").arg(++_CSeq).toLatin1() + "\r\n" 148 148 + "Ntrip-Version: Ntrip/2.0\r\n" 149 149 + "Ntrip-Component: Ntripclient\r\n" … … 167 167 while (!line.isEmpty()) { 168 168 if (line.indexOf("Session:") == 0) { 169 _session = line.mid(9).to Ascii();169 _session = line.mid(9).toLatin1(); 170 170 } 171 171 int iSrv = line.indexOf("server_port="); 172 172 if (iSrv != -1) { 173 serverPort = line.mid(iSrv+12).to Ascii();173 serverPort = line.mid(iSrv+12).toLatin1(); 174 174 } 175 175 line = in.readLine(); … … 203 203 204 204 reqStr = "PLAY " + _url.toEncoded() + " RTSP/1.0\r\n" 205 + "CSeq: " + QString("%1").arg(++_CSeq).to Ascii() + "\r\n"205 + "CSeq: " + QString("%1").arg(++_CSeq).toLatin1() + "\r\n" 206 206 + "Session: " + _session + "\r\n" 207 207 + "\r\n"; -
trunk/BNC/src/bncnetqueryv1.cpp
r6787 r8203 91 91 _socket = 0; 92 92 _status = error; 93 emit newMessage(_url.path().to Ascii().replace(0,1,"")94 + ": " + errStr.to Ascii(), true);93 emit newMessage(_url.path().toLatin1().replace(0,1,"") 94 + ": " + errStr.toLatin1(), true); 95 95 return; 96 96 } … … 157 157 _socket = 0; 158 158 _status = error; 159 emit newMessage(_url.path().to Ascii().replace(0,1,"")159 emit newMessage(_url.path().toLatin1().replace(0,1,"") 160 160 + ": Write timeout", true); 161 161 return; … … 208 208 // Send Request 209 209 // ------------ 210 QString uName = QUrl::fromPercentEncoding(_url.userName().to Ascii());211 QString passW = QUrl::fromPercentEncoding(_url.password().to Ascii());210 QString uName = QUrl::fromPercentEncoding(_url.userName().toLatin1()); 211 QString passW = QUrl::fromPercentEncoding(_url.password().toLatin1()); 212 212 QByteArray userAndPwd; 213 213 214 214 if(!uName.isEmpty() || !passW.isEmpty()) { 215 userAndPwd = "Authorization: Basic " + (uName.to Ascii() + ":" +216 passW.to Ascii()).toBase64() + "\r\n";215 userAndPwd = "Authorization: Basic " + (uName.toLatin1() + ":" + 216 passW.toLatin1()).toBase64() + "\r\n"; 217 217 } 218 218 … … 220 220 if ( proxyHost.isEmpty() ) { 221 221 if (_url.path().indexOf("/") != 0) _url.setPath("/"); 222 reqStr = "GET " + _url.path().to Ascii() + " HTTP/1.0\r\n"222 reqStr = "GET " + _url.path().toLatin1() + " HTTP/1.0\r\n" 223 223 + "User-Agent: NTRIP BNC/" BNCVERSION " (" BNC_OS ")\r\n" 224 + "Host: " + _url.host().to Ascii() + "\r\n"224 + "Host: " + _url.host().toLatin1() + "\r\n" 225 225 + userAndPwd + "\r\n"; 226 226 } else { 227 227 reqStr = "GET " + _url.toEncoded() + " HTTP/1.0\r\n" 228 228 + "User-Agent: NTRIP BNC/" BNCVERSION " (" BNC_OS ")\r\n" 229 + "Host: " + _url.host().to Ascii() + "\r\n"229 + "Host: " + _url.host().toLatin1() + "\r\n" 230 230 + userAndPwd + "\r\n"; 231 231 } … … 243 243 _socket = 0; 244 244 _status = error; 245 emit newMessage(_url.path().to Ascii().replace(0,1,"")245 emit newMessage(_url.path().toLatin1().replace(0,1,"") 246 246 + ": Write timeout", true); 247 247 return; … … 294 294 _socket = 0; 295 295 _status = error; 296 emit newMessage(_url.path().to Ascii().replace(0,1,"")296 emit newMessage(_url.path().toLatin1().replace(0,1,"") 297 297 + ": Response timeout", true); 298 298 return; … … 303 303 _socket = 0; 304 304 _status = error; 305 emit newMessage(_url.path().to Ascii().replace(0,1,"")305 emit newMessage(_url.path().toLatin1().replace(0,1,"") 306 306 + ": Wrong caster response\n" 307 + response.join("").to Ascii(), true);307 + response.join("").toLatin1(), true); 308 308 } 309 309 } -
trunk/BNC/src/bncnetqueryv2.cpp
r7851 r8203 76 76 if (_reply && _reply->error() != QNetworkReply::NoError) { 77 77 _status = error; 78 emit newMessage(_url.path().to Ascii().replace(0,1,"") +78 emit newMessage(_url.path().toLatin1().replace(0,1,"") + 79 79 ": NetQueryV2: server replied: " + 80 80 _reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray(), … … 144 144 request.setSslConfiguration(sslConfig); 145 145 request.setUrl(_url); 146 request.setRawHeader("Host" , _url.host().to Ascii());146 request.setRawHeader("Host" , _url.host().toLatin1()); 147 147 request.setRawHeader("Ntrip-Version", "Ntrip/2.0"); 148 request.setRawHeader("User-Agent" , "NTRIP BNC/" BNCVERSION" ("BNC_OS")");148 request.setRawHeader("User-Agent" , "NTRIP BNC/" BNCVERSION " (" BNC_OS ")"); 149 149 if (!_url.userName().isEmpty()) { 150 QString uName = QUrl::fromPercentEncoding(_url.userName().to Ascii());151 QString passW = QUrl::fromPercentEncoding(_url.password().to Ascii());150 QString uName = QUrl::fromPercentEncoding(_url.userName().toLatin1()); 151 QString passW = QUrl::fromPercentEncoding(_url.password().toLatin1()); 152 152 request.setRawHeader("Authorization", "Basic " + 153 (uName + ":" + passW).to Ascii().toBase64());153 (uName + ":" + passW).toLatin1().toBase64()); 154 154 } 155 155 if (!gga.isEmpty()) { … … 226 226 msg += QString("Server Certificate Issued by:\n" 227 227 "%1\n%2\nCannot be verified\n") 228 #if QT_VERSION >= 0x050000 229 .arg(cert.issuerInfo(QSslCertificate::OrganizationalUnitName).at(0)) 230 .arg(cert.issuerInfo(QSslCertificate::Organization).at(0)); 231 #else 228 232 .arg(cert.issuerInfo(QSslCertificate::OrganizationalUnitName)) 229 233 .arg(cert.issuerInfo(QSslCertificate::Organization)); 234 #endif 230 235 } 231 236 QListIterator<QSslError> it(errors); … … 235 240 } 236 241 237 BNC_CORE->slotMessage(msg.to Ascii(), true);242 BNC_CORE->slotMessage(msg.toLatin1(), true); 238 243 239 244 if (_sslIgnoreErrors) { -
trunk/BNC/src/bnctableitem.h
r6549 r8203 29 29 #include <QtGui> 30 30 31 #include <QTableWidgetItem> 32 31 33 class bncGetThread; 32 34 -
trunk/BNC/src/bncutils.cpp
r8063 r8203 170 170 QString rxStr = it.next(); 171 171 QString envVar = rxStr.mid(2,rxStr.length()-3); 172 str.replace(rxStr, qgetenv(envVar.to Ascii()));172 str.replace(rxStr, qgetenv(envVar.toLatin1())); 173 173 } 174 174 } … … 307 307 char XOR = 0; 308 308 char Buff[gga.size()]; 309 strncpy(Buff, gga.to Ascii().data(), gga.size());309 strncpy(Buff, gga.toLatin1().data(), gga.size()); 310 310 int iLen = strlen(Buff); 311 311 for (xori = 0; xori < iLen; xori++) { … … 314 314 gga = "$" + gga + QString("*%1").arg(XOR, 2, 16, QLatin1Char('0')); 315 315 316 return gga.to Ascii();316 return gga.toLatin1(); 317 317 } 318 318 -
trunk/BNC/src/bnczerodecoder.cpp
r4278 r8203 76 76 delete _out; 77 77 QByteArray fileName = 78 (_fileName + "_" + currDate.toString("yyMMdd")).to Ascii();78 (_fileName + "_" + currDate.toString("yyMMdd")).toLatin1(); 79 79 bncSettings settings; 80 80 if (Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
Note:
See TracChangeset
for help on using the changeset viewer.