diff options
Diffstat (limited to 'src/qt3support/network')
-rw-r--r-- | src/qt3support/network/network.pri | 2 | ||||
-rw-r--r-- | src/qt3support/network/q3dns.cpp | 84 | ||||
-rw-r--r-- | src/qt3support/network/q3ftp.cpp | 24 | ||||
-rw-r--r-- | src/qt3support/network/q3http.cpp | 15 | ||||
-rw-r--r-- | src/qt3support/network/q3socketdevice_win.cpp | 7 | ||||
-rw-r--r-- | src/qt3support/network/q3url.cpp | 61 | ||||
-rw-r--r-- | src/qt3support/network/q3urloperator.cpp | 2 |
7 files changed, 78 insertions, 117 deletions
diff --git a/src/qt3support/network/network.pri b/src/qt3support/network/network.pri index 31ea682..086f56a 100644 --- a/src/qt3support/network/network.pri +++ b/src/qt3support/network/network.pri @@ -26,5 +26,5 @@ SOURCES += network/q3dns.cpp \ win32:SOURCES += network/q3socketdevice_win.cpp unix:SOURCES += network/q3socketdevice_unix.cpp -mac:LIBS += -lresolv +mac:LIBS_PRIVATE += -lresolv diff --git a/src/qt3support/network/q3dns.cpp b/src/qt3support/network/q3dns.cpp index 1564a81..4d92065 100644 --- a/src/qt3support/network/q3dns.cpp +++ b/src/qt3support/network/q3dns.cpp @@ -1738,7 +1738,7 @@ void Q3Dns::setLabel( const QString & label ) const char * dom; while( (dom=it.current()) != 0 ) { ++it; - n.append( l.lower() + QLatin1String(".") + QLatin1String(dom) ); + n.append( l.lower() + QLatin1Char('.') + QLatin1String(dom) ); } } n.append( l.lower() ); @@ -1902,8 +1902,8 @@ QString Q3Dns::toInAddrArpaDomain( const QHostAddress &address ) s = QLatin1String("ip6.arpa"); uint b = 0; while( b < 16 ) { - s = QString::number( i.c[b]%16, 16 ) + QLatin1String(".") + - QString::number( i.c[b]/16, 16 ) + QLatin1String(".") + s; + s = QString::number( i.c[b]%16, 16 ) + QLatin1Char('.') + + QString::number( i.c[b]/16, 16 ) + QLatin1Char('.') + s; b++; } } @@ -2242,53 +2242,31 @@ typedef struct { typedef DWORD (WINAPI *GNP)( PFIXED_INFO, PULONG ); // ### FIXME: this code is duplicated in qfiledialog.cpp -static QString getWindowsRegString( HKEY key, const QString &subKey ) +static QString getWindowsRegString(HKEY key, const QString &subKey) { QString s; - QT_WA( { - char buf[1024]; - DWORD bsz = sizeof(buf); - int r = RegQueryValueEx( key, (TCHAR*)subKey.ucs2(), 0, 0, (LPBYTE)buf, &bsz ); - if ( r == ERROR_SUCCESS ) { - s = QString::fromUcs2( (unsigned short *)buf ); - } else if ( r == ERROR_MORE_DATA ) { - char *ptr = new char[bsz+1]; - r = RegQueryValueEx( key, (TCHAR*)subKey.ucs2(), 0, 0, (LPBYTE)ptr, &bsz ); - if ( r == ERROR_SUCCESS ) - s = QLatin1String(ptr); - delete [] ptr; - } - } , { - char buf[512]; - DWORD bsz = sizeof(buf); - int r = RegQueryValueExA( key, subKey.local8Bit(), 0, 0, (LPBYTE)buf, &bsz ); - if ( r == ERROR_SUCCESS ) { - s = QLatin1String(buf); - } else if ( r == ERROR_MORE_DATA ) { - char *ptr = new char[bsz+1]; - r = RegQueryValueExA( key, subKey.local8Bit(), 0, 0, (LPBYTE)ptr, &bsz ); - if ( r == ERROR_SUCCESS ) - s = QLatin1String(ptr); - delete [] ptr; - } - } ); + + wchar_t buf[1024]; + DWORD bsz = sizeof(buf) / sizeof(wchar_t); + int r = RegQueryValueEx(key, (wchar_t*)subKey.utf16(), 0, 0, (LPBYTE)buf, &bsz); + if (r == ERROR_SUCCESS) { + s = QString::fromWCharArray(buf); + } else if (r == ERROR_MORE_DATA) { + char *ptr = new char[bsz+1]; + r = RegQueryValueEx(key, (wchar_t*)subKey.utf16(), 0, 0, (LPBYTE)ptr, &bsz); + if (r == ERROR_SUCCESS) + s = QLatin1String(ptr); + delete [] ptr; + } + return s; } static bool getDnsParamsFromRegistry( const QString &path, - QString *domainName, QString *nameServer, QString *searchList ) + QString *domainName, QString *nameServer, QString *searchList ) { HKEY k; - int r; - QT_WA( { - r = RegOpenKeyEx( HKEY_LOCAL_MACHINE, - (TCHAR*)path.ucs2(), - 0, KEY_READ, &k ); - } , { - r = RegOpenKeyExA( HKEY_LOCAL_MACHINE, - path.latin1(), - 0, KEY_READ, &k ); - } ); + int r = RegOpenKeyEx( HKEY_LOCAL_MACHINE, (wchar_t*)path.utf16(), 0, KEY_READ, &k ); if ( r == ERROR_SUCCESS ) { *domainName = getWindowsRegString( k, QLatin1String("DhcpDomain") ); @@ -2321,14 +2299,10 @@ void Q3Dns::doResInit() bool gotNetworkParams = false; // try the API call GetNetworkParams() first and use registry lookup only // as a fallback -#ifdef Q_OS_WINCE - HINSTANCE hinstLib = LoadLibraryW( L"iphlpapi" ); -#else - HINSTANCE hinstLib = LoadLibraryA( "iphlpapi" ); -#endif + HINSTANCE hinstLib = LoadLibrary( L"iphlpapi" ); if ( hinstLib != 0 ) { #ifdef Q_OS_WINCE - GNP getNetworkParams = (GNP) GetProcAddressW( hinstLib, L"GetNetworkParams" ); + GNP getNetworkParams = (GNP) GetProcAddress( hinstLib, L"GetNetworkParams" ); #else GNP getNetworkParams = (GNP) GetProcAddress( hinstLib, "GetNetworkParams" ); #endif @@ -2347,7 +2321,7 @@ void Q3Dns::doResInit() nameServer += QLatin1String(dnsServer->IpAddress.String); dnsServer = dnsServer->Next; if ( dnsServer != 0 ) - nameServer += QLatin1String(" "); + nameServer += QLatin1Char(' '); } searchList = QLatin1String(""); separator = ' '; @@ -2360,15 +2334,9 @@ void Q3Dns::doResInit() } if ( !gotNetworkParams ) { if ( getDnsParamsFromRegistry( - QString( QLatin1String("System\\CurrentControlSet\\Services\\Tcpip\\Parameters") ), + QLatin1String("System\\CurrentControlSet\\Services\\Tcpip\\Parameters"), &domainName, &nameServer, &searchList )) { - // for NT separator = ' '; - } else if ( getDnsParamsFromRegistry( - QString( QLatin1String("System\\CurrentControlSet\\Services\\VxD\\MSTCP") ), - &domainName, &nameServer, &searchList )) { - // for Windows 98 - separator = ','; } else { // Could not access the TCP/IP parameters domainName = QLatin1String(""); @@ -2395,7 +2363,7 @@ void Q3Dns::doResInit() } while( first < (int)nameServer.length() ); } - searchList = searchList + QLatin1String(" ") + domainName; + searchList += QLatin1Char(' ') + domainName; searchList = searchList.simplifyWhiteSpace().lower(); first = 0; do { @@ -2488,7 +2456,7 @@ void Q3Dns::doResInit() while ( !stream.atEnd() ) { line = stream.readLine(); QStringList list = QStringList::split( QLatin1String(" "), line ); - if( line.startsWith( QLatin1String("#") ) || list.size() < 2 ) + if( line.startsWith( QLatin1Char('#') ) || list.size() < 2 ) continue; const QString type = list[0].lower(); diff --git a/src/qt3support/network/q3ftp.cpp b/src/qt3support/network/q3ftp.cpp index fdb94ec..a10fc2c 100644 --- a/src/qt3support/network/q3ftp.cpp +++ b/src/qt3support/network/q3ftp.cpp @@ -485,7 +485,7 @@ bool Q3FtpDTP::parseDir( const QString &buffer, const QString &userName, QUrlInf dateStr += lst[ 6 ]; dateStr += QLatin1Char(' '); - if ( lst[ 7 ].contains( QLatin1String(":") ) ) { + if ( lst[ 7 ].contains( QLatin1Char(':') ) ) { time = QTime( lst[ 7 ].left( 2 ).toInt(), lst[ 7 ].right( 2 ).toInt() ); dateStr += QString::number( QDate::currentDate().year() ); } else { @@ -495,7 +495,7 @@ bool Q3FtpDTP::parseDir( const QString &buffer, const QString &userName, QUrlInf QDate date = QDate::fromString( dateStr ); info->setLastModified( QDateTime( date, time ) ); - if ( lst[ 7 ].contains( QLatin1String(":") ) ) { + if ( lst[ 7 ].contains( QLatin1Char(':') ) ) { const int futureTolerance = 600; if( info->lastModified().secsTo( QDateTime::currentDateTime() ) < -futureTolerance ) { QDateTime dt = info->lastModified(); @@ -512,7 +512,7 @@ bool Q3FtpDTP::parseDir( const QString &buffer, const QString &userName, QUrlInf else { QString n; for ( uint i = 8; i < (uint) lst.count(); ++i ) - n += lst[ i ] + QLatin1String(" "); + n += lst[ i ] + QLatin1Char(' '); n = n.stripWhiteSpace(); info->setName( n ); } @@ -897,7 +897,7 @@ bool Q3FtpPI::processReply() // ### error handling } else { QStringList lst = addrPortPattern.capturedTexts(); - QString host = lst[1] + QLatin1String(".") + lst[2] + QLatin1String(".") + lst[3] + QLatin1String(".") + lst[4]; + QString host = lst[1] + QLatin1Char('.') + lst[2] + QLatin1Char('.') + lst[3] + QLatin1Char('.') + lst[4]; Q_UINT16 port = ( lst[5].toUInt() << 8 ) + lst[6].toUInt(); waitForDtpToConnect = true; dtp.connectToHost( host, port ); @@ -1144,7 +1144,7 @@ static void delete_d( const Q3Ftp* foo ) Some commands, e.g. list(), emit additional signals to report their results. - Example: If you want to download the INSTALL file from Trolltech's + Example: If you want to download the INSTALL file from the Qt FTP server, you would write this: \snippet doc/src/snippets/code/src_qt3support_network_q3ftp.cpp 2 @@ -1435,8 +1435,8 @@ int Q3Ftp::connectToHost( const QString &host, Q_UINT16 port ) int Q3Ftp::login( const QString &user, const QString &password ) { QStringList cmds; - cmds << ( QString(QLatin1String("USER ")) + ( user.isNull() ? QString(QLatin1String("anonymous")) : user ) + QLatin1String("\r\n") ); - cmds << ( QString(QLatin1String("PASS ")) + ( password.isNull() ? QString(QLatin1String("anonymous@")) : password ) + QLatin1String("\r\n") ); + cmds << ( QString::fromLatin1("USER ") + ( user.isNull() ? QString::fromLatin1("anonymous") : user ) + QLatin1String("\r\n") ); + cmds << ( QString::fromLatin1("PASS ") + ( password.isNull() ? QString::fromLatin1("anonymous@") : password ) + QLatin1String("\r\n") ); return addCommand( new Q3FtpCommand( Login, cmds ) ); } @@ -2095,7 +2095,7 @@ void Q3Ftp::operationListChildren( Q3NetworkOperation *op ) { op->setState( StInProgress ); - cd( ( url()->path().isEmpty() ? QString( QLatin1String("/") ) : url()->path() ) ); + cd( ( url()->path().isEmpty() ? QString::fromLatin1("/") : url()->path() ) ); list(); emit start( op ); } @@ -2115,7 +2115,7 @@ void Q3Ftp::operationRemove( Q3NetworkOperation *op ) { op->setState( StInProgress ); - cd( ( url()->path().isEmpty() ? QString( QLatin1String("/") ) : url()->path() ) ); + cd( ( url()->path().isEmpty() ? QString::fromLatin1("/") : url()->path() ) ); remove( Q3Url( op->arg( 0 ) ).path() ); } @@ -2125,7 +2125,7 @@ void Q3Ftp::operationRename( Q3NetworkOperation *op ) { op->setState( StInProgress ); - cd( ( url()->path().isEmpty() ? QString( QLatin1String("/") ) : url()->path() ) ); + cd( ( url()->path().isEmpty() ? QString::fromLatin1("/") : url()->path() ) ); rename( op->arg( 0 ), op->arg( 1 )); } @@ -2179,8 +2179,8 @@ bool Q3Ftp::checkConnection( Q3NetworkOperation *op ) connectToHost( url()->host(), url()->port() != -1 ? url()->port() : 21 ); break; } - QString user = url()->user().isEmpty() ? QString( QLatin1String("anonymous") ) : url()->user(); - QString pass = url()->password().isEmpty() ? QString( QLatin1String("anonymous@") ) : url()->password(); + QString user = url()->user().isEmpty() ? QString::fromLatin1("anonymous") : url()->user(); + QString pass = url()->password().isEmpty() ? QString::fromLatin1("anonymous@") : url()->password(); login( user, pass ); } diff --git a/src/qt3support/network/q3http.cpp b/src/qt3support/network/q3http.cpp index ce72df8..65c36b3 100644 --- a/src/qt3support/network/q3http.cpp +++ b/src/qt3support/network/q3http.cpp @@ -468,7 +468,7 @@ bool Q3HttpHeader::parse( const QString& str ) if ( !(*it).isEmpty() ) { if ( (*it)[0].isSpace() ) { if ( !lines.isEmpty() ) { - lines.last() += QLatin1String(" "); + lines.last() += QLatin1Char(' '); lines.last() += (*it).stripWhiteSpace(); } } else { @@ -562,7 +562,7 @@ void Q3HttpHeader::removeValue( const QString& key ) */ bool Q3HttpHeader::parseLine( const QString& line, int ) { - int i = line.find( QLatin1String(":") ); + int i = line.find( QLatin1Char(':') ); if ( i == -1 ) return false; @@ -647,7 +647,7 @@ QString Q3HttpHeader::contentType() const if ( type.isEmpty() ) return QString(); - int pos = type.find( QLatin1String(";") ); + int pos = type.find( QLatin1Char(';') ); if ( pos == -1 ) return type; @@ -785,7 +785,7 @@ int Q3HttpResponseHeader::minorVersion() const return minVer; } -/*! \reimp +/*! \internal */ bool Q3HttpResponseHeader::parseLine( const QString& line, int number ) { @@ -952,7 +952,7 @@ int Q3HttpRequestHeader::minorVersion() const return minVer; } -/*! \reimp +/*! \internal */ bool Q3HttpRequestHeader::parseLine( const QString& line, int number ) { @@ -1048,8 +1048,7 @@ QString Q3HttpRequestHeader::toString() const To make an HTTP request you must set up suitable HTTP headers. The following example demonstrates, how to request the main HTML page - from the Qt web site (i.e. the URL - http://qt.nokia.com/index.html): + from the Qt website (i.e. the URL \c http://qt.nokia.com/index.html): \snippet doc/src/snippets/code/src_qt3support_network_q3http.cpp 3 @@ -2210,7 +2209,7 @@ void Q3Http::clientReply( const Q3HttpResponseHeader &rep ) if ( rep.statusCode() >= 400 && rep.statusCode() < 600 ) { op->setState( StFailed ); op->setProtocolDetail( - QString(QLatin1String("%1 %2")).arg(rep.statusCode()).arg(rep.reasonPhrase()) + QString::fromLatin1("%1 %2").arg(rep.statusCode()).arg(rep.reasonPhrase()) ); switch ( rep.statusCode() ) { case 401: diff --git a/src/qt3support/network/q3socketdevice_win.cpp b/src/qt3support/network/q3socketdevice_win.cpp index a052de7..65e09b3 100644 --- a/src/qt3support/network/q3socketdevice_win.cpp +++ b/src/qt3support/network/q3socketdevice_win.cpp @@ -47,20 +47,15 @@ #include <string.h> +# include <qt_windows.h> #if defined (QT_NO_IPV6) -# include <windows.h> # include <winsock.h> #else # if defined (Q_CC_BOR) || defined (Q_CC_GNU) # include <winsock2.h> -# elif defined (Q_CC_INTEL) -# include <winsock.h> # else -# include <windows.h> -# if defined(Q_OS_WINCE) # include <winsock.h> # endif -# endif // Use our own defines and structs which we know are correct # define QT_SS_MAXSIZE 128 # define QT_SS_ALIGNSIZE (sizeof(__int64)) diff --git a/src/qt3support/network/q3url.cpp b/src/qt3support/network/q3url.cpp index 3448f4e..8401be3 100644 --- a/src/qt3support/network/q3url.cpp +++ b/src/qt3support/network/q3url.cpp @@ -211,8 +211,8 @@ Q3Url::Q3Url( const Q3Url& url ) bool Q3Url::isRelativeUrl( const QString &url ) { - int colon = url.find( QLatin1String(":") ); - int slash = url.find( QLatin1String("/") ); + int colon = url.find( QLatin1Char(':') ); + int slash = url.find( QLatin1Char('/') ); return ( slash != 0 && ( colon == -1 || ( slash != -1 && colon > slash ) ) ); } @@ -280,8 +280,8 @@ Q3Url::Q3Url( const Q3Url& url, const QString& relUrl, bool checkSlash ) if ( !d->host.isEmpty() && !d->user.isEmpty() && !d->pass.isEmpty() ) p = QLatin1String("/"); } - if ( !p.isEmpty() && p.right(1)!=QLatin1String("/") ) - p += QLatin1String("/"); + if ( !p.isEmpty() && !p.endsWith(QLatin1Char('/')) ) + p += QLatin1Char('/'); p += rel; d->path = p; d->cleanPathDirty = true; @@ -678,7 +678,7 @@ bool Q3Url::parse( const QString& url ) ++cs; while ( url_[ cs ] == QLatin1Char('/') ) ++cs; - int slash = url_.find( QLatin1String("/"), cs ); + int slash = url_.find( QLatin1Char('/'), cs ); if ( slash == -1 ) slash = url_.length() - 1; QString tmp = url_.mid( cs, slash - cs + 1 ); @@ -686,7 +686,7 @@ bool Q3Url::parse( const QString& url ) if ( !tmp.isEmpty() ) { // if this part exists // look for the @ in this part - int at = tmp.find( QLatin1String("@") ); + int at = tmp.find( QLatin1Char('@') ); if ( at != -1 ) at += cs; // we have no @, which means host[:port], so directly @@ -793,7 +793,7 @@ bool Q3Url::parse( const QString& url ) // hack for windows if ( d->path.length() == 2 && d->path[ 1 ] == QLatin1Char(':') ) - d->path += QLatin1String("/"); + d->path += QLatin1Char('/'); // #### do some corrections, should be done nicer too if ( !d->pass.isEmpty() ) { @@ -808,7 +808,7 @@ bool Q3Url::parse( const QString& url ) if ( d->path[ 0 ] == QLatin1Char('@') || d->path[ 0 ] == QLatin1Char(':') ) d->path.remove( (uint)0, 1 ); if ( d->path[ 0 ] != QLatin1Char('/') && !relPath && d->path[ 1 ] != QLatin1Char(':') ) - d->path.prepend( QLatin1String("/") ); + d->path.prepend( QLatin1Char('/') ); } if ( !d->refEncoded.isEmpty() && d->refEncoded[ 0 ] == QLatin1Char('#') ) d->refEncoded.remove( (uint)0, 1 ); @@ -820,9 +820,9 @@ bool Q3Url::parse( const QString& url ) #if defined(Q_OS_WIN32) // hack for windows file://machine/path syntax if ( d->protocol == QLatin1String("file") ) { - if ( url.left( 7 ) == QLatin1String("file://") && + if ( url.startsWith(QLatin1String("file://")) && d->path.length() > 1 && d->path[ 1 ] != QLatin1Char(':') ) - d->path.prepend( QLatin1String("/") ); + d->path.prepend( QLatin1Char('/') ); } #endif @@ -942,7 +942,7 @@ void Q3Url::setFileName( const QString& name ) p += fn; if ( !d->queryEncoded.isEmpty() ) - p += QLatin1String("?") + d->queryEncoded; + p += QLatin1Char('?') + d->queryEncoded; setEncodedPathAndQuery( p ); } @@ -961,7 +961,7 @@ QString Q3Url::encodedPathAndQuery() encode( p ); if ( !d->queryEncoded.isEmpty() ) { - p += QLatin1String("?"); + p += QLatin1Char('?'); p += d->queryEncoded; } @@ -1011,7 +1011,7 @@ QString Q3Url::path( bool correct ) const } else if ( isLocalFile() ) { #if defined(Q_OS_WIN32) // hack for stuff like \\machine\path and //machine/path on windows - if ( ( d->path.left( 1 ) == QLatin1String("/") || d->path.left( 1 ) == QLatin1String("\\") ) && + if ( ( d->path.startsWith(QLatin1Char('/')) || d->path.startsWith(QLatin1Char('\\')) ) && d->path.length() > 1 ) { d->cleanPath = d->path; bool share = (d->cleanPath[0] == QLatin1Char('\\') && d->cleanPath[1] == QLatin1Char('\\')) || @@ -1021,7 +1021,7 @@ QString Q3Url::path( bool correct ) const if ( share ) { check = false; while (d->cleanPath.at(0) != QLatin1Char('/') || d->cleanPath.at(1) != QLatin1Char('/')) - d->cleanPath.prepend(QLatin1String("/")); + d->cleanPath.prepend(QLatin1Char('/')); } } #endif @@ -1036,7 +1036,7 @@ QString Q3Url::path( bool correct ) const dir = QDir::cleanDirPath( canPath ); else dir = QDir::cleanDirPath( QDir( d->path ).absPath() ); - dir += QLatin1String("/"); + dir += QLatin1Char('/'); if ( dir == QLatin1String("//") ) d->cleanPath = QLatin1String("/"); else @@ -1046,14 +1046,13 @@ QString Q3Url::path( bool correct ) const QDir::cleanDirPath( (qt_resolve_symlinks ? fi.dir().canonicalPath() : fi.dir().absPath()) ); - d->cleanPath = p + QLatin1String("/") + fi.fileName(); + d->cleanPath = p + QLatin1Char('/') + fi.fileName(); } } } else { - if ( d->path != QLatin1String("/") && d->path[ (int)d->path.length() - 1 ] == QLatin1Char('/') ) - d->cleanPath = QDir::cleanDirPath( d->path ) + QLatin1String("/"); - else d->cleanPath = QDir::cleanDirPath( d->path ); + if ( d->path.length() > 1 && d->path.endsWith(QLatin1Char('/')) ) + d->cleanPath += QLatin1Char('/'); } if ( check ) @@ -1084,9 +1083,9 @@ bool Q3Url::isLocalFile() const QString Q3Url::fileName() const { - if ( d->path.isEmpty() || d->path.endsWith( QLatin1String("/") ) + if ( d->path.isEmpty() || d->path.endsWith( QLatin1Char('/') ) #ifdef Q_WS_WIN - || d->path.endsWith( QLatin1String("\\") ) + || d->path.endsWith( QLatin1Char('\\') ) #endif ) return QString(); @@ -1110,12 +1109,12 @@ void Q3Url::addPath( const QString& pa ) if ( path().isEmpty() ) { if ( p[ 0 ] != QLatin1Char( '/' ) ) - d->path = QLatin1String("/") + p; + d->path = QLatin1Char('/') + p; else d->path = p; } else { if ( p[ 0 ] != QLatin1Char( '/' ) && d->path[ (int)d->path.length() - 1 ] != QLatin1Char('/') ) - d->path += QLatin1String("/") + p; + d->path += QLatin1Char('/') + p; else d->path += p; } @@ -1250,11 +1249,11 @@ QString Q3Url::toString( bool encodedPath, bool forcePrependProtocol ) const if ( isLocalFile() ) { if ( forcePrependProtocol ) - res = d->protocol + QLatin1String(":") + p; + res = d->protocol + QLatin1Char(':') + p; else res = p; } else if ( d->protocol == QLatin1String("mailto") ) { - res = d->protocol + QLatin1String(":") + p; + res = d->protocol + QLatin1Char(':') + p; } else { res = d->protocol + QLatin1String("://"); if ( !d->user.isEmpty() || !d->pass.isEmpty() ) { @@ -1267,24 +1266,24 @@ QString Q3Url::toString( bool encodedPath, bool forcePrependProtocol ) const if ( !d->pass.isEmpty() ) { tmp = d->pass; encode( tmp ); - res += QLatin1String(":") + tmp; + res += QLatin1Char(':') + tmp; } - res += QLatin1String("@"); + res += QLatin1Char('@'); } res += d->host; if ( d->port != -1 ) - res += QLatin1String(":") + QString( QLatin1String("%1") ).arg( d->port ); + res += QLatin1Char(':') + QString::number( d->port ); if ( !p.isEmpty() ) { if ( !d->host.isEmpty() && p[0]!= QLatin1Char( '/' ) ) - res += QLatin1String("/"); + res += QLatin1Char('/'); res += p; } } if ( !d->refEncoded.isEmpty() ) - res += QLatin1String("#") + d->refEncoded; + res += QLatin1Char('#') + d->refEncoded; if ( !d->queryEncoded.isEmpty() ) - res += QLatin1String("?") + d->queryEncoded; + res += QLatin1Char('?') + d->queryEncoded; return res; } diff --git a/src/qt3support/network/q3urloperator.cpp b/src/qt3support/network/q3urloperator.cpp index a32dfc1..be1c192 100644 --- a/src/qt3support/network/q3urloperator.cpp +++ b/src/qt3support/network/q3urloperator.cpp @@ -579,7 +579,7 @@ Q3PtrList<Q3NetworkOperation> Q3UrlOperator::copy( const QString &from, const QS if (frm == to + file) return ops; - file.prepend( QLatin1String("/") ); + file.prepend( QLatin1Char('/') ); // uFrom and uTo are deleted when the Q3NetworkProtocol deletes itself via // autodelete |