Changeset 8203 in ntrip for trunk


Ignore:
Timestamp:
Dec 11, 2017, 2:42:03 PM (6 years ago)
Author:
stoecker
Message:

see #105 - some changes for Qt5

Location:
trunk/BNC/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnccore.cpp

    r8127 r8203  
    269269    QString decoder = hlp[1];
    270270    comments.append("Source: " + decoder +
    271                     " " + url.encodedHost() +
     271                    " " + QUrl::toAce(url.host()) +
    272272                    "/" + url.path().mid(1).toLatin1());
    273273  }
  • trunk/BNC/src/bnchlpdlg.cpp

    r4278 r8203  
    3838 *
    3939 * -----------------------------------------------------------------------*/
     40
     41#include <QHBoxLayout>
     42#include <QVBoxLayout>
    4043
    4144#include "bnchlpdlg.h"
  • trunk/BNC/src/bnchlpdlg.h

    r4278 r8203  
    2929#include <QtGui>
    3030
     31#include <QDialog>
     32#include <QPushButton>
     33
    3134class bncHtml;
    3235
  • trunk/BNC/src/bncnetqueryrtp.cpp

    r6787 r8203  
    4848  if (_socket) {
    4949    QByteArray reqStr = "TEARDOWN " + _url.toEncoded() + " RTSP/1.0\r\n"
    50                       + "CSeq: " + QString("%1").arg(++_CSeq).toAscii() + "\r\n"
     50                      + "CSeq: " + QString("%1").arg(++_CSeq).toLatin1() + "\r\n"
    5151                      + "Session: " + _session + "\r\n"
    5252                      + "\r\n";
     
    6060  if (_socket) {
    6161    QByteArray reqStr = "GET_PARAMETER " + _url.toEncoded() + " RTSP/1.0\r\n"
    62                       + "CSeq: " + QString("%1").arg(++_CSeq).toAscii() + "\r\n"
     62                      + "CSeq: " + QString("%1").arg(++_CSeq).toLatin1() + "\r\n"
    6363                      + "Session: " + _session + "\r\n"
    6464                      + "\r\n";
     
    126126  // --------------
    127127  if (_socket->waitForConnected(timeOut)) {
    128     QString uName = QUrl::fromPercentEncoding(_url.userName().toAscii());
    129     QString passW = QUrl::fromPercentEncoding(_url.password().toAscii());
     128    QString uName = QUrl::fromPercentEncoding(_url.userName().toLatin1());
     129    QString passW = QUrl::fromPercentEncoding(_url.password().toLatin1());
    130130    QByteArray userAndPwd;
    131131   
    132132    if(!uName.isEmpty() || !passW.isEmpty()) {
    133       userAndPwd = "Authorization: Basic " + (uName.toAscii() + ":" +
    134       passW.toAscii()).toBase64() + "\r\n";
     133      userAndPwd = "Authorization: Basic " + (uName.toLatin1() + ":" +
     134      passW.toLatin1()).toBase64() + "\r\n";
    135135    }
    136136
     
    141141    _udpSocket->bind(0);
    142142    connect(_udpSocket, SIGNAL(readyRead()), _eventLoop, SLOT(quit()));
    143     QByteArray clientPort = QString("%1").arg(_udpSocket->localPort()).toAscii();
     143    QByteArray clientPort = QString("%1").arg(_udpSocket->localPort()).toLatin1();
    144144
    145145    QByteArray reqStr;
    146146    reqStr = "SETUP " + _url.toEncoded() + " RTSP/1.0\r\n"
    147            + "CSeq: " + QString("%1").arg(++_CSeq).toAscii() + "\r\n"
     147           + "CSeq: " + QString("%1").arg(++_CSeq).toLatin1() + "\r\n"
    148148           + "Ntrip-Version: Ntrip/2.0\r\n"
    149149           + "Ntrip-Component: Ntripclient\r\n"
     
    167167        while (!line.isEmpty()) {
    168168          if (line.indexOf("Session:") == 0) {
    169             _session = line.mid(9).toAscii();
     169            _session = line.mid(9).toLatin1();
    170170          }
    171171          int iSrv = line.indexOf("server_port=");
    172172          if (iSrv != -1) {
    173             serverPort = line.mid(iSrv+12).toAscii();
     173            serverPort = line.mid(iSrv+12).toLatin1();
    174174          }
    175175          line = in.readLine();
     
    203203
    204204          reqStr = "PLAY " + _url.toEncoded() + " RTSP/1.0\r\n"
    205                  + "CSeq: " + QString("%1").arg(++_CSeq).toAscii() + "\r\n"
     205                 + "CSeq: " + QString("%1").arg(++_CSeq).toLatin1() + "\r\n"
    206206                 + "Session: " + _session + "\r\n"
    207207                 + "\r\n";
  • trunk/BNC/src/bncnetqueryv1.cpp

    r6787 r8203  
    9191        _socket = 0;
    9292        _status = error;
    93         emit newMessage(_url.path().toAscii().replace(0,1,"")
    94                         + ": " + errStr.toAscii(), true);
     93        emit newMessage(_url.path().toLatin1().replace(0,1,"")
     94                        + ": " + errStr.toLatin1(), true);
    9595        return;
    9696      }
     
    157157     _socket = 0;
    158158     _status = error;
    159      emit newMessage(_url.path().toAscii().replace(0,1,"")
     159     emit newMessage(_url.path().toLatin1().replace(0,1,"")
    160160                     + ": Write timeout", true);
    161161     return;
     
    208208  // Send Request
    209209  // ------------
    210   QString uName = QUrl::fromPercentEncoding(_url.userName().toAscii());
    211   QString passW = QUrl::fromPercentEncoding(_url.password().toAscii());
     210  QString uName = QUrl::fromPercentEncoding(_url.userName().toLatin1());
     211  QString passW = QUrl::fromPercentEncoding(_url.password().toLatin1());
    212212  QByteArray userAndPwd;
    213213
    214214  if(!uName.isEmpty() || !passW.isEmpty()) {
    215     userAndPwd = "Authorization: Basic " + (uName.toAscii() + ":" +
    216     passW.toAscii()).toBase64() + "\r\n";
     215    userAndPwd = "Authorization: Basic " + (uName.toLatin1() + ":" +
     216    passW.toLatin1()).toBase64() + "\r\n";
    217217  }
    218218
     
    220220  if ( proxyHost.isEmpty() ) {
    221221    if (_url.path().indexOf("/") != 0) _url.setPath("/");
    222     reqStr = "GET " + _url.path().toAscii() + " HTTP/1.0\r\n"
     222    reqStr = "GET " + _url.path().toLatin1() + " HTTP/1.0\r\n"
    223223             + "User-Agent: NTRIP BNC/" BNCVERSION " (" BNC_OS ")\r\n"
    224              + "Host: " + _url.host().toAscii() + "\r\n"
     224             + "Host: " + _url.host().toLatin1() + "\r\n"
    225225             + userAndPwd + "\r\n";
    226226  } else {
    227227    reqStr = "GET " + _url.toEncoded() + " HTTP/1.0\r\n"
    228228             + "User-Agent: NTRIP BNC/" BNCVERSION " (" BNC_OS ")\r\n"
    229              + "Host: " + _url.host().toAscii() + "\r\n"
     229             + "Host: " + _url.host().toLatin1() + "\r\n"
    230230             + userAndPwd + "\r\n";
    231231  }
     
    243243    _socket = 0;
    244244    _status = error;
    245     emit newMessage(_url.path().toAscii().replace(0,1,"")
     245    emit newMessage(_url.path().toLatin1().replace(0,1,"")
    246246                    + ": Write timeout", true);
    247247    return;
     
    294294        _socket = 0;
    295295        _status = error;
    296         emit newMessage(_url.path().toAscii().replace(0,1,"")
     296        emit newMessage(_url.path().toLatin1().replace(0,1,"")
    297297                        + ": Response timeout", true);
    298298        return;
     
    303303      _socket = 0;
    304304      _status = error;
    305       emit newMessage(_url.path().toAscii().replace(0,1,"")
     305      emit newMessage(_url.path().toLatin1().replace(0,1,"")
    306306                      + ": Wrong caster response\n"
    307                       + response.join("").toAscii(), true);
     307                      + response.join("").toLatin1(), true);
    308308    }
    309309  }
  • trunk/BNC/src/bncnetqueryv2.cpp

    r7851 r8203  
    7676  if (_reply && _reply->error() != QNetworkReply::NoError) {
    7777    _status = error;
    78     emit newMessage(_url.path().toAscii().replace(0,1,"")  +
     78    emit newMessage(_url.path().toLatin1().replace(0,1,"")  +
    7979                    ": NetQueryV2: server replied: " +
    8080                    _reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray(),
     
    144144  request.setSslConfiguration(sslConfig);
    145145  request.setUrl(_url);
    146   request.setRawHeader("Host"         , _url.host().toAscii());
     146  request.setRawHeader("Host"         , _url.host().toLatin1());
    147147  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 ")");
    149149  if (!_url.userName().isEmpty()) {
    150     QString uName = QUrl::fromPercentEncoding(_url.userName().toAscii());
    151     QString passW = QUrl::fromPercentEncoding(_url.password().toAscii());
     150    QString uName = QUrl::fromPercentEncoding(_url.userName().toLatin1());
     151    QString passW = QUrl::fromPercentEncoding(_url.password().toLatin1());
    152152    request.setRawHeader("Authorization", "Basic " +
    153                          (uName + ":" + passW).toAscii().toBase64());
     153                         (uName + ":" + passW).toLatin1().toBase64());
    154154  }
    155155  if (!gga.isEmpty()) {
     
    226226    msg += QString("Server Certificate Issued by:\n"
    227227                   "%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
    228232           .arg(cert.issuerInfo(QSslCertificate::OrganizationalUnitName))
    229233           .arg(cert.issuerInfo(QSslCertificate::Organization));
     234#endif
    230235  }
    231236  QListIterator<QSslError> it(errors);
     
    235240  }
    236241
    237   BNC_CORE->slotMessage(msg.toAscii(), true);
     242  BNC_CORE->slotMessage(msg.toLatin1(), true);
    238243
    239244  if (_sslIgnoreErrors) {
  • trunk/BNC/src/bnctableitem.h

    r6549 r8203  
    2929#include <QtGui>
    3030
     31#include <QTableWidgetItem>
     32
    3133class bncGetThread;
    3234
  • trunk/BNC/src/bncutils.cpp

    r8063 r8203  
    170170      QString rxStr  = it.next();
    171171      QString envVar = rxStr.mid(2,rxStr.length()-3);
    172       str.replace(rxStr, qgetenv(envVar.toAscii()));
     172      str.replace(rxStr, qgetenv(envVar.toLatin1()));
    173173    }
    174174  }
     
    307307  char XOR = 0;
    308308  char Buff[gga.size()];
    309   strncpy(Buff, gga.toAscii().data(), gga.size());
     309  strncpy(Buff, gga.toLatin1().data(), gga.size());
    310310  int iLen = strlen(Buff);
    311311  for (xori = 0; xori < iLen; xori++) {
     
    314314  gga = "$" + gga + QString("*%1").arg(XOR, 2, 16, QLatin1Char('0'));
    315315
    316   return gga.toAscii();
     316  return gga.toLatin1();
    317317}
    318318
  • trunk/BNC/src/bnczerodecoder.cpp

    r4278 r8203  
    7676    delete _out;
    7777    QByteArray fileName =
    78            (_fileName + "_" + currDate.toString("yyMMdd")).toAscii();
     78           (_fileName + "_" + currDate.toString("yyMMdd")).toLatin1();
    7979    bncSettings settings;
    8080    if (Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
Note: See TracChangeset for help on using the changeset viewer.