diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-06-25 13:49:53 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-06-25 13:49:53 (GMT) |
commit | db8f05e257019694f5e8076845626008f2adc3dd (patch) | |
tree | 05d3959403cf15ac5f702091439e028af01f343b /src/qt3support | |
parent | 8aafaa65a1d16f8b982279f5aceedf1e281ddb5a (diff) | |
parent | 796a5a2c7d8c91a46ac761dde18b7da2ec6c177b (diff) | |
download | Qt-db8f05e257019694f5e8076845626008f2adc3dd.zip Qt-db8f05e257019694f5e8076845626008f2adc3dd.tar.gz Qt-db8f05e257019694f5e8076845626008f2adc3dd.tar.bz2 |
Merge commit 'qt/master-stable' into 4.6-stable
Bring Qt 4.6 into the Qt-S60 repo.
Conflicts:
configure.exe
mkspecs/features/qttest_p4.prf
qmake/generators/makefile.cpp
src/corelib/io/qdir.cpp
src/corelib/io/qprocess.h
src/corelib/kernel/qcoreevent.h
src/corelib/kernel/qobject.cpp
src/corelib/kernel/qsharedmemory_unix.cpp
src/corelib/thread/qthread_p.h
src/corelib/tools/qvector.h
src/gui/dialogs/qdialog.cpp
src/gui/dialogs/qfiledialog.cpp
src/gui/dialogs/qfiledialog_p.h
src/gui/dialogs/qmessagebox.cpp
src/gui/graphicsview/qgraphicsitem.cpp
src/gui/graphicsview/qgraphicsview.cpp
src/gui/image/qpixmapcache.cpp
src/gui/kernel/qapplication.cpp
src/gui/kernel/qapplication_p.h
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget_p.h
src/gui/painting/qdrawhelper.cpp
src/gui/painting/qpaintengine_raster.cpp
src/gui/text/qfontengine_qpf.cpp
src/gui/widgets/qmenubar.cpp
src/network/socket/qlocalserver.cpp
src/testlib/qtestcase.cpp
src/testlib/testlib.pro
tests/auto/qimagereader/tst_qimagereader.cpp
tests/auto/qitemdelegate/tst_qitemdelegate.cpp
tests/auto/qnetworkreply/tst_qnetworkreply.cpp
tests/auto/qpixmap/qpixmap.pro
Diffstat (limited to 'src/qt3support')
-rw-r--r-- | src/qt3support/dialogs/q3filedialog.cpp | 14 | ||||
-rw-r--r-- | src/qt3support/dialogs/q3filedialog_mac.cpp | 2 | ||||
-rw-r--r-- | src/qt3support/dialogs/q3filedialog_win.cpp | 2 | ||||
-rw-r--r-- | src/qt3support/dialogs/q3tabdialog.cpp | 11 | ||||
-rw-r--r-- | src/qt3support/dialogs/q3tabdialog.h | 1 | ||||
-rw-r--r-- | src/qt3support/itemviews/q3iconview.cpp | 6 | ||||
-rw-r--r-- | src/qt3support/network/q3dns.cpp | 16 | ||||
-rw-r--r-- | src/qt3support/network/q3ftp.cpp | 22 | ||||
-rw-r--r-- | src/qt3support/network/q3http.cpp | 8 | ||||
-rw-r--r-- | src/qt3support/network/q3url.cpp | 61 | ||||
-rw-r--r-- | src/qt3support/network/q3urloperator.cpp | 2 | ||||
-rw-r--r-- | src/qt3support/other/q3dragobject.cpp | 11 | ||||
-rw-r--r-- | src/qt3support/other/q3process.cpp | 2 | ||||
-rw-r--r-- | src/qt3support/other/q3process_unix.cpp | 2 | ||||
-rw-r--r-- | src/qt3support/other/q3process_win.cpp | 10 | ||||
-rw-r--r-- | src/qt3support/painting/q3paintengine_svg.cpp | 48 | ||||
-rw-r--r-- | src/qt3support/text/q3richtext.cpp | 28 | ||||
-rw-r--r-- | src/qt3support/text/q3textedit.cpp | 4 | ||||
-rw-r--r-- | src/qt3support/widgets/q3action.cpp | 2 | ||||
-rw-r--r-- | src/qt3support/widgets/q3mainwindow.cpp | 18 |
20 files changed, 138 insertions, 132 deletions
diff --git a/src/qt3support/dialogs/q3filedialog.cpp b/src/qt3support/dialogs/q3filedialog.cpp index 1ec0cfc..e41941b 100644 --- a/src/qt3support/dialogs/q3filedialog.cpp +++ b/src/qt3support/dialogs/q3filedialog.cpp @@ -3879,7 +3879,7 @@ void Q3FileDialog::detailViewSelectionChanged() d->moreFiles->setSelected(f->i, i->isSelected()); } if (i->isSelected() && !((Q3FileDialogPrivate::File *)i)->info.isDir()) - str += QString(QLatin1String("\"%1\" ")).arg(i->text(0)); + str += QString::fromLatin1("\"%1\" ").arg(i->text(0)); i = i->nextSibling(); } d->moreFiles->blockSignals(false); @@ -3931,7 +3931,7 @@ void Q3FileDialog::listBoxSelectionChanged() } if (d->moreFiles->isSelected(i) && !((Q3FileDialogPrivate::File*)(mcitem)->i)->info.isDir()) { - str += QString(QLatin1String("\"%1\" ")).arg(i->text()); + str += QString::fromLatin1("\"%1\" ").arg(i->text()); if (j == 0) j = i; } @@ -4611,11 +4611,11 @@ void Q3FileDialog::setPreviewMode(PreviewMode m) } Q3FileDialog::PreviewMode Q3FileDialog::previewMode() const { - if (d->infoPreview && d->infoPreviewWidget->isVisible()) + if (d->infoPreview && d->infoPreviewWidget->isVisibleTo(const_cast<Q3FileDialog *>(this))) return Info; - else if (d->contentsPreview && d->contentsPreviewWidget->isVisible()) + else if (d->contentsPreview + && d->contentsPreviewWidget->isVisibleTo(const_cast<Q3FileDialog *>(this))) return Contents; - return NoPreview; } @@ -5757,8 +5757,8 @@ void Q3FileDialog::insertEntry(const Q3ValueList<QUrlInfo> &lst, Q3NetworkOperat if (!bShowHiddenFiles && inf.name() != QLatin1String("..")) { if (d->url.isLocalFile()) { QString file = d->url.path(); - if (!file.endsWith(QLatin1String("/"))) - file.append(QLatin1String("/")); + if (!file.endsWith(QLatin1Char('/'))) + file.append(QLatin1Char('/')); file += inf.name(); QT_WA({ if (GetFileAttributesW((TCHAR*)file.ucs2()) & FILE_ATTRIBUTE_HIDDEN) diff --git a/src/qt3support/dialogs/q3filedialog_mac.cpp b/src/qt3support/dialogs/q3filedialog_mac.cpp index f1c749ec..18bebf1 100644 --- a/src/qt3support/dialogs/q3filedialog_mac.cpp +++ b/src/qt3support/dialogs/q3filedialog_mac.cpp @@ -554,7 +554,7 @@ QString Q3FileDialog::macGetSaveFileName(const QString &start, const QString &fi retstr = QString::fromUtf8((const char *)str_buffer); //now filename CFStringGetCString(ret.saveFileName, (char *)str_buffer, 1024, kCFStringEncodingUTF8); - retstr += QLatin1String("/") + QString::fromUtf8((const char *)str_buffer); + retstr += QLatin1Char('/') + QString::fromUtf8((const char *)str_buffer); } NavDisposeReply(&ret); if(selectedFilter) diff --git a/src/qt3support/dialogs/q3filedialog_win.cpp b/src/qt3support/dialogs/q3filedialog_win.cpp index 1be797a..a1c98f3 100644 --- a/src/qt3support/dialogs/q3filedialog_win.cpp +++ b/src/qt3support/dialogs/q3filedialog_win.cpp @@ -737,7 +737,7 @@ QString Q3FileDialog::winGetExistingDirectory(const QString& initialDirectory, QDir::setCurrent(currentDir); if (!result.isEmpty()) - result.replace(QLatin1String("\\"), QLatin1String("/")); + result.replace(QLatin1Char('\\'), QLatin1Char('/')); return result; #else return QString(); diff --git a/src/qt3support/dialogs/q3tabdialog.cpp b/src/qt3support/dialogs/q3tabdialog.cpp index 6242dce..52086a2 100644 --- a/src/qt3support/dialogs/q3tabdialog.cpp +++ b/src/qt3support/dialogs/q3tabdialog.cpp @@ -49,6 +49,7 @@ #include "qapplication.h" #include "q3widgetstack.h" #include "qlayout.h" +#include "qevent.h" QT_BEGIN_NAMESPACE @@ -961,6 +962,16 @@ void Q3TabDialog::paintEvent(QPaintEvent *) } +/*!\reimp +*/ +void Q3TabDialog::showEvent(QShowEvent *e) +{ + if (!e->spontaneous()) + show(); + QDialog::showEvent(e); +} + + /*! Adds an OK button to the dialog and sets the button's text to \a text. diff --git a/src/qt3support/dialogs/q3tabdialog.h b/src/qt3support/dialogs/q3tabdialog.h index 3645df1..30acc7d 100644 --- a/src/qt3support/dialogs/q3tabdialog.h +++ b/src/qt3support/dialogs/q3tabdialog.h @@ -111,6 +111,7 @@ public: protected: void paintEvent(QPaintEvent *); void resizeEvent(QResizeEvent *); + void showEvent(QShowEvent *); void styleChange(QStyle&); void setTabBar(QTabBar*); QTabBar* tabBar() const; diff --git a/src/qt3support/itemviews/q3iconview.cpp b/src/qt3support/itemviews/q3iconview.cpp index d1a9c1e..a5664de 100644 --- a/src/qt3support/itemviews/q3iconview.cpp +++ b/src/qt3support/itemviews/q3iconview.cpp @@ -614,7 +614,7 @@ QByteArray Q3IconDrag::encodedData(const char* mime) const (*it).item.textRect().x()).arg((*it).item.textRect().y()). arg((*it).item.textRect().width()).arg( (*it).item.textRect().height()); - k += QString(QLatin1String((*it).data.data())) + QLatin1String("$@@$"); + k += QString::fromLatin1((*it).data.data()) + QLatin1String("$@@$"); s += k; } @@ -1820,8 +1820,8 @@ void Q3IconViewItem::calcRect(const QString &text_) tw = r.width(); th = r.height(); - if (tw < view->d->fm->width(QLatin1String("X"))) - tw = view->d->fm->width(QLatin1String("X")); + if (tw < view->d->fm->width(QLatin1Char('X'))) + tw = view->d->fm->width(QLatin1Char('X')); itemTextRect.setWidth(tw); itemTextRect.setHeight(th); diff --git a/src/qt3support/network/q3dns.cpp b/src/qt3support/network/q3dns.cpp index c53f2ff..3ca3977 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++; } } @@ -2347,7 +2347,7 @@ void Q3Dns::doResInit() nameServer += QLatin1String(dnsServer->IpAddress.String); dnsServer = dnsServer->Next; if ( dnsServer != 0 ) - nameServer += QLatin1String(" "); + nameServer += QLatin1Char(' '); } searchList = QLatin1String(""); separator = ' '; @@ -2360,12 +2360,12 @@ 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") ), + QLatin1String("System\\CurrentControlSet\\Services\\VxD\\MSTCP"), &domainName, &nameServer, &searchList )) { // for Windows 98 separator = ','; @@ -2395,7 +2395,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 +2488,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 5ab84cc..44c1f5c 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 ); @@ -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 591b381..aabf4a3 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; @@ -2210,7 +2210,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/q3url.cpp b/src/qt3support/network/q3url.cpp index fc2fdb2..68753b6 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 b415e12..6afd8ab 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 diff --git a/src/qt3support/other/q3dragobject.cpp b/src/qt3support/other/q3dragobject.cpp index fb57220..89ffe24 100644 --- a/src/qt3support/other/q3dragobject.cpp +++ b/src/qt3support/other/q3dragobject.cpp @@ -93,7 +93,7 @@ public: Q3TextDragPrivate() { setSubType(QLatin1String("plain")); } void setSubType(const QString & st) { subtype = st; - fmt = QString(QLatin1String("text/")).toLatin1() + subtype.toLatin1(); + fmt = "text/" + subtype.toLatin1(); } QString txt; @@ -208,11 +208,6 @@ void Q3DragObject::setPixmap(QPixmap pm, const QPoint& hotspot) Q_D(Q3DragObject); d->pixmap = pm; d->hot = hotspot; -#if 0 - QDragManager *manager = QDragManager::self(); - if (manager && manager->object == d->data) - manager->updatePixmap(); -#endif } /*! @@ -1302,7 +1297,7 @@ QByteArray Q3UriDrag::localFileToUri(const QString& filename) r.prepend(QString::fromLatin1(hostname)); } #endif - return unicodeUriToUri(QString(QLatin1String("file://") + r)); + return unicodeUriToUri(QLatin1String("file://") + r); } /*! @@ -1357,7 +1352,7 @@ QString Q3UriDrag::uriToLocalFile(const char* uri) return file; if (0==qstrnicmp(uri,"file:/",6)) // It is a local file uri uri += 6; - else if (QString(QLatin1String(uri)).indexOf(QLatin1String(":/")) != -1) // It is a different scheme uri + else if (QString::fromLatin1(uri).indexOf(QLatin1String(":/")) != -1) // It is a different scheme uri return file; bool local = uri[0] != '/' || (uri[0] != '\0' && uri[1] == '/'); diff --git a/src/qt3support/other/q3process.cpp b/src/qt3support/other/q3process.cpp index 6eac812..9689de9 100644 --- a/src/qt3support/other/q3process.cpp +++ b/src/qt3support/other/q3process.cpp @@ -483,7 +483,7 @@ QString Q3Process::readLineStdout() return QString(); if ( !buf->scanNewline( &a ) ) - return QString( QLatin1String(buf->readAll()) ); + return QLatin1String(buf->readAll()); } uint size = a.size(); diff --git a/src/qt3support/other/q3process_unix.cpp b/src/qt3support/other/q3process_unix.cpp index 098c581..2492bf2 100644 --- a/src/qt3support/other/q3process_unix.cpp +++ b/src/qt3support/other/q3process_unix.cpp @@ -828,7 +828,7 @@ bool Q3Process::start( QStringList *env ) #ifndef QT_NO_DIR QFileInfo fileInfo( dir, command ); #else - QFileInfo fileInfo( dir + "/" + command ); + QFileInfo fileInfo( dir + QLatin1Char('/') + command ); #endif if ( fileInfo.isExecutable() ) { #if defined(Q_OS_MACX) diff --git a/src/qt3support/other/q3process_win.cpp b/src/qt3support/other/q3process_win.cpp index 3c862ee..7dc28cb 100644 --- a/src/qt3support/other/q3process_win.cpp +++ b/src/qt3support/other/q3process_win.cpp @@ -285,7 +285,7 @@ bool Q3Process::start( QStringList *env ) for ( ; it != _arguments.end(); ++it ) { QString tmp = *it; // escape a single " because the arguments will be parsed - tmp.replace( QLatin1String("\""), QLatin1String("\\\"") ); + tmp.replace( QLatin1Char('\"'), QLatin1String("\\\"") ); if ( tmp.isEmpty() || tmp.contains( QLatin1Char(' ') ) || tmp.contains( QLatin1Char('\t') ) ) { // The argument must not end with a \ since this would be interpreted // as escaping the quote -- rather put the \ behind the quote: e.g. @@ -294,9 +294,9 @@ bool Q3Process::start( QStringList *env ) int i = tmp.length(); while ( i>0 && tmp.at( i-1 ) == QLatin1Char('\\') ) { --i; - endQuote += QLatin1String("\\"); + endQuote += QLatin1Char('\\'); } - args += QString( QLatin1String(" \"") ) + tmp.left( i ) + endQuote; + args += QLatin1String(" \"") + tmp.left( i ) + endQuote; } else { args += QLatin1Char(' ') + tmp; } @@ -330,7 +330,7 @@ bool Q3Process::start( QStringList *env ) // add PATH if necessary (for DLL loading) QByteArray path = qgetenv( "PATH" ); if ( env->grep( QRegExp(QLatin1String("^PATH="),FALSE) ).empty() && !path.isNull() ) { - QString tmp = QString( QLatin1String("PATH=%1") ).arg(QString::fromLatin1(path.constData())); + QString tmp = QString::fromLatin1("PATH=%1").arg(QLatin1String(path.constData())); uint tmpSize = sizeof(TCHAR) * (tmp.length()+1); envlist.resize( envlist.size() + tmpSize ); memcpy( envlist.data()+pos, tmp.ucs2(), tmpSize ); @@ -378,7 +378,7 @@ bool Q3Process::start( QStringList *env ) // add PATH if necessary (for DLL loading) QByteArray path = qgetenv( "PATH" ); if ( env->grep( QRegExp(QLatin1String("^PATH="),FALSE) ).empty() && !path.isNull() ) { - Q3CString tmp = QString( QLatin1String("PATH=%1") ).arg(QString::fromLatin1(path.constData())).local8Bit(); + Q3CString tmp = QString::fromLatin1("PATH=%1").arg(QString::fromLatin1(path.constData())).local8Bit(); uint tmpSize = tmp.length() + 1; envlist.resize( envlist.size() + tmpSize ); memcpy( envlist.data()+pos, tmp.data(), tmpSize ); diff --git a/src/qt3support/painting/q3paintengine_svg.cpp b/src/qt3support/painting/q3paintengine_svg.cpp index 95528e8..22e0d49 100644 --- a/src/qt3support/painting/q3paintengine_svg.cpp +++ b/src/qt3support/painting/q3paintengine_svg.cpp @@ -263,7 +263,7 @@ void Q3SVGPaintEngine::updateClipPath(const QPainterPath &path, Qt::ClipOperatio QDomElement e; d->currentClip++; e = d->doc.createElement(QLatin1String("clipPath")); - e.setAttribute(QLatin1String("id"), QString(QLatin1String("clip%1")).arg(d->currentClip)); + e.setAttribute(QLatin1String("id"), QString::fromLatin1("clip%1").arg(d->currentClip)); QDomElement path_element = d->doc.createElement(QLatin1String("path")); path_element.setAttribute(QLatin1String("d"), qt_svg_compose_path(path)); @@ -509,14 +509,14 @@ bool Q3SVGPaintEngine::save(const QString &fileName) int icount = 0; ImageList::Iterator iit = d->images.begin(); for (; iit != d->images.end(); ++iit) { - QString href = QString(QLatin1String("%1_%2.png")).arg(svgName).arg(icount); + QString href = QString::fromLatin1("%1_%2.png").arg(svgName).arg(icount); (*iit).image.save(href, "PNG"); (*iit).element.setAttribute(QLatin1String("xlink:href"), href); icount++; } PixmapList::Iterator pit = d->pixmaps.begin(); for (; pit != d->pixmaps.end(); ++pit) { - QString href = QString(QLatin1String("%1_%2.png")).arg(svgName).arg(icount); + QString href = QString::fromLatin1("%1_%2.png").arg(svgName).arg(icount); (*pit).pixmap.save(href, "PNG"); (*pit).element.setAttribute(QLatin1String("xlink:href"), href); icount++; @@ -592,7 +592,7 @@ void Q3SVGPaintEnginePrivate::appendChild(QDomElement &e, QPicturePrivate::Paint if (c == QPicturePrivate::PdcSetClipRegion || c == QPicturePrivate::PdcSetClipPath) { QDomElement ne; ne = doc.createElement(QLatin1String("g")); - ne.setAttribute(QLatin1String("style"), QString(QLatin1String("clip-path:url(#clip%1)")).arg(currentClip)); + ne.setAttribute(QLatin1String("style"), QString::fromLatin1("clip-path:url(#clip%1)").arg(currentClip)); if (dirtyTransform) { applyTransform(&ne); dirtyTransform = false; @@ -621,12 +621,12 @@ void Q3SVGPaintEnginePrivate::applyStyle(QDomElement *e, QPicturePrivate::PaintC if (c == QPicturePrivate::PdcDrawText2 || c == QPicturePrivate::PdcDrawText2Formatted) { // QPainter has a reversed understanding of pen/stroke vs. // brush/fill for text - s += QString(QLatin1String("fill:rgb(%1,%2,%3);")).arg(pcol.red()).arg(pcol.green()).arg(pcol.blue()); - s += QString(QLatin1String("stroke-width:0;")); + s += QString::fromLatin1("fill:rgb(%1,%2,%3);").arg(pcol.red()).arg(pcol.green()).arg(pcol.blue()); + s += QLatin1String("stroke-width:0;"); QFont f = cfont; QFontInfo fi(f); - s += QString(QLatin1String("font-size:%1;")).arg(fi.pointSize()); - s += QString(QLatin1String("font-style:%1;")).arg(f.italic() ? QLatin1String("italic") : QLatin1String("normal")); + s += QString::fromLatin1("font-size:%1;").arg(fi.pointSize()); + s += QString::fromLatin1("font-style:%1;").arg(f.italic() ? QLatin1String("italic") : QLatin1String("normal")); // not a very scientific distribution QString fw; if (f.weight() <= QFont::Light) @@ -641,32 +641,32 @@ void Q3SVGPaintEnginePrivate::applyStyle(QDomElement *e, QPicturePrivate::PaintC fw = QLatin1String("800"); else fw = QLatin1String("900"); - s += QString(QLatin1String("font-weight:%1;")).arg(fw); - s += QString(QLatin1String("font-family:%1;")).arg(f.family()); + s += QString::fromLatin1("font-weight:%1;").arg(fw); + s += QString::fromLatin1("font-family:%1;").arg(f.family()); } else { - s += QString(QLatin1String("stroke:rgb(%1,%2,%3);")).arg(pcol.red()).arg(pcol.green()).arg(pcol.blue()); + s += QString::fromLatin1("stroke:rgb(%1,%2,%3);").arg(pcol.red()).arg(pcol.green()).arg(pcol.blue()); if (pcol.alpha() != 255) - s += QString(QLatin1String("stroke-opacity:%1;")).arg(pcol.alpha()/255.0); + s += QString::fromLatin1("stroke-opacity:%1;").arg(pcol.alpha()/255.0); if (bcol.alpha() != 255) - s += QString(QLatin1String("fill-opacity:%1;")).arg(bcol.alpha()/255.0); + s += QString::fromLatin1("fill-opacity:%1;").arg(bcol.alpha()/255.0); double pw = cpen.width(); if (pw == 0 && cpen.style() != Qt::NoPen) pw = 0.9; if (c == QPicturePrivate::PdcDrawLine) pw /= (qAbs(worldMatrix.m11()) + qAbs(worldMatrix.m22())) / 2.0; - s += QString(QLatin1String("stroke-width:%1;")).arg(pw); + s += QString::fromLatin1("stroke-width:%1;").arg(pw); if (cpen.style() == Qt::DashLine) - s+= QString(QLatin1String("stroke-dasharray:18,6;")); + s+= QLatin1String("stroke-dasharray:18,6;"); else if (cpen.style() == Qt::DotLine) - s+= QString(QLatin1String("stroke-dasharray:3;")); + s+= QLatin1String("stroke-dasharray:3;"); else if (cpen.style() == Qt::DashDotLine) - s+= QString(QLatin1String("stroke-dasharray:9,6,3,6;")); + s+= QLatin1String("stroke-dasharray:9,6,3,6;"); else if (cpen.style() == Qt::DashDotDotLine) - s+= QString(QLatin1String("stroke-dasharray:9,3,3;")); + s+= QLatin1String("stroke-dasharray:9,3,3;"); if (cbrush.style() == Qt::NoBrush || c == QPicturePrivate::PdcDrawPolyline || c == QPicturePrivate::PdcDrawCubicBezier) s += QLatin1String("fill:none;"); // Qt polylines use no brush, neither do Beziers else - s += QString(QLatin1String("fill:rgb(%1,%2,%3);")).arg(bcol.red()).arg(bcol.green()).arg(bcol.blue()); + s += QString::fromLatin1("fill:rgb(%1,%2,%3);").arg(bcol.red()).arg(bcol.green()).arg(bcol.blue()); } e->setAttribute(QLatin1String("style"), s); } @@ -679,13 +679,13 @@ void Q3SVGPaintEnginePrivate::applyTransform(QDomElement *e) const bool rot = (m.m11() != 1.0 || m.m12() != 0.0 || m.m21() != 0.0 || m.m22() != 1.0); if (!rot && (m.dx() != 0.0 || m.dy() != 0.0)) { - s = QString(QLatin1String("translate(%1,%2)")).arg(m.dx()).arg(m.dy()); + s = QString::fromLatin1("translate(%1,%2)").arg(m.dx()).arg(m.dy()); } else if (rot) { if (m.m12() == 0.0 && m.m21() == 0.0 && m.dx() == 0.0 && m.dy() == 0.0) - s = QString(QLatin1String("scale(%1,%2)")).arg(m.m11()).arg(m.m22()); + s = QString::fromLatin1("scale(%1,%2)").arg(m.m11()).arg(m.m22()); else - s = QString(QLatin1String("matrix(%1,%2,%3,%4,%5,%6)")) + s = QString::fromLatin1("matrix(%1,%2,%3,%4,%5,%6)") .arg(m.m11()).arg(m.m12()) .arg(m.m21()).arg(m.m22()) .arg(m.dx()).arg(m.dy()); @@ -730,9 +730,9 @@ bool Q3SVGPaintEngine::play(QPainter *pt) d->brect.setX(x); d->brect.setY(y); QString wstr = attr.contains(QLatin1String("width")) - ? attr.namedItem(QLatin1String("width")).nodeValue() : QString(QLatin1String("100%")); + ? attr.namedItem(QLatin1String("width")).nodeValue() : QString::fromLatin1("100%"); QString hstr = attr.contains(QLatin1String("height")) - ? attr.namedItem(QLatin1String("height")).nodeValue() : QString(QLatin1String("100%")); + ? attr.namedItem(QLatin1String("height")).nodeValue() : QString::fromLatin1("100%"); double width = d->parseLen(wstr, 0, true); double height = d->parseLen(hstr, 0, false); // SVG doesn't respect x and y. But we want a proper bounding rect. diff --git a/src/qt3support/text/q3richtext.cpp b/src/qt3support/text/q3richtext.cpp index e508001..d02f961 100644 --- a/src/qt3support/text/q3richtext.cpp +++ b/src/qt3support/text/q3richtext.cpp @@ -1678,7 +1678,7 @@ void Q3TextDocument::setRichTextInternal(const QString &text, Q3TextCursor* curs if (curtag.style->displayMode() == Q3StyleSheetItem::DisplayListItem) { // we are in a li and a new block comes along - if (nstyle->name() == QString(QLatin1String("ul")) || nstyle->name() == QLatin1String("ol")) + if (nstyle->name() == QLatin1String("ul") || nstyle->name() == QLatin1String("ol")) hasNewPar = false; // we want an empty li (like most browsers) if (!hasNewPar) { /* do not add new blocks inside @@ -1857,7 +1857,7 @@ void Q3TextDocument::setRichTextInternal(const QString &text, Q3TextCursor* curs curtag.format = curtag.format.makeTextFormat(nstyle, attr, scaleFontsFactor); if (nstyle->isAnchor()) { if (!anchorName.isEmpty()) - anchorName += QLatin1String("#") + attr[QLatin1String("name")]; + anchorName += QLatin1Char('#') + attr[QLatin1String("name")]; else anchorName = attr[QLatin1String("name")]; curtag.anchorHref = attr[QLatin1String("href")]; @@ -2436,7 +2436,7 @@ QString Q3TextDocument::richText() const list_type = QLatin1String(" type=") + list_style_to_string(p->listStyle()); for (int i = pastListDepth; i < listDepth; i++) { s += list_is_ordered(p->listStyle()) ? QLatin1String("<ol") : QLatin1String("<ul"); - s += list_type + QLatin1String(">"); + s += list_type + QLatin1Char('>'); } } else { s += QLatin1Char('\n'); @@ -2463,7 +2463,7 @@ QString Q3TextDocument::richText() const s += margin_to_string(item_li, p->utm, p->ubm, p->ulm, p->urm, p->uflm); s += list_value_to_string(p->listValue()); s += direction_to_string(p->direction()); - s += QLatin1String(">"); + s += QLatin1Char('>'); s += ps; s += QLatin1String("</li>"); } else if (p->listDepth()) { @@ -2471,7 +2471,7 @@ QString Q3TextDocument::richText() const s += align_to_string(p->alignment()); s += margin_to_string(item_div, p->utm, p->ubm, p->ulm, p->urm, p->uflm); s += direction_to_string(p->direction()); - s += QLatin1String(">"); + s += QLatin1Char('>'); s += ps; s += QLatin1String("</div>"); } else { @@ -2480,7 +2480,7 @@ QString Q3TextDocument::richText() const s += align_to_string(p->alignment()); s += margin_to_string(item_p, p->utm, p->ubm, p->ulm, p->urm, p->uflm); s += direction_to_string(p->direction()); - s += QLatin1String(">"); + s += QLatin1Char('>'); s += ps; s += QLatin1String("</p>"); } @@ -6667,7 +6667,7 @@ Q3TextImage::Q3TextImage(Q3TextDocument *p, const QMap<QString, QString> &attr, imageName = attr[QLatin1String("source")]; if (!imageName.isEmpty()) { - imgId = QString(QLatin1String("%1,%2,%3,%4")).arg(imageName).arg(width).arg(height).arg((ulong)&factory); + imgId = QString::fromLatin1("%1,%2,%3,%4").arg(imageName).arg(width).arg(height).arg((ulong)&factory); if (!pixmap_map) pixmap_map = new QMap<QString, QPixmapInt>; if (pixmap_map->contains(imgId)) { @@ -6761,13 +6761,13 @@ QString Q3TextImage::richText() const s += QLatin1String("<img "); QMap<QString, QString>::ConstIterator it = attributes.begin(); for (; it != attributes.end(); ++it) { - s += it.key() + QLatin1String("="); + s += it.key() + QLatin1Char('='); if ((*it).contains(QLatin1Char(' '))) - s += QLatin1String("\"") + *it + QLatin1String("\" "); + s += QLatin1Char('\"') + *it + QLatin1String("\" "); else - s += *it + QLatin1String(" "); + s += *it + QLatin1Char(' '); } - s += QLatin1String(">"); + s += QLatin1Char('>'); return s; } @@ -7722,7 +7722,7 @@ QString Q3TextTable::richText() const s = QLatin1String("<table "); QMap<QString, QString>::ConstIterator it = attributes.begin(); for (; it != attributes.end(); ++it) - s += it.key() + QLatin1String("=") + *it + QLatin1String(" "); + s += it.key() + QLatin1Char('=') + *it + QLatin1Char(' '); s += QLatin1String(">\n"); int lastRow = -1; @@ -7739,8 +7739,8 @@ QString Q3TextTable::richText() const s += QLatin1String("<td"); it = cell->attributes.constBegin(); for (; it != cell->attributes.constEnd(); ++it) - s += QLatin1String(" ") + it.key() + QLatin1String("=") + *it; - s += QLatin1String(">"); + s += QLatin1Char(' ') + it.key() + QLatin1Char('=') + *it; + s += QLatin1Char('>'); s += cell->richText()->richText(); s += QLatin1String("</td>"); } diff --git a/src/qt3support/text/q3textedit.cpp b/src/qt3support/text/q3textedit.cpp index 7577dce..d1db1e4 100644 --- a/src/qt3support/text/q3textedit.cpp +++ b/src/qt3support/text/q3textedit.cpp @@ -77,7 +77,7 @@ #include <qkeysequence.h> #define ACCEL_KEY(k) QLatin1Char('\t') + QString(QKeySequence(Qt::CTRL | Qt::Key_ ## k)) #else -#define ACCEL_KEY(k) QLatin1Char('\t' )+ QString(QLatin1String("Ctrl+" #k)) +#define ACCEL_KEY(k) QLatin1Char('\t' )+ QString::fromLatin1("Ctrl+" #k) #endif #ifdef QT_TEXTEDIT_OPTIMIZATION @@ -6625,7 +6625,7 @@ void Q3TextEdit::optimSetTextFormat(Q3TextDocument * td, Q3TextCursor * cur, } if (tag) { QString col = tag->tag.simplified(); - if (col.left(10) == QLatin1String("font color")) { + if (col.startsWith(QLatin1String("font color"))) { int i = col.indexOf(QLatin1Char('='), 10); col = col.mid(i + 1).simplified(); if (col[0] == QLatin1Char('\"')) diff --git a/src/qt3support/widgets/q3action.cpp b/src/qt3support/widgets/q3action.cpp index 311212a..caca47b 100644 --- a/src/qt3support/widgets/q3action.cpp +++ b/src/qt3support/widgets/q3action.cpp @@ -415,7 +415,7 @@ static QString qt_stripMenuText(QString s) s.remove(QLatin1String("...")); s.remove(QLatin1Char('&')); return s.trimmed(); -}; +} /*! Constructs an action called \a name with parent \a parent. diff --git a/src/qt3support/widgets/q3mainwindow.cpp b/src/qt3support/widgets/q3mainwindow.cpp index 2ee3bdc..ae80321 100644 --- a/src/qt3support/widgets/q3mainwindow.cpp +++ b/src/qt3support/widgets/q3mainwindow.cpp @@ -2261,7 +2261,7 @@ static void saveDockArea(QTextStream &ts, Q3DockArea *a) for (int i = 0; i < l.size(); ++i) { Q3DockWindow *dw = l.at(i); ts << QString(dw->windowTitle()); - ts << ","; + ts << ','; } ts << endl; ts << *a; @@ -2287,7 +2287,7 @@ QTextStream &operator<<(QTextStream &ts, const Q3MainWindow &mainWindow) for (int i = 0; i < l.size(); ++i) { Q3DockWindow *dw = l.at(i); ts << dw->windowTitle(); - ts << ","; + ts << ','; } ts << endl; @@ -2295,17 +2295,17 @@ QTextStream &operator<<(QTextStream &ts, const Q3MainWindow &mainWindow) for (int i = 0; i < l.size(); ++i) { Q3DockWindow *dw = l.at(i); ts << dw->windowTitle(); - ts << ","; + ts << ','; } ts << endl; for (int i = 0; i < l.size(); ++i) { Q3DockWindow *dw = l.at(i); - ts << "[" << dw->windowTitle() << "," - << (int)dw->geometry().x() << "," - << (int)dw->geometry().y() << "," - << (int)dw->geometry().width() << "," - << (int)dw->geometry().height() << "," - << (int)dw->isVisible() << "]"; + ts << '[' << dw->windowTitle() << ',' + << (int)dw->geometry().x() << ',' + << (int)dw->geometry().y() << ',' + << (int)dw->geometry().width() << ',' + << (int)dw->geometry().height() << ',' + << (int)dw->isVisible() << ']'; } ts << endl; |