diff options
Diffstat (limited to 'qmake/generators')
-rw-r--r-- | qmake/generators/mac/pbuilder_pbx.cpp | 18 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 13 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 8 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 16 | ||||
-rw-r--r-- | qmake/generators/win32/cesdkhandler.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msbuild_objectmodel.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 10 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/xmloutput.cpp | 8 |
11 files changed, 44 insertions, 45 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index e2046c3c17..7c7a70b09a 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1492,21 +1492,21 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (plist_in_file.open(QIODevice::ReadOnly)) { QTextStream plist_in(&plist_in_file); QString plist_in_text = plist_in.readAll(); - plist_in_text.replace("@ICON@", + plist_in_text.replace(QLatin1String("@ICON@"), (project->isEmpty("ICON") ? QString("") : project->first("ICON").toQString().section(Option::dir_sep, -1))); if (project->first("TEMPLATE") == "app") { - plist_in_text.replace("@EXECUTABLE@", project->first("QMAKE_ORIG_TARGET").toQString()); + plist_in_text.replace(QLatin1String("@EXECUTABLE@"), project->first("QMAKE_ORIG_TARGET").toQString()); } else { - plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET").toQString()); + plist_in_text.replace(QLatin1String("@LIBRARY@"), project->first("QMAKE_ORIG_TARGET").toQString()); } QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); if (bundlePrefix.isEmpty()) bundlePrefix = "com.yourcompany"; - plist_in_text.replace("@BUNDLEIDENTIFIER@", bundlePrefix + '.' + QLatin1String("${PRODUCT_NAME:rfc1034identifier}")); + plist_in_text.replace(QLatin1String("@BUNDLEIDENTIFIER@"), bundlePrefix + '.' + QLatin1String("${PRODUCT_NAME:rfc1034identifier}")); if (!project->values("VERSION").isEmpty()) { - plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." + project->first("VER_MIN")); + plist_in_text.replace(QLatin1String("@SHORT_VERSION@"), project->first("VER_MAJ") + "." + project->first("VER_MIN")); } - plist_in_text.replace("@TYPEINFO@", + plist_in_text.replace(QLatin1String("@TYPEINFO@"), (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4).toQString())); QFile plist_out_file(Option::output_dir + "/Info.plist"); @@ -1709,9 +1709,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QTextStream defaultSchemeStream(&defaultSchemeFile); QString schemeData = defaultSchemeStream.readAll(); - schemeData.replace("@QMAKE_ORIG_TARGET@", target); - schemeData.replace("@TARGET_PBX_KEY@", keyFor(pbx_dir + "QMAKE_PBX_TARGET")); - schemeData.replace("@TEST_BUNDLE_PBX_KEY@", keyFor("QMAKE_TEST_BUNDLE_REFERENCE")); + schemeData.replace(QLatin1String("@QMAKE_ORIG_TARGET@"), target); + schemeData.replace(QLatin1String("@TARGET_PBX_KEY@"), keyFor(pbx_dir + "QMAKE_PBX_TARGET")); + schemeData.replace(QLatin1String("@TEST_BUNDLE_PBX_KEY@"), keyFor("QMAKE_TEST_BUNDLE_REFERENCE")); QTextStream outputSchemeStream(&outputSchemeFile); outputSchemeStream << schemeData; diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 3071e633c6..dffc3d6acb 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1131,8 +1131,8 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src) ProStringList::ConstIterator oit = objl.begin(); ProStringList::ConstIterator sit = srcl.begin(); - QString stringSrc("$src"); - QString stringObj("$obj"); + QLatin1String stringSrc("$src"); + QLatin1String stringObj("$obj"); for(;sit != srcl.end() && oit != objl.end(); ++oit, ++sit) { if((*sit).isEmpty()) continue; @@ -2283,7 +2283,7 @@ MakefileGenerator::writeHeader(QTextStream &t) t << "# Project: " << fileFixify(project->projectFile()) << endl; t << "# Template: " << var("TEMPLATE") << endl; if(!project->isActiveConfig("build_pass")) - t << "# Command: " << build_args().replace("$(QMAKE)", var("QMAKE_QMAKE")) << endl; + t << "# Command: " << build_args().replace(QLatin1String("$(QMAKE)"), var("QMAKE_QMAKE")) << endl; t << "#############################################################################\n"; t << endl; QString ofile = Option::fixPathToTargetOS(Option::output.fileName()); @@ -3184,7 +3184,7 @@ MakefileGenerator::pkgConfigFixPath(QString path) const { QString prefix = pkgConfigPrefix(); if(path.startsWith(prefix)) - path.replace(prefix, "${prefix}"); + path.replace(prefix, QLatin1String("${prefix}")); return path; } @@ -3336,7 +3336,7 @@ static QString windowsifyPath(const QString &str) { // The paths are escaped in prl files, so every slash needs to turn into two backslashes. // Then each backslash needs to be escaped for sed. And another level for C quoting here. - return QString(str).replace('/', "\\\\\\\\"); + return QString(str).replace('/', QLatin1String("\\\\\\\\")); } QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst) @@ -3365,8 +3365,7 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt QString MakefileGenerator::shellQuote(const QString &str) { - return isWindowsShell() ? QMakeInternal::IoUtils::shellQuoteWin(str) - : QMakeInternal::IoUtils::shellQuoteUnix(str); + return isWindowsShell() ? IoUtils::shellQuoteWin(str) : IoUtils::shellQuoteUnix(str); } QT_END_NAMESPACE diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index c6627f804d..f062605dd4 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -173,12 +173,12 @@ UnixMakefileGenerator::init() pchBaseName += project->first("QMAKE_ORIG_TARGET").toQString(); // replace place holders - pchFlags.replace("${QMAKE_PCH_INPUT}", + pchFlags.replace(QLatin1String("${QMAKE_PCH_INPUT}"), escapeFilePath(project->first("PRECOMPILED_HEADER").toQString())); - pchFlags.replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName)); + pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT_BASE}"), escapeFilePath(pchBaseName)); if (project->isActiveConfig("icc_pch_style")) { // icc style - pchFlags.replace("${QMAKE_PCH_OUTPUT}", + pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchBaseName + project->first("QMAKE_PCH_OUTPUT_EXT"))); } else { // gcc style (including clang_pch_style) @@ -192,7 +192,7 @@ UnixMakefileGenerator::init() ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler)); if (!language.isEmpty()) { - pchFlags.replace("${QMAKE_PCH_OUTPUT}", + pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchBaseName + language + headerSuffix)); } } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 6049b717c8..9312f19418 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -532,7 +532,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "ld -r -o " << incr_target_dir_f << ' ' << link_deps << endl; //communicated below ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD"); - cmd[0] = cmd.at(0).toQString().replace("$(OBJECTS) ", "$(INCREMENTAL_OBJECTS)"); //ick + cmd[0] = cmd.at(0).toQString().replace(QLatin1String("$(OBJECTS) "), QLatin1String("$(INCREMENTAL_OBJECTS)")); //ick cmd.append(incr_target_dir_f); deps.prepend(incr_target_dir_d + ' '); incr_deps = "$(INCREMENTAL_OBJECTS)"; @@ -700,7 +700,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << destdir_d << "$(TARGET): " << depVar("PRE_TARGETDEPS") << ' ' << depVar("POST_TARGETDEPS") << valList(escapeDependencyPaths(build)) << "\n\t"; ar = project->first("QMAKE_AR_CMD").toQString(); - ar.replace("$(OBJECTS)", escapeFilePaths(build).join(' ')); + ar.replace(QLatin1String("$(OBJECTS)"), escapeFilePaths(build).join(' ')); } else { t << destdir_d << escapeDependencyPath(*libit) << ": " << valList(escapeDependencyPaths(build)) << "\n\t"; @@ -1079,8 +1079,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile_f << "\n\trm -f " << escapeFilePath(pchOutput); - pchFlags.replace("${QMAKE_PCH_TEMP_SOURCE}", sourceFile_f) - .replace("${QMAKE_PCH_TEMP_OBJECT}", escapeFilePath(objectFile)); + pchFlags.replace(QLatin1String("${QMAKE_PCH_TEMP_SOURCE}"), sourceFile_f) + .replace(QLatin1String("${QMAKE_PCH_TEMP_OBJECT}"), escapeFilePath(objectFile)); } else { // gcc style (including clang_pch_style) ProString header_prefix = project->first("QMAKE_PRECOMP_PREFIX"); @@ -1099,9 +1099,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) << escapeDependencyPaths(findDependencies(pchInput)).join(" \\\n\t\t") << "\n\t" << mkdir_p_asstring(pchOutputDir); } - pchFlags.replace("${QMAKE_PCH_INPUT}", escapeFilePath(pchInput)) - .replace("${QMAKE_PCH_OUTPUT_BASE}", escapeFilePath(pchBaseName.toQString())) - .replace("${QMAKE_PCH_OUTPUT}", escapeFilePath(pchOutput.toQString())); + pchFlags.replace(QLatin1String("${QMAKE_PCH_INPUT}"), escapeFilePath(pchInput)) + .replace(QLatin1String("${QMAKE_PCH_OUTPUT_BASE}"), escapeFilePath(pchBaseName.toQString())) + .replace(QLatin1String("${QMAKE_PCH_OUTPUT}"), escapeFilePath(pchOutput.toQString())); QString compilerExecutable; if (compiler == "C" || compiler == "OBJC") @@ -1147,7 +1147,7 @@ void UnixMakefileGenerator::init2() ProStringList &ar_cmd = project->values("QMAKE_AR_CMD"); if (!ar_cmd.isEmpty()) - ar_cmd[0] = ar_cmd.at(0).toQString().replace("(TARGET)","(TARGETA)"); + ar_cmd[0] = ar_cmd.at(0).toQString().replace(QLatin1String("(TARGET)"), QLatin1String("(TARGETA)")); else ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)"); if (!project->isEmpty("QMAKE_BUNDLE")) { diff --git a/qmake/generators/win32/cesdkhandler.cpp b/qmake/generators/win32/cesdkhandler.cpp index e0b5adb99a..f45cbf74a9 100644 --- a/qmake/generators/win32/cesdkhandler.cpp +++ b/qmake/generators/win32/cesdkhandler.cpp @@ -142,7 +142,7 @@ bool CeSdkHandler::parseMsBuildFile(QFile *file, CeSdkInfo *info) QSettings sdkRootPathRegistry(regString, QSettings::NativeFormat); const QString erg = sdkRootPathRegistry.value(QStringLiteral(".")).toString(); const QString fullSdkRootPath = erg + sdkRootPath.mid(endIndex + 1); - const QString rootString = QStringLiteral("$(SdkRootPath)"); + const QLatin1String rootString("$(SdkRootPath)"); includePath = includePath.replace(rootString, fullSdkRootPath); libraryPath = libraryPath.replace(rootString, fullSdkRootPath); diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 3f150b5726..382b10c37b 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -46,7 +46,7 @@ QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const { QString ret = path; ret.replace('\\', "/"); // ### this shouldn't be here - ret.replace(' ', "\\ "); + ret.replace(' ', QLatin1String("\\ ")); return ret; } diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 6485366f16..4539058cbf 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -323,7 +323,7 @@ static QString vcxCommandSeparator() static QString unquote(const QString &value) { QString result = value; - result.replace(QStringLiteral("\\\""), QStringLiteral("\"")); + result.replace(QLatin1String("\\\""), QLatin1String("\"")); return result; } diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 3c0b56cfeb..25a2765a01 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -49,7 +49,7 @@ static QString nmakePathList(const QStringList &list) pathList.append(QDir::cleanPath(path)); return QDir::toNativeSeparators(pathList.join(QLatin1Char(';'))) - .replace('#', QStringLiteral("^#")).replace('$', QStringLiteral("$$")); + .replace('#', QLatin1String("^#")).replace('$', QLatin1String("$$")); } NmakeMakefileGenerator::NmakeMakefileGenerator() : Win32MakefileGenerator(), usePCH(false) @@ -327,7 +327,7 @@ QString NmakeMakefileGenerator::var(const ProKey &value) const QString precompRule = QString("-c -FI%1 -Yu%2 -Fp%3") .arg(precompH_f, precompH_f, escapeFilePath(precompPch)); QString p = MakefileGenerator::var(value); - p.replace("-c", precompRule); + p.replace(QLatin1String("-c"), precompRule); // Cannot use -Gm with -FI & -Yu, as this gives an // internal compiler error, on the newer compilers // ### work-around for a VS 2003 bug. Move to some prf file or remove completely. diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 6219252161..1b3b328243 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -697,12 +697,12 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } QString slnConf = _slnSolutionConf; if (!project->isEmpty("VCPROJ_ARCH")) { - slnConf.replace(QString("|Win32"), "|" + project->first("VCPROJ_ARCH")); + slnConf.replace(QLatin1String("|Win32"), "|" + project->first("VCPROJ_ARCH")); } else if (!project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH")) { QString slnPlatform = QString("|") + project->values("CE_SDK").join(' ') + " (" + project->first("CE_ARCH") + ")"; - slnConf.replace(QString("|Win32"), slnPlatform); + slnConf.replace(QLatin1String("|Win32"), slnPlatform); } else if (is64Bit) { - slnConf.replace(QString("|Win32"), "|x64"); + slnConf.replace(QLatin1String("|Win32"), QLatin1String("|x64")); } t << slnConf; @@ -1698,12 +1698,12 @@ QString VcprojGenerator::replaceExtraCompilerVariables( if(defines.isEmpty()) defines.append(varGlue("PRL_EXPORT_DEFINES"," -D"," -D","") + varGlue("DEFINES"," -D"," -D","")); - ret.replace("$(DEFINES)", defines.first().toQString()); + ret.replace(QLatin1String("$(DEFINES)"), defines.first().toQString()); ProStringList &incpath = project->values("VCPROJ_MAKEFILE_INCPATH"); if(incpath.isEmpty() && !this->var("MSVCPROJ_INCPATH").isEmpty()) incpath.append(this->var("MSVCPROJ_INCPATH")); - ret.replace("$(INCPATH)", incpath.join(' ')); + ret.replace(QLatin1String("$(INCPATH)"), incpath.join(' ')); return ret; } diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index e7b57d46be..0846cb2d8f 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -398,7 +398,7 @@ void Win32MakefileGenerator::processRcFileVar() project->values("RC_FILE").first() = fi.absoluteFilePath(); } - resFile.replace(".rc", Option::res_ext); + resFile.replace(QLatin1String(".rc"), Option::res_ext); project->values("RES_FILE").prepend(fileInfo(resFile).fileName()); QString resDestDir; if (project->isActiveConfig("staticlib")) @@ -768,8 +768,8 @@ QString Win32MakefileGenerator::escapeFilePath(const QString &path) const QString Win32MakefileGenerator::cQuoted(const QString &str) { QString ret = str; - ret.replace(QLatin1Char('\\'), QStringLiteral("\\\\")); - ret.replace(QLatin1Char('"'), QStringLiteral("\\\"")); + ret.replace(QLatin1Char('\\'), QLatin1String("\\\\")); + ret.replace(QLatin1Char('"'), QLatin1String("\\\"")); ret.prepend(QLatin1Char('"')); ret.append(QLatin1Char('"')); return ret; diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp index c1c8f5f493..e92749a126 100644 --- a/qmake/generators/xmloutput.cpp +++ b/qmake/generators/xmloutput.cpp @@ -136,11 +136,11 @@ QString XmlOutput::doConversion(const QString &text) } if (conversion == XMLConversion) { - output.replace('\"', """); - output.replace('\'', "'"); + output.replace('\"', QLatin1String(""")); + output.replace('\'', QLatin1String("'")); } else if (conversion == EscapeConversion) { - output.replace('\"', "\\\""); - output.replace('\'', "\\\'"); + output.replace('\"', QLatin1String("\\\"")); + output.replace('\'', QLatin1String("\\\'")); } return output; } |