diff --git a/src/network/kernel/qnetworkproxy_libproxy.cpp b/src/network/kernel/qnetworkproxy_libproxy.cpp index 1df9d674e7..c7d1d48605 100644 --- a/src/network/kernel/qnetworkproxy_libproxy.cpp +++ b/src/network/kernel/qnetworkproxy_libproxy.cpp @@ -121,14 +121,14 @@ QList QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro bool haveDirectConnection = false; foreach (const QUrl& url, rawProxies) { QNetworkProxy::ProxyType type; - if (url.scheme() == QStringLiteral("http")) { + if (url.scheme() == QLatin1String("http")) { type = QNetworkProxy::HttpProxy; - } else if (url.scheme() == QStringLiteral("socks") - || url.scheme() == QStringLiteral("socks5")) { + } else if (url.scheme() == QLatin1String("socks") + || url.scheme() == QLatin1String("socks5")) { type = QNetworkProxy::Socks5Proxy; - } else if (url.scheme() == QStringLiteral("ftp")) { + } else if (url.scheme() == QLatin1String("ftp")) { type = QNetworkProxy::FtpCachingProxy; - } else if (url.scheme() == QStringLiteral("direct")) { + } else if (url.scheme() == QLatin1String("direct")) { type = QNetworkProxy::NoProxy; haveDirectConnection = true; } else { diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp index 0293c74fb9..f902ec230b 100644 --- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp @@ -1961,71 +1961,71 @@ namespace // https://bugzilla.gnome.org/show_bug.cgi?id=744553 "ATK docs provide no guidance for allowed values of some text attributes" // specifically for "weight", "invalid", "language" and value range for colors - if (ia2Name == QStringLiteral("background-color")) { + if (ia2Name == QLatin1String("background-color")) { name = QStringLiteral("bg-color"); value = atspiColor(value); - } else if (ia2Name == QStringLiteral("font-family")) { + } else if (ia2Name == QLatin1String("font-family")) { name = QStringLiteral("family-name"); - } else if (ia2Name == QStringLiteral("color")) { + } else if (ia2Name == QLatin1String("color")) { name = QStringLiteral("fg-color"); value = atspiColor(value); - } else if (ia2Name == QStringLiteral("text-align")) { + } else if (ia2Name == QLatin1String("text-align")) { name = QStringLiteral("justification"); - if (value == QStringLiteral("justify")) { + if (value == QLatin1String("justify")) { value = QStringLiteral("fill"); } else { - if (value != QStringLiteral("left") && - value != QStringLiteral("right") && - value != QStringLiteral("center") + if (value != QLatin1String("left") && + value != QLatin1String("right") && + value != QLatin1String("center") ) { value = QString(); qAtspiDebug() << "Unknown text-align attribute value \"" << value << "\" cannot be translated to AT-SPI."; } } - } else if (ia2Name == QStringLiteral("font-size")) { + } else if (ia2Name == QLatin1String("font-size")) { name = QStringLiteral("size"); value = atspiSize(value); - } else if (ia2Name == QStringLiteral("font-style")) { + } else if (ia2Name == QLatin1String("font-style")) { name = QStringLiteral("style"); - if (value != QStringLiteral("normal") && - value != QStringLiteral("italic") && - value != QStringLiteral("oblique") + if (value != QLatin1String("normal") && + value != QLatin1String("italic") && + value != QLatin1String("oblique") ) { value = QString(); qAtspiDebug() << "Unknown font-style attribute value \"" << value << "\" cannot be translated to AT-SPI."; } - } else if (ia2Name == QStringLiteral("text-underline-type")) { + } else if (ia2Name == QLatin1String("text-underline-type")) { name = QStringLiteral("underline"); - if (value != QStringLiteral("none") && - value != QStringLiteral("single") && - value != QStringLiteral("double") + if (value != QLatin1String("none") && + value != QLatin1String("single") && + value != QLatin1String("double") ) { value = QString(); qAtspiDebug() << "Unknown text-underline-type attribute value \"" << value << "\" cannot be translated to AT-SPI."; } - } else if (ia2Name == QStringLiteral("font-weight")) { + } else if (ia2Name == QLatin1String("font-weight")) { name = QStringLiteral("weight"); - if (value == QStringLiteral("normal")) + if (value == QLatin1String("normal")) // Orca seems to accept all IAccessible2 values except for "normal" // (on which it produces traceback and fails to read any following text attributes), // but that is the default value, so omit it anyway value = QString(); - } else if (ia2Name == QStringLiteral("text-position")) { + } else if (ia2Name == QLatin1String("text-position")) { name = QStringLiteral("vertical-align"); - if (value != QStringLiteral("baseline") && - value != QStringLiteral("super") && - value != QStringLiteral("sub") + if (value != QLatin1String("baseline") && + value != QLatin1String("super") && + value != QLatin1String("sub") ) { value = QString(); qAtspiDebug() << "Unknown text-position attribute value \"" << value << "\" cannot be translated to AT-SPI."; } - } else if (ia2Name == QStringLiteral("writing-mode")) { + } else if (ia2Name == QLatin1String("writing-mode")) { name = QStringLiteral("direction"); - if (value == QStringLiteral("lr")) + if (value == QLatin1String("lr")) value = QStringLiteral("ltr"); - else if (value == QStringLiteral("rl")) + else if (value == QLatin1String("rl")) value = QStringLiteral("rtl"); - else if (value == QStringLiteral("tb")) { + else if (value == QLatin1String("tb")) { // IAccessible2 docs refer to XSL, which specifies "tb" is shorthand for "tb-rl"; so at least give a hint about the horizontal direction (ATK does not support vertical direction in this attribute (yet)) value = QStringLiteral("rtl"); qAtspiDebug() << "writing-mode attribute value \"tb\" translated only w.r.t. horizontal direction; vertical direction ignored"; @@ -2033,9 +2033,9 @@ namespace value = QString(); qAtspiDebug() << "Unknown writing-mode attribute value \"" << value << "\" cannot be translated to AT-SPI."; } - } else if (ia2Name == QStringLiteral("language")) { + } else if (ia2Name == QLatin1String("language")) { // OK - ATK has no docs on the format of the value, IAccessible2 has reasonable format - leave it at that now - } else if (ia2Name == QStringLiteral("invalid")) { + } else if (ia2Name == QLatin1String("invalid")) { // OK - ATK docs are vague but suggest they support the same range of values as IAccessible2 } else { // attribute we know nothing about diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp index 3b8a85a26b..42037ffb9a 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp @@ -1030,17 +1030,17 @@ QNetworkConfiguration::BearerType QNetworkManagerEngine::currentBearerType(const QString bearer = i.value()->bearer(); - if (bearer == QStringLiteral("gsm")) { + if (bearer == QLatin1String("gsm")) { return QNetworkConfiguration::Bearer2G; - } else if (bearer == QStringLiteral("edge")) { + } else if (bearer == QLatin1String("edge")) { return QNetworkConfiguration::Bearer2G; - } else if (bearer == QStringLiteral("umts")) { + } else if (bearer == QLatin1String("umts")) { return QNetworkConfiguration::BearerWCDMA; - } else if (bearer == QStringLiteral("hspa") - || bearer == QStringLiteral("hsdpa") - || bearer == QStringLiteral("hsupa")) { + } else if (bearer == QLatin1String("hspa") + || bearer == QLatin1String("hsdpa") + || bearer == QLatin1String("hsupa")) { return QNetworkConfiguration::BearerHSPA; - } else if (bearer == QStringLiteral("lte")) { + } else if (bearer == QLatin1String("lte")) { return QNetworkConfiguration::BearerLTE; } } diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp index fc9a3281b8..d550887ba6 100644 --- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp +++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp @@ -214,7 +214,7 @@ void QNetworkManagerInterface::propertiesSwap(QMap map) i.next(); propertyMap.insert(i.key(),i.value()); - if (i.key() == QStringLiteral("State")) { + if (i.key() == QLatin1String("State")) { quint32 state = i.value().toUInt(); if (state == NM_DEVICE_STATE_ACTIVATED || state == NM_DEVICE_STATE_DISCONNECTED @@ -223,7 +223,7 @@ void QNetworkManagerInterface::propertiesSwap(QMap map) Q_EMIT propertiesChanged(map); Q_EMIT stateChanged(state); } - } else if (i.key() == QStringLiteral("ActiveConnections")) { + } else if (i.key() == QLatin1String("ActiveConnections")) { Q_EMIT propertiesChanged(map); } } @@ -418,7 +418,7 @@ void QNetworkManagerInterfaceDevice::propertiesSwap(QMap map) QMapIterator i(map); while (i.hasNext()) { i.next(); - if (i.key() == QStringLiteral("AvailableConnections")) { //Device + if (i.key() == QLatin1String("AvailableConnections")) { //Device const QDBusArgument &dbusArgs = i.value().value(); QDBusObjectPath path; QStringList paths; @@ -514,9 +514,8 @@ void QNetworkManagerInterfaceDeviceWired::propertiesSwap(QMap while (i.hasNext()) { i.next(); propertyMap.insert(i.key(),i.value()); - if (i.key() == QStringLiteral("Carrier")) { + if (i.key() == QLatin1String("Carrier")) Q_EMIT carrierChanged(i.value().toBool()); - } } Q_EMIT propertiesChanged(map); } @@ -693,9 +692,8 @@ void QNetworkManagerInterfaceDeviceWireless::propertiesSwap(QMap map) while (i.hasNext()) { i.next(); propertyMap.insert(i.key(),i.value()); - if (i.key() == QStringLiteral("State")) { + if (i.key() == QLatin1String("State")) { quint32 state = i.value().toUInt(); if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED || state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) { diff --git a/src/plugins/platforms/haiku/qhaikuclipboard.cpp b/src/plugins/platforms/haiku/qhaikuclipboard.cpp index a2d7e96d71..9b2fe3cfa3 100644 --- a/src/plugins/platforms/haiku/qhaikuclipboard.cpp +++ b/src/plugins/platforms/haiku/qhaikuclipboard.cpp @@ -86,9 +86,9 @@ QMimeData *QHaikuClipboard::mimeData(QClipboard::Mode mode) const status_t status = clipboard->FindData(name, B_MIME_TYPE, &data, &dataLen); if (dataLen && (status == B_OK)) { const QString format = QString::fromLatin1(name); - if (format == QStringLiteral("text/plain")) { + if (format == QLatin1String("text/plain")) { m_systemMimeData->setText(QString::fromLocal8Bit(reinterpret_cast(data), dataLen)); - } else if (format == QStringLiteral("text/html")) { + } else if (format == QLatin1String("text/html")) { m_systemMimeData->setHtml(QString::fromLocal8Bit(reinterpret_cast(data), dataLen)); } else { m_systemMimeData->setData(format, QByteArray(reinterpret_cast(data), dataLen)); diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index 8a2fbe1f6d..bf42ca190b 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -1613,7 +1613,7 @@ LOGFONT QWindowsFontDatabase::fontDefToLOGFONT(const QFontDef &request) if (fam.isEmpty()) fam = QStringLiteral("MS Sans Serif"); - if ((fam == QStringLiteral("MS Sans Serif")) + if (fam == QLatin1String("MS Sans Serif") && (request.style == QFont::StyleItalic || (-lf.lfHeight > 18 && -lf.lfHeight != 24))) { fam = QStringLiteral("Arial"); // MS Sans Serif has bearing problems in italic, and does not scale } diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp index 171ace5c20..eaaf2820ee 100644 --- a/src/plugins/platforms/windows/qwindowsmime.cpp +++ b/src/plugins/platforms/windows/qwindowsmime.cpp @@ -1145,7 +1145,7 @@ QVariant QWindowsMimeImage::convertToMime(const QString &mimeType, IDataObject * { Q_UNUSED(preferredType); QVariant result; - if (mimeType != QStringLiteral("application/x-qt-image")) + if (mimeType != QLatin1String("application/x-qt-image")) return result; //Try to convert from a format which has more data //DIBV5, use only if its is not synthesized diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index abb48034cd..9cedd296e1 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -639,7 +639,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra QString glIntegrationName = QString::fromLocal8Bit(qgetenv("QT_XCB_GL_INTEGRATION")); if (!glIntegrationName.isEmpty()) { qCDebug(QT_XCB_GLINTEGRATION) << "QT_XCB_GL_INTEGRATION is set to" << glIntegrationName; - if (glIntegrationName != QStringLiteral("none")) { + if (glIntegrationName != QLatin1String("none")) { glIntegrationNames.removeAll(glIntegrationName); glIntegrationNames.prepend(glIntegrationName); } else { diff --git a/src/plugins/printsupport/cocoa/main.cpp b/src/plugins/printsupport/cocoa/main.cpp index 3db7b49ba4..2733c3fa60 100644 --- a/src/plugins/printsupport/cocoa/main.cpp +++ b/src/plugins/printsupport/cocoa/main.cpp @@ -49,7 +49,7 @@ public: QPlatformPrinterSupport *QCocoaPrinterSupportPlugin::create(const QString &key) { - if (key.compare(key, QStringLiteral("cocoaprintersupport"), Qt::CaseInsensitive) != 0) + if (key.compare(key, QLatin1String("cocoaprintersupport"), Qt::CaseInsensitive) != 0) return 0; QGuiApplication *app = qobject_cast(QCoreApplication::instance()); if (!app) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 160ccf5778..555ccbf740 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1094,7 +1094,7 @@ void Configure::parseCmdLine() if (i == argCount) break; QString mod = configCmdLine.at(i); - if (!mod.startsWith(QStringLiteral("qt"))) + if (!mod.startsWith(QLatin1String("qt"))) mod.insert(0, QStringLiteral("qt")); if (!QFileInfo(sourcePath + "/../" + mod).isDir()) { cout << "Attempting to skip non-existent module " << mod << "." << endl; @@ -3810,7 +3810,7 @@ void Configure::displayConfig() env = "Unset"; sout << " PATH=\n " << env << endl; - if (dictionary[QStringLiteral("EDITION")] != QStringLiteral("OpenSource")) { + if (dictionary[QStringLiteral("EDITION")] != QLatin1String("OpenSource")) { QString l1 = dictionary[ "LICENSEE" ]; QString l2 = dictionary[ "LICENSEID" ]; QString l3 = dictionary["EDITION"] + ' ' + "Edition"; diff --git a/util/glgen/codegenerator.cpp b/util/glgen/codegenerator.cpp index f590e42960..15db4d0a83 100644 --- a/util/glgen/codegenerator.cpp +++ b/util/glgen/codegenerator.cpp @@ -389,11 +389,11 @@ QString CodeGenerator::passByType(const Argument &arg) const QString CodeGenerator::safeArgumentName(const QString& arg) const { - if (arg == QStringLiteral("near")) // MS Windows defines near and far + if (arg == QLatin1String("near")) // MS Windows defines near and far return QStringLiteral("nearVal"); - else if (arg == QStringLiteral("far")) + else if (arg == QLatin1String("far")) return QStringLiteral("farVal"); - else if (arg == QStringLiteral("d")) + else if (arg == QLatin1String("d")) return QStringLiteral("dd"); // Don't shadow d pointer else return arg; @@ -810,7 +810,7 @@ void CodeGenerator::writeInlineFunction(QTextStream &stream, const QString &clas argumentNames.append(safeArgumentName(arg.name)); QString argNames = argumentNames.join(", "); - if (f.returnType == QStringLiteral("void")) + if (f.returnType == QLatin1String("void")) stream << QString(QStringLiteral(" %1->%2(%3);")).arg(backendVar).arg(f.name).arg(argNames) << endl; else stream << QString(QStringLiteral(" return %1->%2(%3);")).arg(backendVar).arg(f.name).arg(argNames) << endl; diff --git a/util/glgen/legacyspecparser.cpp b/util/glgen/legacyspecparser.cpp index fc34eca80c..77b106bd5d 100644 --- a/util/glgen/legacyspecparser.cpp +++ b/util/glgen/legacyspecparser.cpp @@ -80,7 +80,7 @@ bool LegacySpecParser::parseTypeMap() while (!stream.atEnd()) { QString line = stream.readLine(); - if (line.startsWith(QStringLiteral("#"))) + if (line.startsWith(QLatin1Char('#'))) continue; if (typeMapRegExp.indexIn(line) != -1) { @@ -88,7 +88,7 @@ bool LegacySpecParser::parseTypeMap() QString value = typeMapRegExp.cap(2).simplified(); // Special case for void - if (value == QStringLiteral("*")) + if (value == QLatin1String("*")) value = QStringLiteral("void"); m_typeMap.insert(key, value); @@ -144,7 +144,7 @@ void LegacySpecParser::parseFunctions(QTextStream &stream) // extension. These functions should be added to the DSA extension rather // than the core functionality. The core will already contain non-DSA // versions of these functions. - if (acceptCurrentFunctionInCore && currentFunction.name.endsWith(QStringLiteral("EXT"))) { + if (acceptCurrentFunctionInCore && currentFunction.name.endsWith(QLatin1String("EXT"))) { acceptCurrentFunctionInCore = false; acceptCurrentFunctionInExtension = true; currentCategory = QStringLiteral("EXT_direct_state_access"); @@ -191,9 +191,9 @@ void LegacySpecParser::parseFunctions(QTextStream &stream) arg.type = m_typeMap.value(type); QString direction = argumentRegExp.cap(3); - if (direction == QStringLiteral("in")) { + if (direction == QLatin1String("in")) { arg.direction = Argument::In; - } else if (direction == QStringLiteral("out")) { + } else if (direction == QLatin1String("out")) { arg.direction = Argument::Out; } else { qWarning() << "Invalid argument direction found:" << direction; @@ -201,11 +201,11 @@ void LegacySpecParser::parseFunctions(QTextStream &stream) } QString mode = argumentRegExp.cap(4); - if (mode == QStringLiteral("value")) { + if (mode == QLatin1String("value")) { arg.mode = Argument::Value; - } else if (mode == QStringLiteral("array")) { + } else if (mode == QLatin1String("array")) { arg.mode = Argument::Array; - } else if (mode == QStringLiteral("reference")) { + } else if (mode == QLatin1String("reference")) { arg.mode = Argument::Reference; } else { qWarning() << "Invalid argument mode found:" << mode; @@ -246,7 +246,7 @@ void LegacySpecParser::parseFunctions(QTextStream &stream) // Extract the OpenGL version in which this function was deprecated. // If it is OpenGL 3.1 then it must be a compatibility profile function QString deprecatedVersion = deprecatedRegExp.cap(1).simplified(); - if (deprecatedVersion == QStringLiteral("3.1") && !inDeprecationException(currentFunction.name)) + if (deprecatedVersion == QLatin1String("3.1") && !inDeprecationException(currentFunction.name)) currentVersionProfile.profile = VersionProfile::CompatibilityProfile; } else if (categoryRegExp.indexIn(line) != -1) { @@ -301,5 +301,5 @@ void LegacySpecParser::parseFunctions(QTextStream &stream) bool LegacySpecParser::inDeprecationException(const QString &functionName) const { - return (functionName == QStringLiteral("TexImage3D")); + return functionName == QLatin1String("TexImage3D"); }