summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/dialogs/qprintdialog_unix.cpp8
-rw-r--r--src/gui/dialogs/qprintpreviewdialog.cpp4
-rw-r--r--src/gui/embedded/qmouse_qws.cpp4
-rw-r--r--src/gui/embedded/qscreenmulti_qws.cpp4
-rw-r--r--src/gui/embedded/qscreentransformed_qws.cpp6
-rw-r--r--src/gui/embedded/qscreenvfb_qws.cpp4
-rw-r--r--src/gui/embedded/qtransportauth_qws.cpp4
-rw-r--r--src/gui/embedded/qunixsocket.cpp32
-rw-r--r--src/gui/embedded/qunixsocketserver.cpp8
-rw-r--r--src/gui/embedded/qwindowsystem_qws.cpp4
-rw-r--r--src/gui/embedded/qwscommand_qws.cpp8
-rw-r--r--src/gui/kernel/qapplication_qws.cpp6
-rw-r--r--src/gui/kernel/qapplication_win.cpp4
-rw-r--r--src/gui/kernel/qmime_mac.cpp4
-rw-r--r--src/gui/kernel/qmime_win.cpp8
-rw-r--r--src/gui/kernel/qsound_qws.cpp2
-rw-r--r--src/gui/painting/qbezier.cpp8
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
-rw-r--r--src/gui/painting/qprinterinfo_unix.cpp4
-rw-r--r--src/gui/painting/qtessellator.cpp2
-rw-r--r--src/gui/painting/qwindowsurface_x11.cpp2
-rw-r--r--src/gui/styles/gtksymbols.cpp6
-rw-r--r--src/gui/styles/qgtkstyle.cpp3
-rw-r--r--src/gui/text/qfontdatabase_qws.cpp4
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp28
-rw-r--r--src/gui/text/qfontengine_qpf.cpp10
-rw-r--r--src/gui/text/qfontengine_x11.cpp5
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp2
-rw-r--r--src/gui/text/qtexthtmlparser.cpp2
-rw-r--r--src/gui/util/qdesktopservices_mac.cpp2
-rw-r--r--src/gui/util/qdesktopservices_x11.cpp4
-rw-r--r--src/gui/widgets/qcombobox_p.h2
-rw-r--r--src/gui/widgets/qprogressbar.cpp8
33 files changed, 102 insertions, 102 deletions
diff --git a/src/gui/dialogs/qprintdialog_unix.cpp b/src/gui/dialogs/qprintdialog_unix.cpp
index 87a4e65..8456d13 100644
--- a/src/gui/dialogs/qprintdialog_unix.cpp
+++ b/src/gui/dialogs/qprintdialog_unix.cpp
@@ -669,7 +669,7 @@ QUnixPrintWidgetPrivate::QUnixPrintWidgetPrivate(QUnixPrintWidget *p)
for (int i = 0; i < cupsPrinterCount; ++i) {
QString printerName(QString::fromLocal8Bit(cupsPrinters[i].name));
if (cupsPrinters[i].instance)
- printerName += QLatin1String("/") + QString::fromLocal8Bit(cupsPrinters[i].instance);
+ printerName += QLatin1Char('/') + QString::fromLocal8Bit(cupsPrinters[i].instance);
widget.printers->addItem(printerName);
if (cupsPrinters[i].is_default)
@@ -813,7 +813,7 @@ void QUnixPrintWidgetPrivate::_q_printerChanged(int index)
optionsPane->selectPrinter(0);
#endif
if (lprPrinters.count() > 0) {
- QString type = lprPrinters.at(index).name + QLatin1String("@") + lprPrinters.at(index).host;
+ QString type = lprPrinters.at(index).name + QLatin1Char('@') + lprPrinters.at(index).host;
if (!lprPrinters.at(index).comment.isEmpty())
type += QLatin1String(", ") + lprPrinters.at(index).comment;
widget.type->setText(type);
@@ -1194,9 +1194,9 @@ QVariant QPPDOptionsModel::headerData(int section, Qt::Orientation, int role) co
switch(section){
case 0:
- return QVariant(QApplication::translate("QPPDOptionsModel","Name"));
+ return QVariant(QApplication::translate("QPPDOptionsModel", "Name"));
case 1:
- return QVariant(QApplication::translate("QPPDOptionsModel","Value"));
+ return QVariant(QApplication::translate("QPPDOptionsModel", "Value"));
default:
return QVariant();
}
diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp
index 29a2738..a696160 100644
--- a/src/gui/dialogs/qprintpreviewdialog.cpp
+++ b/src/gui/dialogs/qprintpreviewdialog.cpp
@@ -460,7 +460,7 @@ void QPrintPreviewDialogPrivate::updatePageNumLabel()
int numPages = preview->numPages();
int maxChars = QString::number(numPages).length();
- pageNumLabel->setText(QString(QLatin1String("/ %1")).arg(numPages));
+ pageNumLabel->setText(QString::fromLatin1("/ %1").arg(numPages));
int cyphersWidth = q->fontMetrics().width(QString().fill(QLatin1Char('8'), maxChars));
int maxWidth = pageNumEdit->minimumSizeHint().width() + cyphersWidth;
pageNumEdit->setMinimumWidth(maxWidth);
@@ -611,7 +611,7 @@ void QPrintPreviewDialogPrivate::_q_zoomFactorChanged()
factor = qMax(qreal(1.0), qMin(qreal(1000.0), factor));
if (ok) {
preview->setZoomFactor(factor/100.0);
- zoomFactor->setEditText(QString(QLatin1String("%1%")).arg(factor));
+ zoomFactor->setEditText(QString::fromLatin1("%1%").arg(factor));
setFitting(false);
}
}
diff --git a/src/gui/embedded/qmouse_qws.cpp b/src/gui/embedded/qmouse_qws.cpp
index 044a574..b5eda0c 100644
--- a/src/gui/embedded/qmouse_qws.cpp
+++ b/src/gui/embedded/qmouse_qws.cpp
@@ -413,8 +413,8 @@ void QWSCalibratedMouseHandler::writeCalibration()
QFile file(calFile);
if (file.open(QIODevice::WriteOnly)) {
QTextStream t(&file);
- t << a << " " << b << " " << c << " ";
- t << d << " " << e << " " << f << " " << s << endl;
+ t << a << ' ' << b << ' ' << c << ' ';
+ t << d << ' ' << e << ' ' << f << ' ' << s << endl;
} else
#endif
{
diff --git a/src/gui/embedded/qscreenmulti_qws.cpp b/src/gui/embedded/qscreenmulti_qws.cpp
index 1914b44..a639e01 100644
--- a/src/gui/embedded/qscreenmulti_qws.cpp
+++ b/src/gui/embedded/qscreenmulti_qws.cpp
@@ -221,9 +221,9 @@ bool QMultiScreen::connect(const QString &displaySpec)
{
QString dSpec = displaySpec;
if (dSpec.startsWith(QLatin1String("Multi:"), Qt::CaseInsensitive))
- dSpec = dSpec.mid(QString(QLatin1String("Multi:")).size());
+ dSpec = dSpec.mid(QString::fromLatin1("Multi:").size());
- const QString displayIdSpec = QString(QLatin1String(" :%1")).arg(displayId);
+ const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
if (dSpec.endsWith(displayIdSpec))
dSpec = dSpec.left(dSpec.size() - displayIdSpec.size());
diff --git a/src/gui/embedded/qscreentransformed_qws.cpp b/src/gui/embedded/qscreentransformed_qws.cpp
index e22ea1f..01a18b3 100644
--- a/src/gui/embedded/qscreentransformed_qws.cpp
+++ b/src/gui/embedded/qscreentransformed_qws.cpp
@@ -206,11 +206,11 @@ bool QTransformedScreen::connect(const QString &displaySpec)
{
QString dspec = displaySpec.trimmed();
if (dspec.startsWith(QLatin1String("Transformed:"), Qt::CaseInsensitive))
- dspec = dspec.mid(QString(QLatin1String("Transformed:")).size());
+ dspec = dspec.mid(QString::fromLatin1("Transformed:").size());
else if (!dspec.compare(QLatin1String("Transformed"), Qt::CaseInsensitive))
dspec = QString();
- const QString displayIdSpec = QString(QLatin1String(" :%1")).arg(displayId);
+ const QString displayIdSpec = QString::fromLatin1(" :%1").arg(displayId);
if (dspec.endsWith(displayIdSpec))
dspec = dspec.left(dspec.size() - displayIdSpec.size());
@@ -223,7 +223,7 @@ bool QTransformedScreen::connect(const QString &displaySpec)
if (!QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive))
if (!dspec.isEmpty())
- dspec.prepend(QLatin1String(":"));
+ dspec.prepend(QLatin1Char(':'));
const int id = getDisplayId(dspec);
QScreen *s = qt_get_screen(id, dspec.toLatin1().constData());
diff --git a/src/gui/embedded/qscreenvfb_qws.cpp b/src/gui/embedded/qscreenvfb_qws.cpp
index accfe1f..ec393e3 100644
--- a/src/gui/embedded/qscreenvfb_qws.cpp
+++ b/src/gui/embedded/qscreenvfb_qws.cpp
@@ -330,7 +330,7 @@ void QVFbScreen::disconnect()
bool QVFbScreen::initDevice()
{
#ifndef QT_NO_QWS_MOUSE_QVFB
- const QString mouseDev = QString(QLatin1String(QT_VFB_MOUSE_PIPE))
+ const QString mouseDev = QString::fromLatin1(QT_VFB_MOUSE_PIPE)
.arg(displayId);
d_ptr->mouse = new QVFbMouseHandler(QLatin1String("QVFbMouse"), mouseDev);
qwsServer->setDefaultMouse("None");
@@ -339,7 +339,7 @@ bool QVFbScreen::initDevice()
#endif
#if !defined(QT_NO_QWS_KBD_QVFB) && !defined(QT_NO_QWS_KEYBOARD)
- const QString keyboardDev = QString(QLatin1String(QT_VFB_KEYBOARD_PIPE))
+ const QString keyboardDev = QString::fromLatin1(QT_VFB_KEYBOARD_PIPE)
.arg(displayId);
d_ptr->keyboard = new QVFbKeyboardHandler(keyboardDev);
qwsServer->setDefaultKeyboard("None");
diff --git a/src/gui/embedded/qtransportauth_qws.cpp b/src/gui/embedded/qtransportauth_qws.cpp
index 97ba5b8..6677482 100644
--- a/src/gui/embedded/qtransportauth_qws.cpp
+++ b/src/gui/embedded/qtransportauth_qws.cpp
@@ -834,12 +834,12 @@ QString RequestAnalyzer::analyze( QByteArray *msgQueue )
if ( command_type == QWSCommand::QCopSend )
{
QWSQCopSendCommand *sendCommand = static_cast<QWSQCopSendCommand*>(command);
- request += QString( QLatin1String("/QCop/%1/%2") ).arg( sendCommand->channel ).arg( sendCommand->message );
+ request += QString::fromLatin1("/QCop/%1/%2").arg( sendCommand->channel ).arg( sendCommand->message );
}
if ( command_type == QWSCommand::QCopRegisterChannel )
{
QWSQCopRegisterChannelCommand *registerCommand = static_cast<QWSQCopRegisterChannelCommand*>(command);
- request += QString( QLatin1String("/QCop/RegisterChannel/%1") ).arg( registerCommand->channel );
+ request += QString::fromLatin1("/QCop/RegisterChannel/%1").arg( registerCommand->channel );
}
#endif
dataSize = QWS_PROTOCOL_ITEM_SIZE( *command );
diff --git a/src/gui/embedded/qunixsocket.cpp b/src/gui/embedded/qunixsocket.cpp
index 16f2cae..1600505 100644
--- a/src/gui/embedded/qunixsocket.cpp
+++ b/src/gui/embedded/qunixsocket.cpp
@@ -135,7 +135,7 @@ struct QUnixSocketRightsPrivate : public QSharedData
#ifdef QUNIXSOCKET_DEBUG
if(0 != closerv) {
qDebug() << "QUnixSocketRightsPrivate: Unable to close managed"
- " file descriptor (" << ::strerror(errno) << ")";
+ " file descriptor (" << ::strerror(errno) << ')';
}
#endif
}
@@ -166,7 +166,7 @@ QUnixSocketRights::QUnixSocketRights(int fd)
#ifdef QUNIXSOCKET_DEBUG
if(-1 == d->fd) {
qDebug() << "QUnixSocketRights: Unable to duplicate fd "
- << fd << " (" << ::strerror(errno) << ")";
+ << fd << " (" << ::strerror(errno) << ')';
}
#endif
}
@@ -237,7 +237,7 @@ int QUnixSocketRights::dupFd() const
#ifdef QUNIXSOCKET_DEBUG
if(-1 == rv)
qDebug() << "QUnixSocketRights: Unable to duplicate managed file "
- "descriptor (" << ::strerror(errno) << ")";
+ "descriptor (" << ::strerror(errno) << ')';
#endif
return rv;
@@ -927,7 +927,7 @@ bool QUnixSocket::connect(const QByteArray & path)
int crv;
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Connect requested to '"
- << path << "'";
+ << path << '\'';
#endif
abort(); // Reset any existing connection
@@ -949,7 +949,7 @@ bool QUnixSocket::connect(const QByteArray & path)
if(-1 == d->fd) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to create socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
#endif
d->error = ResourceError;
goto connect_error;
@@ -962,7 +962,7 @@ bool QUnixSocket::connect(const QByteArray & path)
if(-1 == crv) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to configure socket ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
d->error = ResourceError;
@@ -981,7 +981,7 @@ bool QUnixSocket::connect(const QByteArray & path)
if(-1 == crv) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to connect ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
if(ECONNREFUSED == errno)
d->error = ConnectionRefused;
@@ -1021,7 +1021,7 @@ connect_error: // Cleanup failed connection
#ifdef QUNIXSOCKET_DEBUG
if(0 != closerv) {
qDebug() << "QUnixSocket: Unable to close file descriptor after "
- "failed connect (" << ::strerror(errno) << ")";
+ "failed connect (" << ::strerror(errno) << ')';
}
#endif
}
@@ -1065,7 +1065,7 @@ bool QUnixSocket::setSocketDescriptor(int socketDescriptor)
if(-1 == crv) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to configure client provided socket ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
d->error = ResourceError;
@@ -1136,7 +1136,7 @@ void QUnixSocket::abort()
#ifdef QUNIXSOCKET_DEBUG
if(0 != closerv) {
qDebug() << "QUnixSocket: Unable to close socket during abort ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
}
#endif
@@ -1686,11 +1686,11 @@ qint64 QUnixSocketPrivate::writeActivated()
}
#ifdef QUNIXSOCKET_DEBUG
- qDebug() << "QUnixSocket: Transmitting message (length" << m.d->size() << ")";
+ qDebug() << "QUnixSocket: Transmitting message (length" << m.d->size() << ')';
#endif
::ssize_t s = ::sendmsg(fd, &sendmessage, MSG_DONTWAIT | MSG_NOSIGNAL);
#ifdef QUNIXSOCKET_DEBUG
- qDebug() << "QUnixSocket: Transmitted message (" << s << ")";
+ qDebug() << "QUnixSocket: Transmitted message (" << s << ')';
#endif
if(-1 == s) {
@@ -1699,13 +1699,13 @@ qint64 QUnixSocketPrivate::writeActivated()
} else if(EPIPE == errno) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Remote side disconnected during transmit "
- "(" << ::strerror(errno) << ")";
+ "(" << ::strerror(errno) << ')';
#endif
me->abort();
} else {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to transmit data ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
error = (QUnixSocket::SocketError)(QUnixSocket::WriteFailure |
CausedAbort);
@@ -1764,12 +1764,12 @@ void QUnixSocketPrivate::readActivated()
int recvrv = ::recvmsg(fd, &message, 0);
#ifdef QUNIXSOCKET_DEBUG
- qDebug() << "QUnixSocket: Received message (" << recvrv << ")";
+ qDebug() << "QUnixSocket: Received message (" << recvrv << ')';
#endif
if(-1 == recvrv) {
#ifdef QUNIXSOCKET_DEBUG
qDebug() << "QUnixSocket: Unable to receive data ("
- << ::strerror(errno) << ")";
+ << ::strerror(errno) << ')';
#endif
error = (QUnixSocket::SocketError)(QUnixSocket::ReadFailure |
CausedAbort);
diff --git a/src/gui/embedded/qunixsocketserver.cpp b/src/gui/embedded/qunixsocketserver.cpp
index 6e9347b..489c40a 100644
--- a/src/gui/embedded/qunixsocketserver.cpp
+++ b/src/gui/embedded/qunixsocketserver.cpp
@@ -172,7 +172,7 @@ void QUnixSocketServer::close()
#ifdef QUNIXSOCKET_DEBUG
if(0 != closerv) {
qDebug() << "QUnixSocketServer: Unable to close socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
}
#endif
}
@@ -245,7 +245,7 @@ bool QUnixSocketServer::listen(const QByteArray & path)
if(-1 == d->fd) {
#ifdef QUNIXSOCKETSERVER_DEBUG
qDebug() << "QUnixSocketServer: Unable to create socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
#endif
close();
d->error = ResourceError;
@@ -263,7 +263,7 @@ bool QUnixSocketServer::listen(const QByteArray & path)
if(-1 == ::bind(d->fd, (sockaddr *)&addr, sizeof(sockaddr_un))) {
#ifdef QUNIXSOCKETSERVER_DEBUG
qDebug() << "QUnixSocketServer: Unable to bind socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
#endif
close();
d->error = BindError;
@@ -274,7 +274,7 @@ bool QUnixSocketServer::listen(const QByteArray & path)
if(-1 == ::listen(d->fd, d->maxConns)) {
#ifdef QUNIXSOCKETSERVER_DEBUG
qDebug() << "QUnixSocketServer: Unable to listen socket ("
- << strerror(errno) << ")";
+ << strerror(errno) << ')';
#endif
close();
d->error = ListenError;
diff --git a/src/gui/embedded/qwindowsystem_qws.cpp b/src/gui/embedded/qwindowsystem_qws.cpp
index fdcd193..a15decd 100644
--- a/src/gui/embedded/qwindowsystem_qws.cpp
+++ b/src/gui/embedded/qwindowsystem_qws.cpp
@@ -2210,7 +2210,7 @@ void QWSServer::sendMouseEvent(const QPoint& pos, int state, int wheel)
{
bool block = qwsServerPrivate->screensaverblockevent(MOUSE, qwsServerPrivate->screensaverinterval, state);
#ifdef EVENT_BLOCK_DEBUG
- qDebug() << "sendMouseEvent" << pos.x() << pos.y() << state << (block?"block":"pass");
+ qDebug() << "sendMouseEvent" << pos.x() << pos.y() << state << (block ? "block" : "pass");
#endif
if (state || wheel)
@@ -4110,7 +4110,7 @@ void QWSServer::processKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers
block = qwsServerPrivate->screensaverblockevent(KEY, qwsServerPrivate->screensaverinterval, isPress);
#ifdef EVENT_BLOCK_DEBUG
- qDebug() << "processKeyEvent" << unicode << keycode << modifiers << isPress << autoRepeat << (block?"block":"pass");
+ qDebug() << "processKeyEvent" << unicode << keycode << modifiers << isPress << autoRepeat << (block ? "block" : "pass");
#endif
// If we press a key and it's going to be blocked, wake up the screen
diff --git a/src/gui/embedded/qwscommand_qws.cpp b/src/gui/embedded/qwscommand_qws.cpp
index b0fd78b..26d3435 100644
--- a/src/gui/embedded/qwscommand_qws.cpp
+++ b/src/gui/embedded/qwscommand_qws.cpp
@@ -133,7 +133,7 @@ void QWSHexDump::init()
void QWSHexDump::hexDump()
{
- *outstrm << "(" << dataSize << " bytes):\n" << prefix;
+ *outstrm << '(' << dataSize << " bytes):\n" << prefix;
sprintf(sideviewLayout, " [%%-%us]", wrap);
dataWidth = (2 * wrap) + (wrap / clustering);
@@ -144,7 +144,7 @@ void QWSHexDump::hexDump()
sideview[wrapIndex = i%wrap] = isprint(c) ? c : '.';
if (wrapIndex && (wrapIndex % clustering == 0))
- *outstrm << " ";
+ *outstrm << ' ';
outstrm->setFieldWidth(2);
outstrm->setPadChar('0');
@@ -172,14 +172,14 @@ void QWSHexDump::sideviewDump(int at)
int currentWidth = (2 * at) + (at / clustering) - (at%clustering?0:1);
int missing = qMax(dataWidth - currentWidth, 0);
while (missing--)
- *outstrm << " ";
+ *outstrm << ' ';
*outstrm << " [";
outstrm->setPadChar(' ');
outstrm->setFieldWidth(wrap);
outstrm->setFieldAlignment( QTextStream::AlignLeft );
*outstrm << sideview;
- *outstrm << "]";
+ *outstrm << ']';
}
}
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp
index 1125610..ea52e11 100644
--- a/src/gui/kernel/qapplication_qws.cpp
+++ b/src/gui/kernel/qapplication_qws.cpp
@@ -194,7 +194,7 @@ QString qws_dataDir()
static QString result;
if (!result.isEmpty())
return result;
- QByteArray dataDir = QString(QLatin1String("/tmp/qtembedded-%1")).arg(qws_display_id).toLocal8Bit();
+ QByteArray dataDir = QString::fromLatin1("/tmp/qtembedded-%1").arg(qws_display_id).toLocal8Bit();
if (QT_MKDIR(dataDir, 0700)) {
if (errno != EEXIST) {
qFatal("Cannot create Qt for Embedded Linux data directory: %s", dataDir.constData());
@@ -215,7 +215,7 @@ QString qws_dataDir()
if ((buf.st_mode & 0677) != 0600)
qFatal("Qt for Embedded Linux data directory has incorrect permissions: %s", dataDir.constData());
#endif
- dataDir += "/";
+ dataDir += '/';
result = QString::fromLocal8Bit(dataDir);
return result;
@@ -224,7 +224,7 @@ QString qws_dataDir()
// Get the filename of the pipe Qt for Embedded Linux uses for server/client comms
Q_GUI_EXPORT QString qws_qtePipeFilename()
{
- return (qws_dataDir() + QString(QLatin1String(QTE_PIPE)).arg(qws_display_id));
+ return (qws_dataDir() + QString::fromLatin1(QTE_PIPE).arg(qws_display_id));
}
static void setMaxWindowRect(const QRect &rect)
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 39f7335..670058b 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -955,8 +955,8 @@ const QString qt_reg_winclass(QWidget *w) // register window class
wchar_t uniqueAppID[256];
GetModuleFileNameW(0, uniqueAppID, 255);
cname = QString::number(RegisterWindowMessageW(
- (const wchar_t *) QString::fromUtf16((const ushort *)uniqueAppID).toLower().replace(QString(QString::fromLatin1("\\")),
- QString(QString::fromLatin1("_"))).utf16()));
+ (const wchar_t *) QString::fromUtf16((const ushort *)uniqueAppID).toLower().replace(QLatin1Char('\\'),
+ QLatin1Char('_')).utf16()));
#endif
// since multiple Qt versions can be used in one process
diff --git a/src/gui/kernel/qmime_mac.cpp b/src/gui/kernel/qmime_mac.cpp
index b2eeb5c..9cb8b61 100644
--- a/src/gui/kernel/qmime_mac.cpp
+++ b/src/gui/kernel/qmime_mac.cpp
@@ -218,7 +218,7 @@ QString QMacPasteboardMimeAny::flavorFor(const QString &mime)
if(mime == QLatin1String("application/x-qt-mime-type-name"))
return QString();
QString ret = QLatin1String("com.trolltech.anymime.") + mime;
- return ret.replace(QLatin1String("/"), QLatin1String("--"));
+ return ret.replace(QLatin1Char('/'), QLatin1String("--"));
}
QString QMacPasteboardMimeAny::mimeFor(QString flav)
@@ -394,7 +394,7 @@ QString QMacPasteboardMimeUnicodeText::flavorFor(const QString &mime)
int i = mime.indexOf(QLatin1String("charset="));
if (i >= 0) {
QString cs(mime.mid(i+8).toLower());
- i = cs.indexOf(QLatin1String(";"));
+ i = cs.indexOf(QLatin1Char(';'));
if (i>=0)
cs = cs.left(i);
if (cs == QLatin1String("system"))
diff --git a/src/gui/kernel/qmime_win.cpp b/src/gui/kernel/qmime_win.cpp
index 109ce20..ad2dec1 100644
--- a/src/gui/kernel/qmime_win.cpp
+++ b/src/gui/kernel/qmime_win.cpp
@@ -1262,16 +1262,16 @@ QVector<FORMATETC> QLastResortMimes::formatsForMime(const QString &mimeType, con
}
return formatetcs;
}
-static const char *x_qt_windows_mime = "application/x-qt-windows-mime;value=\"";
+static const char x_qt_windows_mime[] = "application/x-qt-windows-mime;value=\"";
-bool isCustomMimeType(const QString &mimeType)
+static bool isCustomMimeType(const QString &mimeType)
{
return mimeType.startsWith(QLatin1String(x_qt_windows_mime), Qt::CaseInsensitive);
}
-QString customMimeType(const QString &mimeType)
+static QString customMimeType(const QString &mimeType)
{
- int len = QString(QLatin1String(x_qt_windows_mime)).length();
+ int len = sizeof(x_qt_windows_mime) - 1;
int n = mimeType.lastIndexOf(QLatin1Char('\"'))-len;
return mimeType.mid(len, n);
}
diff --git a/src/gui/kernel/qsound_qws.cpp b/src/gui/kernel/qsound_qws.cpp
index e83935f..661544f 100644
--- a/src/gui/kernel/qsound_qws.cpp
+++ b/src/gui/kernel/qsound_qws.cpp
@@ -279,7 +279,7 @@ QAuBucketQWS::QAuBucketQWS( QAuServerQWS *server, QSound *sound, QObject* parent
sound->setObjectName( m_id.toString() );
- m_channel = new QCopChannel(QString( QLatin1String("QPE/QSound/") ).append( m_id ), this );
+ m_channel = new QCopChannel(QLatin1String("QPE/QSound/") + m_id ), this );
connect( m_channel, SIGNAL(received(QString,QByteArray)),
this, SLOT(processMessage(QString,QByteArray)) );
diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp
index 7ed521e..6a206ee 100644
--- a/src/gui/painting/qbezier.cpp
+++ b/src/gui/painting/qbezier.cpp
@@ -673,10 +673,10 @@ static int IntersectBB(const QBezier &a, const QBezier &b)
#ifdef QDEBUG_BEZIER
static QDebug operator<<(QDebug dbg, const QBezier &bz)
{
- dbg <<"["<<bz.x1<<", "<<bz.y1<<"], "
- <<"["<<bz.x2<<", "<<bz.y2<<"], "
- <<"["<<bz.x3<<", "<<bz.y3<<"], "
- <<"["<<bz.x4<<", "<<bz.y4<<"]";
+ dbg << '[' << bz.x1<< ", " << bz.y1 << "], "
+ << '[' << bz.x2 <<", " << bz.y2 << "], "
+ << '[' << bz.x3 <<", " << bz.y3 << "], "
+ << '[' << bz.x4 <<", " << bz.y4 << ']';
return dbg;
}
#endif
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 93e0db0..3f85095 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -6204,7 +6204,7 @@ void dumpClip(int width, int height, QClipData *clip)
Q_ASSERT(x1 >= 0);
fprintf(stderr,"clip %d: %d %d - %d %d\n", counter, x0, y0, x1, y1);
- clipImg.save(QString(QLatin1String("clip-%0.png")).arg(counter++));
+ clipImg.save(QString::fromLatin1("clip-%0.png").arg(counter++));
}
#endif
diff --git a/src/gui/painting/qprinterinfo_unix.cpp b/src/gui/painting/qprinterinfo_unix.cpp
index 0f33ea7..5724173 100644
--- a/src/gui/painting/qprinterinfo_unix.cpp
+++ b/src/gui/painting/qprinterinfo_unix.cpp
@@ -822,7 +822,7 @@ QList<QPrinterInfo> QPrinterInfo::availablePrinters()
for (int i = 0; i < cupsPrinterCount; ++i) {
QString printerName(QString::fromLocal8Bit(cupsPrinters[i].name));
if (cupsPrinters[i].instance)
- printerName += QLatin1String("/") + QString::fromLocal8Bit(cupsPrinters[i].instance);
+ printerName += QLatin1Char('/') + QString::fromLocal8Bit(cupsPrinters[i].instance);
list.append(QPrinterInfo(printerName));
if (cupsPrinters[i].is_default)
list[i].d_ptr->m_default = true;
@@ -893,7 +893,7 @@ QPrinterInfo::QPrinterInfo(const QPrinter& printer)
for (int i = 0; i < cupsPrinterCount; ++i) {
QString printerName(QString::fromLocal8Bit(cupsPrinters[i].name));
if (cupsPrinters[i].instance)
- printerName += QLatin1String("/") + QString::fromLocal8Bit(cupsPrinters[i].instance);
+ printerName += QLatin1Char('/') + QString::fromLocal8Bit(cupsPrinters[i].instance);
if (printerName == printer.printerName()) {
if (cupsPrinters[i].is_default)
d->m_default = true;
diff --git a/src/gui/painting/qtessellator.cpp b/src/gui/painting/qtessellator.cpp
index b743940..9b5efee 100644
--- a/src/gui/painting/qtessellator.cpp
+++ b/src/gui/painting/qtessellator.cpp
@@ -1273,7 +1273,7 @@ QRectF QTessellator::tessellate(const QPointF *points, int nPoints)
<< "p0= (" << Q27Dot5ToDouble(d->scanline.edges[i]->v0->x)
<< '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v0->y)
<< ") p1= (" << Q27Dot5ToDouble(d->scanline.edges[i]->v1->x)
- << '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v1->y) << ")"
+ << '/' << Q27Dot5ToDouble(d->scanline.edges[i]->v1->y) << ')'
<< "x=" << Q27Dot5ToDouble(d->scanline.edges[i]->positionAt(d->y))
<< "isLeftOfNext="
<< ((i < d->scanline.size - 1)
diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp
index 9e8b498..f29d627 100644
--- a/src/gui/painting/qwindowsurface_x11.cpp
+++ b/src/gui/painting/qwindowsurface_x11.cpp
@@ -128,7 +128,7 @@ void QX11WindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint
return;
// qDebug() << "XSetClipRectangles";
// for (int i = 0; i < num; ++i)
-// qDebug() << " " << i << rects[i].x << rects[i].x << rects[i].y << rects[i].width << rects[i].height;
+// qDebug() << ' ' << i << rects[i].x << rects[i].x << rects[i].y << rects[i].width << rects[i].height;
XSetClipRectangles(X11->display, gc, 0, 0, rects, num, YXBanded);
XCopyArea(X11->display, d_ptr->device.handle(), widget->handle(), gc,
br.x() + offset.x(), br.y() + offset.y(), br.width(), br.height(), wbr.x(), wbr.y());
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp
index 07cec93..f92fd0e 100644
--- a/src/gui/styles/gtksymbols.cpp
+++ b/src/gui/styles/gtksymbols.cpp
@@ -374,8 +374,8 @@ static QString getThemeName()
while(!in.atEnd()) {
QString line = in.readLine();
if (line.contains(QLS("gtk-theme-name"))) {
- line = line.right(line.length() - line.indexOf(QLS("=")) - 1);
- line.remove(QLS("\""));
+ line = line.right(line.length() - line.indexOf(QLatin1Char('=')) - 1);
+ line.remove(QLatin1Char('\"'));
line = line.trimmed();
themeName = line;
break;
@@ -695,7 +695,7 @@ void QGtk::initGtkWidgets()
QHashIterator<QString, GtkWidget*> it(oldMap);
while (it.hasNext()) {
it.next();
- if (!it.key().contains(QLS("."))) {
+ if (!it.key().contains(QLatin1Char('.'))) {
add_all_sub_widgets(it.value());
}
}
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 0e54af8..151dab0 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -1776,8 +1776,9 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom
QString key;
+
if (option->state & State_HasFocus) {
- key = QLS("f");
+ key += QLatin1Char('f');
GTK_WIDGET_SET_FLAGS(gtkSpinButton, GTK_HAS_FOCUS);
}
diff --git a/src/gui/text/qfontdatabase_qws.cpp b/src/gui/text/qfontdatabase_qws.cpp
index f62a6d1..9a29de2 100644
--- a/src/gui/text/qfontdatabase_qws.cpp
+++ b/src/gui/text/qfontdatabase_qws.cpp
@@ -767,8 +767,8 @@ QFontEngine *loadSingleEngine(int script, const QFontPrivate *fp,
QString fn = qwsFontPath();
fn += QLatin1Char('/');
fn += family->name.toLower()
- + QLatin1String("_") + QString::number(pixelSize*10)
- + QLatin1String("_") + QString::number(style->key.weight)
+ + QLatin1Char('_') + QString::number(pixelSize*10)
+ + QLatin1Char('_') + QString::number(style->key.weight)
+ (style->key.style == QFont::StyleItalic ?
QLatin1String("i.qpf") : QLatin1String(".qpf"));
//###rotation ###
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index 70e1599..605a7dd 100644
--- a/src/gui/text/qfontdatabase_x11.cpp
+++ b/src/gui/text/qfontdatabase_x11.cpp
@@ -509,9 +509,9 @@ bool qt_fillFontDef(const QByteArray &xlfd, QFontDef *fd, int dpi, QtFontDesc *d
fd->styleStrategy |= QFont::NoAntialias;
fd->family = QString::fromLatin1(tokens[Family]);
QString foundry = QString::fromLatin1(tokens[Foundry]);
- if (! foundry.isEmpty() && foundry != QString::fromLatin1("*") && (!desc || desc->family->count > 1))
+ if (! foundry.isEmpty() && foundry != QLatin1String("*") && (!desc || desc->family->count > 1))
fd->family +=
- QString::fromLatin1(" [") + foundry + QString::fromLatin1("]");
+ QLatin1String(" [") + foundry + QLatin1Char(']');
if (qstrlen(tokens[AddStyle]) > 0)
fd->addStyle = QString::fromLatin1(tokens[AddStyle]);
@@ -1802,30 +1802,30 @@ QFontEngine *QFontDatabase::loadXlfd(int screen, int script, const QFontDef &req
QByteArray xlfd("-");
xlfd += desc.foundry->name.isEmpty() ? QByteArray("*") : desc.foundry->name.toLatin1();
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.family->name.isEmpty() ? QByteArray("*") : desc.family->name.toLatin1();
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.style->weightName ? desc.style->weightName : "*";
- xlfd += "-";
+ xlfd += '-';
xlfd += (desc.style->key.style == QFont::StyleItalic
- ? "i"
- : (desc.style->key.style == QFont::StyleOblique ? "o" : "r"));
- xlfd += "-";
+ ? 'i'
+ : (desc.style->key.style == QFont::StyleOblique ? 'o' : 'r'));
+ xlfd += '-';
xlfd += desc.style->setwidthName ? desc.style->setwidthName : "*";
// ### handle add-style
xlfd += "-*-";
xlfd += QByteArray::number(px);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->xpoint);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->xres);
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->yres);
- xlfd += "-";
+ xlfd += '-';
xlfd += desc.encoding->pitch;
- xlfd += "-";
+ xlfd += '-';
xlfd += QByteArray::number(desc.encoding->avgwidth);
- xlfd += "-";
+ xlfd += '-';
xlfd += xlfd_for_id(desc.encoding->encoding);
FM_DEBUG(" using XLFD: %s\n", xlfd.data());
diff --git a/src/gui/text/qfontengine_qpf.cpp b/src/gui/text/qfontengine_qpf.cpp
index b7d1c59..28eb362 100644
--- a/src/gui/text/qfontengine_qpf.cpp
+++ b/src/gui/text/qfontengine_qpf.cpp
@@ -308,7 +308,7 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
readOnly = true;
#if defined(DEBUG_FONTENGINE)
- qDebug() << "QFontEngineQPF::QFontEngineQPF( fd =" << fd << ", renderingFontEngine =" << renderingFontEngine << ")";
+ qDebug() << "QFontEngineQPF::QFontEngineQPF( fd =" << fd << ", renderingFontEngine =" << renderingFontEngine << ')';
#endif
#ifndef QT_FONTS_ARE_RESOURCES
@@ -316,11 +316,11 @@ QFontEngineQPF::QFontEngineQPF(const QFontDef &def, int fileDescriptor, QFontEng
if (!renderingFontEngine)
return;
- fileName = fontDef.family.toLower() + QLatin1String("_")
+ fileName = fontDef.family.toLower() + QLatin1Char('_')
+ QString::number(fontDef.pixelSize)
- + QLatin1String("_") + QString::number(fontDef.weight)
+ + QLatin1Char('_') + QString::number(fontDef.weight)
+ (fontDef.style != QFont::StyleNormal ?
- QLatin1String("_italic") : QLatin1String(""))
+ QLatin1String("_italic") : QLatin1String())
+ QLatin1String(".qsf");
fileName.replace(QLatin1Char(' '), QLatin1Char('_'));
fileName.prepend(qws_fontCacheDir());
@@ -550,7 +550,7 @@ bool QFontEngineQPF::stringToCMap(const QChar *str, int len, QGlyphLayout *glyph
#if 0 && defined(DEBUG_FONTENGINE)
QChar c(uc);
if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c))
- qDebug() << "glyph for character" << c << "/" << hex << uc << "is" << dec << glyphs[glyph_pos].glyph;
+ qDebug() << "glyph for character" << c << '/' << hex << uc << "is" << dec << glyphs[glyph_pos].glyph;
seenGlyphs.insert(c);
#endif
diff --git a/src/gui/text/qfontengine_x11.cpp b/src/gui/text/qfontengine_x11.cpp
index 0972b2b..bafc99d 100644
--- a/src/gui/text/qfontengine_x11.cpp
+++ b/src/gui/text/qfontengine_x11.cpp
@@ -227,7 +227,7 @@ static QFontEngine::FaceId fontFile(const QByteArray &_xname, QFreetypeFace **fr
QByteArray best_mapping;
for (QStringList::ConstIterator it = fontpath.constBegin(); it != fontpath.constEnd(); ++it) {
- if ((*it).left(1) != QLatin1String("/"))
+ if (!(*it).startsWith(QLatin1Char('/')))
continue; // not a path name, a font server
QString fontmapname;
int num = 0;
@@ -693,9 +693,8 @@ QFontEngine::FaceId QFontEngineXLFD::faceId() const
if (freetype) {
const_cast<QFontEngineXLFD *>(this)->fsType = freetype->fsType();
} else {
- QFontEngine::Properties properties = QFontEngine::properties();
face_id.index = 0;
- face_id.filename = "-" + properties.postscriptName;
+ face_id.filename = '-' + QFontEngine::properties().postscriptName;
}
}
#endif
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index c66d0c1..fa032e6 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -2500,7 +2500,7 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
LDEBUG << "layoutBlock from=" << layoutFrom << "to=" << layoutTo;
-// qDebug() << "layoutBlock; width" << layoutStruct->x_right - layoutStruct->x_left << "(maxWidth is btw" << tl->maximumWidth() << ")";
+// qDebug() << "layoutBlock; width" << layoutStruct->x_right - layoutStruct->x_left << "(maxWidth is btw" << tl->maximumWidth() << ')';
if (previousBlockFormat) {
qreal margin = qMax(blockFormat.topMargin(), previousBlockFormat->bottomMargin());
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index b1f1b75..ee743dc 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -499,7 +499,7 @@ void QTextHtmlParser::dumpHtml()
{
for (int i = 0; i < count(); ++i) {
qDebug().nospace() << qPrintable(QString(depth(i)*4, QLatin1Char(' ')))
- << qPrintable(at(i).tag) << ":"
+ << qPrintable(at(i).tag) << ':'
<< quoteNewline(at(i).text);
;
}
diff --git a/src/gui/util/qdesktopservices_mac.cpp b/src/gui/util/qdesktopservices_mac.cpp
index fdafa1e..fb1e193 100644
--- a/src/gui/util/qdesktopservices_mac.cpp
+++ b/src/gui/util/qdesktopservices_mac.cpp
@@ -154,7 +154,7 @@ QString QDesktopServices::storageLocation(StandardLocation type)
QString appName = QCoreApplication::applicationName();
if (!appName.isEmpty() &&
(QDesktopServices::DataLocation == type || QDesktopServices::CacheLocation == type))
- path += QLatin1String("/") + appName;
+ path += QLatin1Char('/') + appName;
return path;
}
diff --git a/src/gui/util/qdesktopservices_x11.cpp b/src/gui/util/qdesktopservices_x11.cpp
index b3486e8..8c4a597 100644
--- a/src/gui/util/qdesktopservices_x11.cpp
+++ b/src/gui/util/qdesktopservices_x11.cpp
@@ -164,8 +164,8 @@ QString QDesktopServices::storageLocation(StandardLocation type)
QString key = lst.at(1);
QString value = lst.at(2);
if (value.length() > 2
- && value.startsWith(QLatin1String("\""))
- && value.endsWith(QLatin1String("\"")))
+ && value.startsWith(QLatin1Char('\"'))
+ && value.endsWith(QLatin1Char('\"')))
value = value.mid(1, value.length() - 2);
// Store the key and value: "DESKTOP", "$HOME/Desktop"
lines[key] = value;
diff --git a/src/gui/widgets/qcombobox_p.h b/src/gui/widgets/qcombobox_p.h
index ee0da62..0998e52 100644
--- a/src/gui/widgets/qcombobox_p.h
+++ b/src/gui/widgets/qcombobox_p.h
@@ -290,7 +290,7 @@ public:
QComboBoxDelegate(QObject *parent, QComboBox *cmb) : QItemDelegate(parent), mCombo(cmb) {}
static bool isSeparator(const QModelIndex &index) {
- return index.data(Qt::AccessibleDescriptionRole).toString() == QString::fromLatin1("separator");
+ return index.data(Qt::AccessibleDescriptionRole).toString() == QLatin1String("separator");
}
static void setSeparator(QAbstractItemModel *model, const QModelIndex &index) {
model->setData(index, QString::fromLatin1("separator"), Qt::AccessibleDescriptionRole);
diff --git a/src/gui/widgets/qprogressbar.cpp b/src/gui/widgets/qprogressbar.cpp
index cdb3836..804220d 100644
--- a/src/gui/widgets/qprogressbar.cpp
+++ b/src/gui/widgets/qprogressbar.cpp
@@ -448,19 +448,19 @@ QString QProgressBar::text() const
qint64 totalSteps = qint64(d->maximum) - qint64(d->minimum);
QString result = d->format;
- result.replace(QLatin1String("%m"), QString::fromLatin1("%1").arg(totalSteps));
- result.replace(QLatin1String("%v"), QString::fromLatin1("%1").arg(d->value));
+ result.replace(QLatin1String("%m"), QString::number(totalSteps));
+ result.replace(QLatin1String("%v"), QString::number(d->value));
// If max and min are equal and we get this far, it means that the
// progress bar has one step and that we are on that step. Return
// 100% here in order to avoid division by zero further down.
if (totalSteps == 0) {
- result.replace(QLatin1String("%p"), QString::fromLatin1("%1").arg(100));
+ result.replace(QLatin1String("%p"), QString::number(100));
return result;
}
int progress = int(((qreal(d->value) - qreal(d->minimum)) * 100.0) / totalSteps);
- result.replace(QLatin1String("%p"), QString::fromLatin1("%1").arg(progress));
+ result.replace(QLatin1String("%p"), QString::number(progress));
return result;
}