diff options
Diffstat (limited to 'qmake')
61 files changed, 983 insertions, 1228 deletions
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index e61e9503f3..1d50f872d9 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -13,7 +13,11 @@ QMKSRC = $(SOURCE_PATH)\qmake !if "$(QMAKESPEC)" == "win32-icc" CXX = icl LINKER = link -CFLAGS_EXTRA = /Zc:forScope +CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 +!elseif "$(QMAKESPEC)" == "win32-clang-msvc2015" +CXX = clang-cl +LINKER = link +CFLAGS_EXTRA = -fms-compatibility-version=19.00.23506 -Wno-microsoft-enum-value !else CXX = cl LINKER = link @@ -21,13 +25,18 @@ LINKER = link CFLAGS_EXTRA = /Zc:wchar_t- ! elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013" CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS $(CFLAGS_CRT) -! elseif "$(QMAKESPEC)" == "win32-msvc2015" +! elseif "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-clang-msvc2015" CFLAGS_EXTRA = /MP /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /Zc:strictStrings /w44456 /w44457 /w44458 /wd4577 $(CFLAGS_CRT) ! else ! error Unsupported compiler for this Makefile ! endif !endif # !win32-icc +!if "$(QMAKESPEC)" != "win32-clang-msvc2015" +CFLAGS_PCH = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch +PCH_OBJECT = qmake_pch.obj +!endif + CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \ -W3 -nologo -O1 \ $(CFLAGS_EXTRA) \ @@ -41,7 +50,7 @@ CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \ -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ -DUNICODE -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS -CFLAGS = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS) +CFLAGS = $(CFLAGS_PCH) $(CFLAGS_BARE) $(CFLAGS) CXXFLAGS_BARE = $(CFLAGS_BARE) CXXFLAGS = $(CFLAGS) @@ -129,7 +138,7 @@ QTOBJS= \ first all: qmake.exe qmake.exe: $(OBJS) $(QTOBJS) - $(LINKQMAKE) qmake_pch.obj + $(LINKQMAKE) $(PCH_OBJECT) -copy qmake.exe $(BUILD_PATH)\bin\qmake.exe clean:: @@ -158,9 +167,9 @@ distclean:: clean .cxx.obj: $(CXX) $(CXXFLAGS) $< -$(OBJS): qmake_pch.obj +$(OBJS): $(PCH_OBJECT) -$(QTOBJS): qmake_pch.obj +$(QTOBJS): $(PCH_OBJECT) qlibraryinfo.obj: $(BUILD_PATH)\src\corelib\global\qconfig.cpp diff --git a/qmake/cachekeys.h b/qmake/cachekeys.h index 1c977444e4..8050f148aa 100644 --- a/qmake/cachekeys.h +++ b/qmake/cachekeys.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index e59b0ddcbe..89ce3b3504 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -28,7 +28,7 @@ /*! \page qmake-manual.html \title qmake Manual - \startpage {index.html}{Qt Reference Documentation} + \startpage {Qt Reference Documentation} \nextpage Overview \ingroup qttools diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index ef9aa9a2e6..35df36cb55 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -103,19 +98,6 @@ struct ProjectBuilderSubDirs { bool ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) { - if(project->isActiveConfig("generate_pbxbuild_makefile")) { - QString mkwrap = fileFixify(pbx_dir + Option::dir_sep + ".." + Option::dir_sep + project->first("MAKEFILE"), - FileFixifyToIndir); - QFile mkwrapf(mkwrap); - if(mkwrapf.open(QIODevice::WriteOnly | QIODevice::Text)) { - debug_msg(1, "pbuilder: Creating file: %s", mkwrap.toLatin1().constData()); - QTextStream mkwrapt(&mkwrapf); - writingUnixMakefileGenerator = true; - UnixMakefileGenerator::writeSubDirs(mkwrapt); - writingUnixMakefileGenerator = false; - } - } - //HEADER const int pbVersion = pbuilderVersion(); t << "// !$*UTF8*$!\n" @@ -479,17 +461,17 @@ ProjectBuilderSources::files(QMakeProject *project) const static QString xcodeFiletypeForFilename(const QString &filename) { - foreach (const QString &ext, Option::cpp_ext) { + for (const QString &ext : qAsConst(Option::cpp_ext)) { if (filename.endsWith(ext)) return QStringLiteral("sourcecode.cpp.cpp"); } - foreach (const QString &ext, Option::c_ext) { + for (const QString &ext : qAsConst(Option::c_ext)) { if (filename.endsWith(ext)) return QStringLiteral("sourcecode.c.c"); } - foreach (const QString &ext, Option::h_ext) { + for (const QString &ext : qAsConst(Option::h_ext)) { if (filename.endsWith(ext)) return "sourcecode.c.h"; } @@ -1009,7 +991,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) ProStringList outputPaths; const ProStringList &archs = project->values("QMAKE_XCODE_ARCHS"); if (!archs.isEmpty()) { - for (int i = 0; i < archs.size(); ++i) { + const int size = archs.size(); + inputPaths.reserve(size); + outputPaths.reserve(size); + for (int i = 0; i < size; ++i) { const ProString &arch = archs.at(i); inputPaths << "$(OBJECT_FILE_DIR_$(CURRENT_VARIANT))/" + arch + "/"; outputPaths << "$(LINK_FILE_LIST_$(CURRENT_VARIANT)_" + arch + ")"; @@ -1134,7 +1119,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if (copyBundleResources && ((ios && path.isEmpty()) || (!ios && path == QLatin1String("Contents/Resources")))) { - foreach (const ProString &s, bundle_files) + for (const ProString &s : qAsConst(bundle_files)) bundle_resources_files << s; } else { QString phase_key = keyFor("QMAKE_PBX_BUNDLE_COPY." + bundle_data[i]); @@ -1494,21 +1479,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"); @@ -1646,12 +1631,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("targets", project->values("QMAKE_PBX_TARGETS"), SettingsAsList, 4) << ";\n" << "\t\t\t" << "attributes = {\n" << "\t\t\t\tTargetAttributes = {\n"; - foreach (const ProString &target, project->values("QMAKE_PBX_TARGETS")) { + for (const ProString &target : project->values("QMAKE_PBX_TARGETS")) { const ProStringList &attributes = project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + target)); if (attributes.isEmpty()) continue; t << "\t\t\t\t\t" << target << " = {\n"; - foreach (const ProString &attribute, attributes) + for (const ProString &attribute : attributes) t << "\t\t\t\t\t\t" << writeSettings(attribute.toQString(), project->first(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + target + "_" + attribute))) << ";\n"; t << "\t\t\t\t\t};\n"; } @@ -1666,32 +1651,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t" << writeSettings("rootObject", keyFor("QMAKE_PBX_ROOT")) << ";\n" << "}\n"; - if(project->isActiveConfig("generate_pbxbuild_makefile")) { - QString mkwrap = Option::output_dir + project->first("/MAKEFILE"); - QFile mkwrapf(mkwrap); - if(mkwrapf.open(QIODevice::WriteOnly | QIODevice::Text)) { - writingUnixMakefileGenerator = true; - debug_msg(1, "pbuilder: Creating file: %s", mkwrap.toLatin1().constData()); - QTextStream mkwrapt(&mkwrapf); - writeHeader(mkwrapt); - const char cleans[] = "preprocess_clean "; - const QString cmd = escapeFilePath(project->first("QMAKE_ORIG_TARGET") + projectSuffix() + "/") + " && " + pbxbuild(); - mkwrapt << "#This is a makefile wrapper for PROJECT BUILDER\n" - << "all:\n\t" - << "cd " << cmd << "\n" - << "install: all\n\t" - << "cd " << cmd << " install\n" - << "distclean clean: preprocess_clean\n\t" - << "cd " << cmd << " clean\n" - << (!did_preprocess ? cleans : "") << ":\n"; - if(did_preprocess) - mkwrapt << cleans << ":\n\t" - << "make -f " - << pbx_dir << Option::dir_sep << "qt_preprocess.mak $@\n"; - writingUnixMakefileGenerator = false; - } - } - // Scheme { QString xcodeSpecDir = project->first("QMAKE_XCODE_SPECDIR").toQString(); @@ -1711,9 +1670,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/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h index f517ce4bbd..1d5cbc538d 100644 --- a/qmake/generators/mac/pbuilder_pbx.h +++ b/qmake/generators/mac/pbuilder_pbx.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 4dfe69fbde..dffc3d6acb 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -59,6 +54,8 @@ #include <sys/types.h> #include <sys/stat.h> +#include <algorithm> + QT_BEGIN_NAMESPACE using namespace QMakeInternal; @@ -779,6 +776,7 @@ MakefileGenerator::init() if(project->isActiveConfig("depend_includepath")) incDirs += v["INCLUDEPATH"]; QList<QMakeLocalFileName> deplist; + deplist.reserve(incDirs.size()); for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it) deplist.append(QMakeLocalFileName((*it).toQString())); QMakeSourceFileInfo::setDependencyPaths(deplist); @@ -907,7 +905,7 @@ MakefileGenerator::processPrlFile(QString &file) project->values("QMAKE_CURRENT_PRL_LIBS") = libinfo.values("QMAKE_PRL_LIBS"); ProStringList &defs = project->values("DEFINES"); const ProStringList &prl_defs = project->values("PRL_EXPORT_DEFINES"); - foreach (const ProString &def, libinfo.values("QMAKE_PRL_DEFINES")) + for (const ProString &def : libinfo.values("QMAKE_PRL_DEFINES")) if (!defs.contains(def) && prl_defs.contains(def)) defs.append(def); if (try_replace_file) { @@ -939,12 +937,12 @@ void MakefileGenerator::filterIncludedFiles(const char *var) { ProStringList &inputs = project->values(var); - for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ) { - if (QMakeSourceFileInfo::included((*input).toQString()) > 0) - input = inputs.erase(input); - else - ++input; - } + auto isIncluded = [this](const ProString &input) { + return QMakeSourceFileInfo::included(input.toQString()) > 0; + }; + inputs.erase(std::remove_if(inputs.begin(), inputs.end(), + isIncluded), + inputs.end()); } static QString @@ -957,7 +955,7 @@ static QString qv(const ProStringList &val) { QString ret; - foreach (const ProString &v, val) + for (const ProString &v : val) ret += qv(v); return ret; } @@ -1013,6 +1011,7 @@ MakefileGenerator::writeProjectMakefile() QList<SubTarget*> targets; { ProStringList builds = project->values("BUILDS"); + targets.reserve(builds.size()); for (ProStringList::Iterator it = builds.begin(); it != builds.end(); ++it) { SubTarget *st = new SubTarget; targets.append(st); @@ -1132,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; @@ -1144,7 +1143,7 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src) << " " << escapeDependencyPaths(findDependencies(srcf)).join(" \\\n\t\t"); ProKey comp; - foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) { + for (const ProString &compiler : project->values("QMAKE_BUILTIN_COMPILERS")) { // Unfortunately we were not consistent about the C++ naming ProString extensionSuffix = compiler; if (extensionSuffix == "CXX") @@ -1155,7 +1154,7 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src) if (compilerSuffix == "C") compilerSuffix = ProString("CC"); - foreach (const ProString &extension, project->values(ProKey("QMAKE_EXT_" + extensionSuffix))) { + for (const ProString &extension : project->values(ProKey("QMAKE_EXT_" + extensionSuffix))) { if ((*sit).endsWith(extension)) { comp = ProKey("QMAKE_RUN_" + compilerSuffix); break; @@ -1453,7 +1452,9 @@ QString MakefileGenerator::fixFileVarGlue(const ProKey &var, const QString &before, const QString &glue, const QString &after) const { ProStringList varList; - foreach (const ProString &val, project->values(var)) + const auto values = project->values(var); + varList.reserve(values.size()); + for (const ProString &val : values) varList << escapeFilePath(Option::fixPathToTargetOS(val.toQString())); return valGlue(varList, before, glue, after); } @@ -1867,7 +1868,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if (raw_clean.isEmpty()) raw_clean << tmp_out; QString tmp_clean; - foreach (const QString &rc, raw_clean) + for (const QString &rc : qAsConst(raw_clean)) tmp_clean += ' ' + escapeFilePath(Option::fixPathToTargetOS(rc)); QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(' '); if(!tmp_inputs.isEmpty()) @@ -1892,7 +1893,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { QString tinp = (*input).toQString(); QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell); - foreach (const QString &rc, raw_clean) { + for (const QString &rc : qAsConst(raw_clean)) { dels << ' ' + escapeFilePath(Option::fixPathToTargetOS( replaceExtraCompilerVariables(rc, tinp, out, NoShell), false)); } @@ -1902,7 +1903,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } else { QString files; const int commandlineLimit = 2047; // NT limit, expanded - foreach (const QString &file, dels) { + for (const QString &file : qAsConst(dels)) { if(del_statement.length() + files.length() + qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) { cleans.append(files); @@ -2248,7 +2249,7 @@ QString MakefileGenerator::buildArgs() { QString ret; - foreach (const QString &arg, Option::globals->qmake_args) + for (const QString &arg : qAsConst(Option::globals->qmake_args)) ret += " " + shellQuote(arg); return ret; } @@ -2282,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()); @@ -2772,11 +2773,11 @@ MakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg) ProStringList MakefileGenerator::fixLibFlags(const ProKey &var) { - ProStringList in = project->values(var); + const ProStringList &in = project->values(var); ProStringList ret; ret.reserve(in.length()); - foreach (const ProString &v, in) + for (const ProString &v : in) ret << fixLibFlag(v); return ret; } @@ -2806,7 +2807,9 @@ ProStringList MakefileGenerator::escapeFilePaths(const ProStringList &paths) const { ProStringList ret; - for (int i = 0; i < paths.size(); ++i) + const int size = paths.size(); + ret.reserve(size); + for (int i = 0; i < size; ++i) ret.append(escapeFilePath(paths.at(i))); return ret; } @@ -2821,7 +2824,9 @@ QStringList MakefileGenerator::escapeDependencyPaths(const QStringList &paths) const { QStringList ret; - for(int i = 0; i < paths.size(); ++i) + const int size = paths.size(); + ret.reserve(size); + for (int i = 0; i < size; ++i) ret.append(escapeDependencyPath(paths.at(i))); return ret; } @@ -2830,7 +2835,9 @@ ProStringList MakefileGenerator::escapeDependencyPaths(const ProStringList &paths) const { ProStringList ret; - for (int i = 0; i < paths.size(); ++i) + const int size = paths.size(); + ret.reserve(size); + for (int i = 0; i < size; ++i) ret.append(escapeDependencyPath(paths.at(i).toQString())); return ret; } @@ -3177,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; } @@ -3329,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) @@ -3358,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/makefile.h b/qmake/generators/makefile.h index 19ff5d57a3..41b90eb500 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index 047d17f18a..82110f24cf 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -1,31 +1,27 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/makefiledeps.h b/qmake/generators/makefiledeps.h index 91fdaf0eee..3b0c6ce803 100644 --- a/qmake/generators/makefiledeps.h +++ b/qmake/generators/makefiledeps.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 01e6fa4c6b..b816fc21f8 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/metamakefile.h b/qmake/generators/metamakefile.h index 1457a7aa7b..706bca3363 100644 --- a/qmake/generators/metamakefile.h +++ b/qmake/generators/metamakefile.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp index 7d042ce66c..e45217cb45 100644 --- a/qmake/generators/projectgenerator.cpp +++ b/qmake/generators/projectgenerator.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/projectgenerator.h b/qmake/generators/projectgenerator.h index 0744fa620e..587c415055 100644 --- a/qmake/generators/projectgenerator.h +++ b/qmake/generators/projectgenerator.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 12b9f09edd..f062605dd4 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -65,7 +60,7 @@ UnixMakefileGenerator::init() project->values("VER_PAT").append(l[2]); QString sroot = project->sourceRoot(); - foreach (const ProString &iif, project->values("QMAKE_INTERNAL_INCLUDED_FILES")) { + for (const ProString &iif : project->values("QMAKE_INTERNAL_INCLUDED_FILES")) { if (iif == project->cacheFile()) continue; if (iif.startsWith(sroot) && iif.at(sroot.length()) == QLatin1Char('/')) @@ -161,7 +156,7 @@ UnixMakefileGenerator::init() if (project->isActiveConfig("objective_c")) project->values("QMAKE_BUILTIN_COMPILERS") << "OBJC" << "OBJCXX"; - foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) { + for (const ProString &compiler : project->values("QMAKE_BUILTIN_COMPILERS")) { QString compile_flag = var("QMAKE_COMPILE_FLAG"); if(compile_flag.isEmpty()) compile_flag = "-c"; @@ -178,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) @@ -197,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)); } } @@ -339,7 +334,7 @@ QStringList ? project->first("QMAKE_PCH_OUTPUT_EXT").toQString() : ""; header_prefix += Option::dir_sep + project->first("QMAKE_PRECOMP_PREFIX"); - foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) { + for (const ProString &compiler : project->values("QMAKE_BUILTIN_COMPILERS")) { if (project->isEmpty(ProKey("QMAKE_" + compiler + "FLAGS_PRECOMPILE"))) continue; @@ -352,7 +347,7 @@ QStringList if (extensionSuffix == "CXX") extensionSuffix = ProString("CPP"); - foreach (const ProString &extension, project->values(ProKey("QMAKE_EXT_" + extensionSuffix))) { + for (const ProString &extension : project->values(ProKey("QMAKE_EXT_" + extensionSuffix))) { if (!file.endsWith(extension.toQString())) continue; @@ -381,7 +376,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) { QList<QMakeLocalFileName> libdirs, frameworkdirs; int libidx = 0, fwidx = 0; - foreach (const ProString &dlib, project->values("QMAKE_DEFAULT_LIBDIRS")) + for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS")) libdirs.append(QMakeLocalFileName(dlib.toQString())); frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); @@ -426,7 +421,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) opt = (*++it).toQString(); else opt = opt.mid(10).trimmed(); - foreach (const QMakeLocalFileName &dir, frameworkdirs) { + for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) { QString prl = dir.local() + "/" + opt + ".framework/" + opt + Option::prl_ext; if (processPrlFile(prl)) break; @@ -653,7 +648,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t) uninst.append("-$(DEL_FILE) " + dst_targ); if (bundle == SlicedBundle) { int dstlen = project->first("DESTDIR").length(); - foreach (const ProString &src, project->values("QMAKE_BUNDLED_FILES")) { + for (const ProString &src : project->values("QMAKE_BUNDLED_FILES")) { ProString file = src.mid(dstlen); QString dst = escapeFilePath( filePrefixRoot(root, fileFixify(targetdir + file, FileFixifyAbsolute))); diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h index 17270ffce9..da5cdb320c 100644 --- a/qmake/generators/unix/unixmake.h +++ b/qmake/generators/unix/unixmake.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 9db64bebee..9312f19418 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1,31 +1,27 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -536,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)"; @@ -704,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"; @@ -820,7 +816,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) QString icon = fileFixify(var("ICON")); t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed "; - foreach (const ProString &arg, commonSedArgs) + for (const ProString &arg : qAsConst(commonSedArgs)) t << arg; t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " << "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" " @@ -844,7 +840,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) symlinks[bundle_dir + "Resources"] = "Versions/Current/Resources"; t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed "; - foreach (const ProString &arg, commonSedArgs) + for (const ProString &arg : qAsConst(commonSedArgs)) t << arg; t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " << "-e \"s,@TYPEINFO@," @@ -992,7 +988,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) ProString header_suffix = project->isActiveConfig("clang_pch_style") ? project->first("QMAKE_PCH_OUTPUT_EXT") : ""; - foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) { + for (const ProString &compiler : project->values("QMAKE_BUILTIN_COMPILERS")) { if (project->isEmpty(ProKey("QMAKE_" + compiler + "FLAGS_PRECOMPILE"))) continue; ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler)); @@ -1054,7 +1050,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) { QString pchInput = project->first("PRECOMPILED_HEADER").toQString(); t << "###### Precompiled headers\n"; - foreach (const ProString &compiler, project->values("QMAKE_BUILTIN_COMPILERS")) { + for (const ProString &compiler : project->values("QMAKE_BUILTIN_COMPILERS")) { QString pchFlags = var(ProKey("QMAKE_" + compiler + "FLAGS_PRECOMPILE")); if(pchFlags.isEmpty()) continue; @@ -1083,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"); @@ -1103,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") @@ -1151,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 4550cc8aed..f45cbf74a9 100644 --- a/qmake/generators/win32/cesdkhandler.cpp +++ b/qmake/generators/win32/cesdkhandler.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the tools applications of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -147,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); @@ -178,7 +173,7 @@ QStringList CeSdkHandler::getMsBuildToolPaths() const QStringList CeSdkHandler::filterMsBuildToolPaths(const QStringList &paths) const { QStringList result; - foreach (const QString &path, paths) { + for (const QString &path : paths) { QDir dirVC110(path); if (path.endsWith(QLatin1String("bin"))) dirVC110.cdUp(); @@ -196,9 +191,9 @@ bool CeSdkHandler::retrieveEnvironment(const QStringList &relativePaths, CeSdkInfo *info) { bool result = false; - foreach (const QString &path, toolPaths) { + for (const QString &path : toolPaths) { const QDir dir(path); - foreach (const QString &filePath, relativePaths) { + for (const QString &filePath : relativePaths) { QFile file(dir.absoluteFilePath(filePath)); if (file.exists()) result = parseMsBuildFile(&file, info) || result; @@ -214,7 +209,7 @@ void CeSdkHandler::retrieveWEC2013SDKs() const QStringList filteredToolPaths = filterMsBuildToolPaths(toolPaths); QSettings settings("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows CE Tools\\SDKs", QSettings::NativeFormat); const QStringList keys = settings.allKeys(); - foreach (const QString &key, keys) { + for (const QString &key : keys) { if (key.contains(QLatin1String("SDKInformation")) || key.contains(QLatin1Char('.'))) { QFile sdkPropertyFile(settings.value(key).toString()); if (!sdkPropertyFile.exists()) diff --git a/qmake/generators/win32/cesdkhandler.h b/qmake/generators/win32/cesdkhandler.h index b90c3c6dce..3bb8d2adcb 100644 --- a/qmake/generators/win32/cesdkhandler.h +++ b/qmake/generators/win32/cesdkhandler.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the tools applications of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 1837c6c0cf..382b10c37b 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -51,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/mingw_make.h b/qmake/generators/win32/mingw_make.h index 1525f04955..ab9e5a9961 100644 --- a/qmake/generators/win32/mingw_make.h +++ b/qmake/generators/win32/mingw_make.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index bcfab80ccf..4539058cbf 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -328,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; } @@ -861,7 +856,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool) << tag("AppxManifest") << attrTag("Include", manifest) << closetag(); - foreach (const QString &icon, icons) { + for (const QString &icon : qAsConst(icons)) { xml << tag("Image") << attrTag("Include", icon) << closetag(); diff --git a/qmake/generators/win32/msbuild_objectmodel.h b/qmake/generators/win32/msbuild_objectmodel.h index 1b7ce2d716..d594fbaca8 100644 --- a/qmake/generators/win32/msbuild_objectmodel.h +++ b/qmake/generators/win32/msbuild_objectmodel.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 27427db68b..25a2765a01 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -49,11 +44,12 @@ QT_BEGIN_NAMESPACE static QString nmakePathList(const QStringList &list) { QStringList pathList; - foreach (const QString &path, list) + pathList.reserve(list.size()); + for (const QString &path : 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) @@ -84,7 +80,7 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) + " (" + variables["CE_ARCH"].join(' ') + ")"; const QList<CeSdkInfo> sdkList = sdkhandler.listAll(); CeSdkInfo sdk; - foreach (const CeSdkInfo &info, sdkList) { + for (const CeSdkInfo &info : sdkList) { if (info.name().compare(sdkName, Qt::CaseInsensitive ) == 0) { sdk = info; break; @@ -96,7 +92,8 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) t << "\nPATH = " << sdk.binPath() << "\n"; } else { QStringList sdkStringList; - foreach (const CeSdkInfo &info, sdkList) + sdkStringList.reserve(sdkList.size()); + for (const CeSdkInfo &info : sdkList) sdkStringList << info.name(); fprintf(stderr, "Failed to find Windows CE SDK matching %s, found: %s\n" @@ -330,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. @@ -432,9 +429,9 @@ QStringList NmakeMakefileGenerator::sourceFilesForImplicitRulesFilter() { QStringList filter; const QChar wildcard = QLatin1Char('*'); - foreach (const QString &ext, Option::c_ext) + for (const QString &ext : qAsConst(Option::c_ext)) filter << wildcard + ext; - foreach (const QString &ext, Option::cpp_ext) + for (const QString &ext : qAsConst(Option::cpp_ext)) filter << wildcard + ext; return filter; } @@ -482,7 +479,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) const QStringList sourceFilesFilter = sourceFilesForImplicitRulesFilter(); QStringList fixifiedSourceDirs = fileFixify(source_directories.toList(), FileFixifyAbsolute); fixifiedSourceDirs.removeDuplicates(); - foreach (const QString &sourceDir, fixifiedSourceDirs) { + for (const QString &sourceDir : qAsConst(fixifiedSourceDirs)) { QDirIterator dit(sourceDir, sourceFilesFilter, QDir::Files | QDir::NoDotAndDotDot); while (dit.hasNext()) { dit.next(); @@ -507,7 +504,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) project->variables().remove("QMAKE_RUN_CXX"); project->variables().remove("QMAKE_RUN_CC"); - foreach (const QString &sourceDir, source_directories) { + for (const QString &sourceDir : qAsConst(source_directories)) { if (sourceDir.isEmpty()) continue; QString objDir = var("OBJECTS_DIR"); diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h index df72ef394c..9c88934e36 100644 --- a/qmake/generators/win32/msvc_nmake.h +++ b/qmake/generators/win32/msvc_nmake.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index f26dbbc40b..5e655464b7 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -1763,10 +1758,6 @@ VCManifestTool::VCManifestTool() { } -VCManifestTool::~VCManifestTool() -{ -} - bool VCManifestTool::parseOption(const char *option) { Q_UNUSED(option); @@ -2229,7 +2220,7 @@ void VCFilter::modifyPCHstage(QString str) lines << "* WARNING: All changes made in this file will be lost."; lines << "--------------------------------------------------------------------*/"; lines << "#include \"" + Project->precompHFilename + "\""; - foreach(QString line, lines) + for (const QString &line : qAsConst(lines)) CustomBuildTool.CommandLine += "echo " + line + ">>" + toFile; } return; @@ -2420,9 +2411,8 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info) // Ensure that none of the output files are also dependencies. Or else, the custom buildstep // will be rebuild every time, even if nothing has changed. - foreach(QString output, CustomBuildTool.Outputs) { + for (const QString &output : qAsConst(CustomBuildTool.Outputs)) CustomBuildTool.AdditionalDependencies.removeAll(output); - } useCustomBuildTool = !CustomBuildTool.CommandLine.isEmpty(); return useCustomBuildTool; diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 7092da3e59..dfbfaacfa8 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -482,7 +477,7 @@ class VCCLCompilerTool : public VCToolBase public: // Functions VCCLCompilerTool(); - virtual ~VCCLCompilerTool(){} + bool parseOption(const char* option); // Variables @@ -579,7 +574,7 @@ class VCLinkerTool : public VCToolBase public: // Functions VCLinkerTool(); - virtual ~VCLinkerTool(){} + bool parseOption(const char* option); // Variables @@ -673,7 +668,7 @@ class VCManifestTool : public VCToolBase { public: VCManifestTool(); - ~VCManifestTool(); + bool parseOption(const char* option); triState EmbedManifest; @@ -684,7 +679,7 @@ class VCMIDLTool : public VCToolBase public: // Functions VCMIDLTool(); - virtual ~VCMIDLTool(){} + bool parseOption(const char* option); // Variables @@ -738,7 +733,7 @@ class VCLibrarianTool : public VCToolBase public: // Functions VCLibrarianTool(); - virtual ~VCLibrarianTool(){} + bool parseOption(const char*){ return false; } // Variables @@ -759,7 +754,7 @@ class VCCustomBuildTool : public VCToolBase public: // Functions VCCustomBuildTool(); - virtual ~VCCustomBuildTool(){} + bool parseOption(const char*){ return false; } // Variables @@ -778,7 +773,7 @@ class VCResourceCompilerTool : public VCToolBase public: // Functions VCResourceCompilerTool(); - virtual ~VCResourceCompilerTool(){} + bool parseOption(const char*){ return false; } // Variables @@ -799,7 +794,6 @@ class VCDeploymentTool public: // Functions VCDeploymentTool(); - virtual ~VCDeploymentTool() {} // Variables QString DeploymentTag; @@ -813,7 +807,7 @@ class VCEventTool : public VCToolBase protected: // Functions VCEventTool(const QString &eventName); - virtual ~VCEventTool(){} + bool parseOption(const char*){ return false; } public: @@ -830,28 +824,24 @@ class VCPostBuildEventTool : public VCEventTool { public: VCPostBuildEventTool(); - ~VCPostBuildEventTool(){} }; class VCPreBuildEventTool : public VCEventTool { public: VCPreBuildEventTool(); - ~VCPreBuildEventTool(){} }; class VCPreLinkEventTool : public VCEventTool { public: VCPreLinkEventTool(); - ~VCPreLinkEventTool(){} }; class VCWinDeployQtTool : public VCToolBase { public: VCWinDeployQtTool() {} - ~VCWinDeployQtTool() {} protected: bool parseOption(const char *) { return false; } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index a1a8407a11..1b3b328243 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -129,7 +124,7 @@ DotNET which_dotnet_version(const QByteArray &preferredVersion = QByteArray()) // More than one version installed, search directory path QString paths = qgetenv("PATH"); const QStringList pathlist = paths.split(QLatin1Char(';')); - foreach (const QString &path, pathlist) { + for (const QString &path : pathlist) { for (i = 0; dotNetCombo[i].version; ++i) { const QString productPath = installPaths.value(dotNetCombo[i].version); if (productPath.isEmpty()) @@ -414,7 +409,7 @@ bool VcprojGenerator::isStandardSuffix(const QString &suffix) const ProString VcprojGenerator::firstInputFileName(const ProString &extraCompilerName) const { - foreach (const ProString &var, project->values(ProKey(extraCompilerName + ".input"))) { + for (const ProString &var : project->values(ProKey(extraCompilerName + ".input"))) { const ProStringList &files = project->values(var.toKey()); if (!files.isEmpty()) return files.first(); @@ -439,10 +434,12 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt QHash<QString, ProStringList> &subdirProjectLookup, const ProStringList &allDependencies) { - QLinkedList<QPair<QString, ProStringList> > collectedSubdirs; + QVector<QPair<QString, ProStringList> > collectedSubdirs; ProStringList tmp_proj_subdirs = proj->values("SUBDIRS"); ProStringList projectsInProject; - for(int x = 0; x < tmp_proj_subdirs.size(); ++x) { + const int numSubdirs = tmp_proj_subdirs.size(); + collectedSubdirs.reserve(numSubdirs); + for (int x = 0; x < numSubdirs; ++x) { ProString tmpdir = tmp_proj_subdirs.at(x); const ProKey tmpdirConfig(tmpdir + ".CONFIG"); if (!proj->isEmpty(tmpdirConfig)) { @@ -464,9 +461,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt collectedSubdirs.append(qMakePair(tmpdir.toQString(), proj->values(ProKey(tmp_proj_subdirs.at(x) + ".depends")))); projLookup.insert(tmp_proj_subdirs.at(x).toQString(), tmpdir.toQString()); } - QLinkedListIterator<QPair<QString, ProStringList> > collectedIt(collectedSubdirs); - while (collectedIt.hasNext()) { - QPair<QString, ProStringList> subdir = collectedIt.next(); + for (const auto &subdir : qAsConst(collectedSubdirs)) { QString profile = subdir.first; QFileInfo fi(fileInfo(Option::normalizePath(profile))); if (fi.exists()) { @@ -538,13 +533,13 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt if (tmpList.size()) { const ProStringList depends = tmpList; - foreach (const ProString &dep, depends) { + for (const ProString &dep : depends) { QString depend = dep.toQString(); if (!projGuids[depend].isEmpty()) { newDep->dependencies << projGuids[depend]; } else if (subdirProjectLookup[projLookup[depend]].size() > 0) { - ProStringList tmpLst = subdirProjectLookup[projLookup[depend]]; - foreach (const ProString &tDep, tmpLst) { + const ProStringList tmpLst = subdirProjectLookup[projLookup[depend]]; + for (const ProString &tDep : tmpLst) { QString tmpDep = tDep.toQString(); newDep->dependencies << projGuids[projLookup[tmpDep]]; } @@ -690,10 +685,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) t << _slnGlobalBeg; - QHashIterator<VcsolutionDepend *, QStringList> extraIt(extraSubdirs); - while (extraIt.hasNext()) { - extraIt.next(); - foreach (const QString &depend, extraIt.value()) { + for (auto extraIt = extraSubdirs.cbegin(), end = extraSubdirs.cend(); extraIt != end; ++extraIt) { + for (const QString &depend : extraIt.value()) { if (!projGuids[depend].isEmpty()) { extraIt.key()->dependencies << projGuids[depend]; } else if (!profileLookup[depend].isEmpty()) { @@ -704,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; @@ -872,7 +865,7 @@ void VcprojGenerator::init() // Add all input files for a custom compiler into a map for uniqueness, // unless the compiler is configure as a combined stage, then use the first one - foreach (const ProString &quc, project->values("QMAKE_EXTRA_COMPILERS")) { + for (const ProString &quc : project->values("QMAKE_EXTRA_COMPILERS")) { const ProStringList &invar = project->values(ProKey(quc + ".input")); const QString compiler_out = project->first(ProKey(quc + ".output")).toQString(); for (ProStringList::ConstIterator iit = invar.constBegin(); iit != invar.constEnd(); ++iit) { @@ -898,12 +891,10 @@ void VcprojGenerator::init() } #if 0 // Debugging - Q_FOREACH(QString aKey, extraCompilerSources.keys()) { - qDebug("Extracompilers for %s are (%s)", aKey.toLatin1().constData(), extraCompilerSources.value(aKey).join(", ").toLatin1().constData()); - } - Q_FOREACH(QString aKey, extraCompilerOutputs.keys()) { - qDebug("Object mapping for %s is (%s)", aKey.toLatin1().constData(), extraCompilerOutputs.value(aKey).join(", ").toLatin1().constData()); - } + for (auto it = extraCompilerSources.cbegin(), end = extraCompilerSources.cend(); it != end; ++it) + qDebug("Extracompilers for %s are (%s)", it.key().toLatin1().constData(), it.value().join(", ").toLatin1().constData()); + for (auto it = extraCompilerOutputs.cbegin(), end = extraCompilerOutputs.cend(); it != end; ++it) + qDebug("Object mapping for %s is (%s)", it.key().toLatin1().constData(), it.value().join(", ").toLatin1().constData()); qDebug(""); #endif } @@ -1174,7 +1165,8 @@ void VcprojGenerator::initLinkerTool() static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; for (int i = 0; lflags[i]; i++) { - foreach (const ProString &lib, fixLibFlags(lflags[i])) { + const auto libs = fixLibFlags(lflags[i]); + for (const ProString &lib : libs) { if (lib.startsWith("/LIBPATH:")) conf.linker.AdditionalLibraryDirectories << lib.mid(9).toQString(); else @@ -1196,7 +1188,7 @@ void VcprojGenerator::initResourceTool() else conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions; - foreach (const ProString &path, project->values("RC_INCLUDEPATH")) { + for (const ProString &path : project->values("RC_INCLUDEPATH")) { QString fixedPath = fileFixify(path.toQString()); if (fileInfo(fixedPath).isRelative()) { if (fixedPath == QLatin1String(".")) @@ -1270,7 +1262,7 @@ void VcprojGenerator::initDeploymentTool() if (targetPath.endsWith("/") || targetPath.endsWith("\\")) targetPath.chop(1); } - ProStringList dllPaths = project->values("QMAKE_DLL_PATHS"); + const ProStringList dllPaths = project->values("QMAKE_DLL_PATHS"); // Only deploy Qt libs for shared build if (!dllPaths.isEmpty() && !(conf.WinRT && project->first("MSVC_VER").toQString() == "14.0")) { @@ -1288,7 +1280,7 @@ void VcprojGenerator::initDeploymentTool() // Use only the file name and check in Qt's install path and LIBPATHs to check for existence dllName.remove(0, dllName.lastIndexOf(QLatin1Char('/')) + 1); QFileInfo info; - foreach (const ProString &dllPath, dllPaths) { + for (const ProString &dllPath : dllPaths) { QString absoluteDllFilePath = dllPath.toQString(); if (!absoluteDllFilePath.endsWith(QLatin1Char('/'))) absoluteDllFilePath += QLatin1Char('/'); @@ -1351,7 +1343,7 @@ void VcprojGenerator::initDeploymentTool() } } - foreach (const ProString &item, project->values("INSTALLS")) { + for (const ProString &item : project->values("INSTALLS")) { // get item.path QString devicePath = project->first(ProKey(item + ".path")).toQString(); if (!conf.WinRT) { @@ -1366,7 +1358,7 @@ void VcprojGenerator::initDeploymentTool() } } // foreach d in item.files - foreach (const ProString &src, project->values(ProKey(item + ".files"))) { + for (const ProString &src : project->values(ProKey(item + ".files"))) { QString itemDevicePath = devicePath; QString source = Option::normalizePath(src.toQString()); QString nameFilter; @@ -1670,7 +1662,7 @@ void VcprojGenerator::initExtraCompilerOutputs() // provided that the input file variable is not handled already (those in otherFilters // are handled, so we avoid them). const ProStringList &inputVars = project->values(ProKey(*it + ".input")); - foreach (const ProString &inputVar, inputVars) { + for (const ProString &inputVar : inputVars) { if (!otherFilters.contains(inputVar)) { const ProStringList &tmp_in = project->values(inputVar.toKey()); for (int i = 0; i < tmp_in.count(); ++i) { @@ -1706,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/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 50125a30a6..9ccd8c2552 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/win32/msvc_vcxproj.cpp b/qmake/generators/win32/msvc_vcxproj.cpp index 5282989369..ccbbf8cbac 100644 --- a/qmake/generators/win32/msvc_vcxproj.cpp +++ b/qmake/generators/win32/msvc_vcxproj.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/win32/msvc_vcxproj.h b/qmake/generators/win32/msvc_vcxproj.h index 0ffe5f3aff..8f68348693 100644 --- a/qmake/generators/win32/msvc_vcxproj.h +++ b/qmake/generators/win32/msvc_vcxproj.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index a042cb0d4b..0846cb2d8f 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -268,7 +263,9 @@ void Win32MakefileGenerator::processRcFileVar() QString versionString = vers.join('.'); QStringList rcIcons; - foreach (const ProString &icon, project->values("RC_ICONS")) + const auto icons = project->values("RC_ICONS"); + rcIcons.reserve(icons.size()); + for (const ProString &icon : icons) rcIcons.append(fileFixify(icon.toQString(), FileFixifyAbsolute)); QString companyName; @@ -401,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")) @@ -771,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/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h index 54c4d3be53..4d5ee9812b 100644 --- a/qmake/generators/win32/winmakefile.h +++ b/qmake/generators/win32/winmakefile.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp index 4f2e7fee69..e92749a126 100644 --- a/qmake/generators/xmloutput.cpp +++ b/qmake/generators/xmloutput.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -86,6 +81,7 @@ XmlOutput::XMLState XmlOutput::state() void XmlOutput::updateIndent() { currentIndent.clear(); + currentIndent.reserve(currentLevel); for (int i = 0; i < currentLevel; ++i) currentIndent.append(indent); } @@ -140,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; } diff --git a/qmake/generators/xmloutput.h b/qmake/generators/xmloutput.h index 2adb0e2d2e..d16634ee3b 100644 --- a/qmake/generators/xmloutput.h +++ b/qmake/generators/xmloutput.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index a2f3e8ec3d..67d2f541a1 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/library/ioutils.h b/qmake/library/ioutils.h index b726ce3e09..a806f3d2eb 100644 --- a/qmake/library/ioutils.h +++ b/qmake/library/ioutils.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index 5fb70df3b1..5f923744be 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -396,7 +391,7 @@ void ProStringList::removeAll(const char *str) void ProStringList::removeEach(const ProStringList &value) { - foreach (const ProString &str, value) + for (const ProString &str : value) if (!str.isEmpty()) removeAll(str); } @@ -429,7 +424,7 @@ void ProStringList::removeDuplicates() void ProStringList::insertUnique(const ProStringList &value) { - foreach (const ProString &str, value) + for (const ProString &str : value) if (!str.isEmpty() && !contains(str)) append(str); } @@ -437,7 +432,7 @@ void ProStringList::insertUnique(const ProStringList &value) ProStringList::ProStringList(const QStringList &list) { reserve(list.size()); - foreach (const QString &str, list) + for (const QString &str : list) *this << ProString(str); } @@ -445,8 +440,8 @@ QStringList ProStringList::toQStringList() const { QStringList ret; ret.reserve(size()); - for (int i = 0; i < size(); i++) // foreach causes MSVC2010 ICE - ret << at(i).toQString(); + for (const auto &e : *this) + ret.append(e.toQString()); return ret; } diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index e4ef1d1586..721abb90d0 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -369,6 +364,8 @@ class ProFunctionDef { public: ProFunctionDef(ProFile *pro, int offset) : m_pro(pro), m_offset(offset) { m_pro->ref(); } ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); } + ProFunctionDef(ProFunctionDef &&other) Q_DECL_NOTHROW + : m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; } ~ProFunctionDef() { m_pro->deref(); } ProFunctionDef &operator=(const ProFunctionDef &o) { @@ -380,6 +377,18 @@ public: } return *this; } + ProFunctionDef &operator=(ProFunctionDef &&other) Q_DECL_NOTHROW + { + ProFunctionDef moved(std::move(other)); + swap(moved); + return *this; + } + void swap(ProFunctionDef &other) Q_DECL_NOTHROW + { + qSwap(m_pro, other.m_pro); + qSwap(m_offset, other.m_offset); + } + ProFile *pro() const { return m_pro; } const ushort *tokPtr() const { return m_pro->tokPtr() + m_offset; } private: diff --git a/qmake/library/qmake_global.h b/qmake/library/qmake_global.h index 8f2eb5fd33..a718763859 100644 --- a/qmake/library/qmake_global.h +++ b/qmake/library/qmake_global.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 02cd8a2760..78a491b1cb 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -150,6 +145,7 @@ void QMakeEvaluator::initFunctionStatics() { "shell_quote", E_SHELL_QUOTE }, { "getenv", E_GETENV }, }; + statics.expands.reserve((int)(sizeof(expandInits)/sizeof(expandInits[0]))); for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i) statics.expands.insert(ProKey(expandInits[i].name), expandInits[i].func); @@ -191,6 +187,7 @@ void QMakeEvaluator::initFunctionStatics() { "touch", T_TOUCH }, { "cache", T_CACHE }, }; + statics.functions.reserve((int)(sizeof(testInits)/sizeof(testInits[0]))); for (unsigned i = 0; i < sizeof(testInits)/sizeof(testInits[0]); ++i) statics.functions.insert(ProKey(testInits[i].name), testInits[i].func); } @@ -298,19 +295,26 @@ static void insertJsonKeyValue(const QString &key, const QStringList &values, Pr static void addJsonArray(const QJsonArray &array, const QString &keyPrefix, ProValueMap *map) { QStringList keys; - for (int i = 0; i < array.count(); ++i) { - keys.append(QString::number(i)); - addJsonValue(array.at(i), keyPrefix + QString::number(i), map); + const int size = array.count(); + keys.reserve(size); + for (int i = 0; i < size; ++i) { + const QString number = QString::number(i); + keys.append(number); + addJsonValue(array.at(i), keyPrefix + number, map); } insertJsonKeyValue(keyPrefix + QLatin1String("_KEYS_"), keys, map); } static void addJsonObject(const QJsonObject &object, const QString &keyPrefix, ProValueMap *map) { - foreach (const QString &key, object.keys()) - addJsonValue(object.value(key), keyPrefix + key, map); - - insertJsonKeyValue(keyPrefix + QLatin1String("_KEYS_"), object.keys(), map); + QStringList keys; + keys.reserve(object.size()); + for (auto it = object.begin(), end = object.end(); it != end; ++it) { + const QString key = it.key(); + keys.append(key); + addJsonValue(it.value(), keyPrefix + key, map); + } + insertJsonKeyValue(keyPrefix + QLatin1String("_KEYS_"), keys, map); } static void addJsonValue(const QJsonValue &value, const QString &keyPrefix, ProValueMap *map) @@ -433,16 +437,16 @@ void QMakeEvaluator::populateDeps( QHash<ProKey, QSet<ProKey> > &dependencies, ProValueMap &dependees, QMultiMap<int, ProString> &rootSet) const { - foreach (const ProString &item, deps) + for (const ProString &item : deps) if (!dependencies.contains(item.toKey())) { QSet<ProKey> &dset = dependencies[item.toKey()]; // Always create entry ProStringList depends; - foreach (const ProString &suffix, suffixes) + for (const ProString &suffix : suffixes) depends += values(ProKey(prefix + item + suffix)); if (depends.isEmpty()) { rootSet.insert(first(ProKey(prefix + item + priosfx)).toInt(), item); } else { - foreach (const ProString &dep, depends) { + for (const ProString &dep : qAsConst(depends)) { dset.insert(dep.toKey()); dependees[dep.toKey()] << item; } @@ -492,14 +496,15 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( } } if (!var.isEmpty()) { + const auto strings = values(map(var)); if (regexp) { QRegExp sepRx(sep); - foreach (const ProString &str, values(map(var))) { + for (const ProString &str : strings) { const QString &rstr = str.toQString(m_tmp1).section(sepRx, beg, end); ret << (rstr.isSharedWith(m_tmp1) ? str : ProString(rstr).setSource(str)); } } else { - foreach (const ProString &str, values(map(var))) { + for (const ProString &str : strings) { const QString &rstr = str.toQString(m_tmp1).section(sep, beg, end); ret << (rstr.isSharedWith(m_tmp1) ? str : ProString(rstr).setSource(str)); } @@ -528,7 +533,8 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( bool leftalign = false; enum { DefaultSign, PadSign, AlwaysSign } sign = DefaultSign; if (args.count() >= 2) { - foreach (const ProString &opt, split_value_list(args.at(1).toQString(m_tmp2))) { + const auto opts = split_value_list(args.at(1).toQString(m_tmp2)); + for (const ProString &opt : opts) { opt.toQString(m_tmp3); if (m_tmp3.startsWith(QLatin1String("ibase="))) { ibase = m_tmp3.mid(6).toInt(); @@ -602,7 +608,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( const ProStringList &var = values(map(args.at(0))); if (!var.isEmpty()) { const ProFile *src = currentProFile(); - foreach (const ProString &v, var) + for (const ProString &v : var) if (const ProFile *s = v.sourceFile()) { src = s; break; @@ -617,9 +623,12 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( evalError(fL1S("split(var, sep) requires one or two arguments.")); } else { const QString &sep = (args.count() == 2) ? args.at(1).toQString(m_tmp1) : statics.field_sep; - foreach (const ProString &var, values(map(args.at(0)))) - foreach (const QString &splt, var.toQString(m_tmp2).split(sep)) + const auto vars = values(map(args.at(0))); + for (const ProString &var : vars) { + const auto splits = var.toQString(m_tmp2).split(sep); + for (const QString &splt : splits) ret << (splt.isSharedWith(m_tmp2) ? var : ProString(splt).setSource(var)); + } } break; case E_MEMBER: @@ -750,7 +759,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( tmp.sprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++); ret = ProStringList(ProString(tmp)); ProStringList lst; - foreach (const ProString &arg, args) + for (const ProString &arg : args) lst += split_value_list(arg.toQString(m_tmp1), arg.sourceFile()); // Relies on deep copy m_valuemapStack.top()[ret.at(0).toKey()] = lst; break; } @@ -760,7 +769,8 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( } else { QRegExp regx(args.at(1).toQString()); int t = 0; - foreach (const ProString &val, values(map(args.at(0)))) { + const auto vals = values(map(args.at(0))); + for (const ProString &val : vals) { if (regx.indexIn(val.toQString(m_tmp[t])) != -1) ret += val; t ^= 1; @@ -869,7 +879,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( } else { const ProStringList &vals = values(args.at(0).toKey()); ret.reserve(vals.size()); - foreach (const ProString &str, vals) + for (const ProString &str : vals) ret += ProString(quoteValue(str)); } break; @@ -957,7 +967,8 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( } else { const QRegExp before(args.at(1).toQString()); const QString &after(args.at(2).toQString(m_tmp2)); - foreach (const ProString &val, values(map(args.at(0)))) { + const auto vals = values(map(args.at(0))); + for (const ProString &val : vals) { QString rstr = val.toQString(m_tmp1); QString copy = rstr; // Force a detach on modify rstr.replace(before, after); @@ -987,7 +998,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( rootSet.erase(it); if ((func_t == E_RESOLVE_DEPENDS) || orgList.contains(item)) ret.prepend(item); - foreach (const ProString &dep, dependees[item.toKey()]) { + for (const ProString &dep : qAsConst(dependees[item.toKey()])) { QSet<ProKey> &dset = dependencies[dep.toKey()]; dset.remove(item.toKey()); if (dset.isEmpty()) @@ -998,11 +1009,11 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( break; case E_ENUMERATE_VARS: { QSet<ProString> keys; - foreach (const ProValueMap &vmap, m_valuemapStack) + for (const ProValueMap &vmap : qAsConst(m_valuemapStack)) for (ProValueMap::ConstIterator it = vmap.constBegin(); it != vmap.constEnd(); ++it) keys.insert(it.key()); ret.reserve(keys.size()); - foreach (const ProString &key, keys) + for (const ProString &key : qAsConst(keys)) ret << key; break; } case E_SHADOWED: @@ -1186,7 +1197,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( regx.setPattern(copy); } int t = 0; - foreach (const ProString &s, vars.value(map(args.at(1)))) { + const auto strings = vars.value(map(args.at(1))); + for (const ProString &s : strings) { if ((!regx.isEmpty() && regx.exactMatch(s.toQString(m_tmp[t]))) || s == qry) return ReturnTrue; t ^= 1; @@ -1558,7 +1570,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( if (!vals.isEmpty()) contents = vals.join(QLatin1Char('\n')) + QLatin1Char('\n'); if (args.count() >= 3) { - foreach (const ProString &opt, split_value_list(args.at(2).toQString(m_tmp2))) { + const auto opts = split_value_list(args.at(2).toQString(m_tmp2)); + for (const ProString &opt : opts) { opt.toQString(m_tmp3); if (m_tmp3 == QLatin1String("append")) { mode = QIODevice::Append; @@ -1630,7 +1643,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( enum { CacheSet, CacheAdd, CacheSub } mode = CacheSet; ProKey srcvar; if (args.count() >= 2) { - foreach (const ProString &opt, split_value_list(args.at(1).toQString(m_tmp2))) { + const auto opts = split_value_list(args.at(1).toQString(m_tmp2)); + for (const ProString &opt : opts) { opt.toQString(m_tmp3); if (m_tmp3 == QLatin1String("transient")) { persist = false; @@ -1748,7 +1762,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( varstr += QLatin1Char(' '); varstr += quoteValue(diffval.at(0)); } else if (!diffval.isEmpty()) { - foreach (const ProString &vval, diffval) { + for (const ProString &vval : diffval) { varstr += QLatin1String(" \\\n "); varstr += quoteValue(vval); } diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index e9da45c14d..d7fe14c02f 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -191,6 +186,7 @@ void QMakeEvaluator::initStatics() { "IN_PWD", "PWD" }, { "DEPLOYMENT", "INSTALLS" } }; + statics.varMap.reserve((int)(sizeof(mapInits)/sizeof(mapInits[0]))); for (unsigned i = 0; i < sizeof(mapInits)/sizeof(mapInits[0]); ++i) statics.varMap.insert(ProKey(mapInits[i].oldname), ProKey(mapInits[i].newname)); } @@ -760,12 +756,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProLoop( if (ok) { int end = itl.mid(dotdot+2).toInt(&ok); if (ok) { - if (m_cumulative && qAbs(end - start) > 100) { + const int absDiff = qAbs(end - start); + if (m_cumulative && absDiff > 100) { // Such a loop is unlikely to contribute something useful to the // file collection, and may cause considerable delay. traceMsg("skipping excessive loop in cumulative mode"); return ReturnFalse; } + list.reserve(absDiff + 1); if (start < end) { for (int i = start; i <= end; i++) list << ProString(QString::number(i)); @@ -978,7 +976,8 @@ static ProString msvcArchitecture(const QString &vcInstallDir, const QString &pa QString vcBinDir = vcInstallDir; if (vcBinDir.endsWith(QLatin1Char('\\'))) vcBinDir.chop(1); - foreach (const QString &dir, pathVar.split(QLatin1Char(';'))) { + const auto dirs = pathVar.split(QLatin1Char(';')); + for (const QString &dir : dirs) { if (!dir.startsWith(vcBinDir, Qt::CaseInsensitive)) continue; const ProString arch = msvcBinDirToQMakeArch(dir.mid(vcBinDir.length() + 1)); @@ -1000,6 +999,8 @@ void QMakeEvaluator::loadDefaults() vars[ProKey("QMAKE_QMAKE")] << ProString(m_option->qmake_abslocation); if (!m_option->qmake_args.isEmpty()) vars[ProKey("QMAKE_ARGS")] = ProStringList(m_option->qmake_args); + if (!m_option->qtconf.isEmpty()) + vars[ProKey("QMAKE_QTCONF")] = ProString(m_option->qtconf); vars[ProKey("QMAKE_HOST.cpu_count")] = ProString(QString::number(idealThreadCount())); #if defined(Q_OS_WIN32) vars[ProKey("QMAKE_HOST.os")] << ProString("Windows"); @@ -1220,7 +1221,7 @@ bool QMakeEvaluator::loadSpec() qmakespec = m_hostBuild ? QLatin1String("default-host") : QLatin1String("default"); #endif if (IoUtils::isRelativePath(qmakespec)) { - foreach (const QString &root, m_mkspecPaths) { + for (const QString &root : qAsConst(m_mkspecPaths)) { QString mkspec = root + QLatin1Char('/') + qmakespec; if (IoUtils::exists(mkspec)) { qmakespec = mkspec; @@ -1450,10 +1451,11 @@ void QMakeEvaluator::updateMkspecPaths() QStringList ret; const QString concat = QLatin1String("/mkspecs"); - foreach (const QString &it, m_option->getPathListEnv(QLatin1String("QMAKEPATH"))) + const auto paths = m_option->getPathListEnv(QLatin1String("QMAKEPATH")); + for (const QString &it : paths) ret << it + concat; - foreach (const QString &it, m_qmakepath) + for (const QString &it : qAsConst(m_qmakepath)) ret << it + concat; if (!m_buildRoot.isEmpty()) @@ -1475,11 +1477,8 @@ void QMakeEvaluator::updateFeaturePaths() QStringList feature_roots; - foreach (const QString &f, m_option->getPathListEnv(QLatin1String("QMAKEFEATURES"))) - feature_roots += f; - + feature_roots += m_option->getPathListEnv(QLatin1String("QMAKEFEATURES")); feature_roots += m_qmakefeatures; - feature_roots += m_option->splitPathList( m_option->propertyValue(ProKey("QMAKEFEATURES")).toQString(m_mtmp)); @@ -1493,10 +1492,11 @@ void QMakeEvaluator::updateFeaturePaths() feature_bases << m_sourceRoot; } - foreach (const QString &item, m_option->getPathListEnv(QLatin1String("QMAKEPATH"))) + const auto items = m_option->getPathListEnv(QLatin1String("QMAKEPATH")); + for (const QString &item : items) feature_bases << (item + mkspecs_concat); - foreach (const QString &item, m_qmakepath) + for (const QString &item : qAsConst(m_qmakepath)) feature_bases << (item + mkspecs_concat); if (!m_qmakespec.isEmpty()) { @@ -1518,8 +1518,9 @@ void QMakeEvaluator::updateFeaturePaths() feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + mkspecs_concat); feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/src")) + mkspecs_concat); - foreach (const QString &fb, feature_bases) { - foreach (const ProString &sfx, values(ProKey("QMAKE_PLATFORM"))) + for (const QString &fb : qAsConst(feature_bases)) { + const auto sfxs = values(ProKey("QMAKE_PLATFORM")); + for (const ProString &sfx : sfxs) feature_roots << (fb + features_concat + sfx + QLatin1Char('/')); feature_roots << (fb + features_concat); } @@ -1531,7 +1532,7 @@ void QMakeEvaluator::updateFeaturePaths() feature_roots.removeDuplicates(); QStringList ret; - foreach (const QString &root, feature_roots) + for (const QString &root : qAsConst(feature_roots)) if (IoUtils::exists(root)) ret << root; m_featureRoots = new QMakeFeatureRoots(ret); @@ -1592,7 +1593,8 @@ bool QMakeEvaluator::isActiveConfig(const QString &config, bool regex) // CONFIG variable int t = 0; - foreach (const ProString &configValue, values(statics.strCONFIG)) { + const auto configValues = values(statics.strCONFIG); + for (const ProString &configValue : configValues) { if (re.exactMatch(configValue.toQString(m_tmp[t]))) return true; t ^= 1; @@ -1775,7 +1777,7 @@ bool QMakeEvaluator::evaluateConditional(const QString &cond, const QString &whe void QMakeEvaluator::checkRequirements(const ProStringList &deps) { ProStringList &failed = valuesRef(ProKey("QMAKE_FAILED_REQUIREMENTS")); - foreach (const ProString &dep, deps) + for (const ProString &dep : deps) if (!evaluateConditional(dep.toQString(), m_current.pro->fileName(), m_current.line)) failed << dep; } @@ -1872,9 +1874,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFileChecked( { if (fileName.isEmpty()) return ReturnFalse; - QMakeEvaluator *ref = this; + const QMakeEvaluator *ref = this; do { - foreach (const ProFile *pf, ref->m_profileStack) + for (const ProFile *pf : ref->m_profileStack) if (pf->fileName() == fileName) { evalError(fL1S("Circular inclusion of %1.").arg(fileName)); return ReturnFalse; @@ -1975,7 +1977,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFileInto( *values = visitor.m_valuemapStack.top(); ProKey qiif("QMAKE_INTERNAL_INCLUDED_FILES"); ProStringList &iif = m_valuemapStack.first()[qiif]; - foreach (const ProString &ifn, values->value(qiif)) + const auto ifns = values->value(qiif); + for (const ProString &ifn : ifns) if (!iif.contains(ifn)) iif << ifn; return ReturnTrue; @@ -2074,7 +2077,7 @@ QString QMakeEvaluator::formatValueList(const ProStringList &vals, bool commas) { QString ret; - foreach (const ProString &str, vals) { + for (const ProString &str : vals) { if (!ret.isEmpty()) { if (commas) ret += QLatin1Char(','); @@ -2089,7 +2092,7 @@ QString QMakeEvaluator::formatValueListList(const QList<ProStringList> &lists) { QString ret; - foreach (const ProStringList &list, lists) { + for (const ProStringList &list : lists) { if (!ret.isEmpty()) ret += QLatin1String(", "); ret += formatValueList(list); diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h index 9560f71587..5477d82f26 100644 --- a/qmake/library/qmakeevaluator.h +++ b/qmake/library/qmakeevaluator.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/library/qmakeevaluator_p.h b/qmake/library/qmakeevaluator_p.h index e000fc9cf5..f444e0d0be 100644 --- a/qmake/library/qmakeevaluator_p.h +++ b/qmake/library/qmakeevaluator_p.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp index 8bb5199519..6a648e9ecf 100644 --- a/qmake/library/qmakeglobals.cpp +++ b/qmake/library/qmakeglobals.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -109,7 +104,7 @@ QString QMakeGlobals::cleanSpec(QMakeCmdLineParserState &state, const QString &s QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments( QMakeCmdLineParserState &state, QStringList &args, int *pos) { - enum { ArgNone, ArgConfig, ArgSpec, ArgXSpec, ArgTmpl, ArgTmplPfx, ArgCache } argState = ArgNone; + enum { ArgNone, ArgConfig, ArgSpec, ArgXSpec, ArgTmpl, ArgTmplPfx, ArgCache, ArgQtConf } argState = ArgNone; for (; *pos < args.count(); (*pos)++) { QString arg = args.at(*pos); switch (argState) { @@ -134,6 +129,9 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments( case ArgCache: cachefile = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg)); break; + case ArgQtConf: + qtconf = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg)); + break; default: if (arg.startsWith(QLatin1Char('-'))) { if (arg == QLatin1String("-after")) @@ -144,6 +142,8 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments( do_cache = false; else if (arg == QLatin1String("-cache")) argState = ArgCache; + else if (arg == QLatin1String("-qtconf")) + argState = ArgQtConf; else if (arg == QLatin1String("-platform") || arg == QLatin1String("-spec")) argState = ArgSpec; else if (arg == QLatin1String("-xplatform") || arg == QLatin1String("-xspec")) @@ -248,9 +248,9 @@ QStringList QMakeGlobals::splitPathList(const QString &val) const QStringList ret; if (!val.isEmpty()) { QDir bdir; - QStringList vals = val.split(dirlist_sep); + const QStringList vals = val.split(dirlist_sep); ret.reserve(vals.length()); - foreach (const QString &it, vals) + for (const QString &it : vals) ret << QDir::cleanPath(bdir.absoluteFilePath(it)); } return ret; @@ -314,7 +314,8 @@ bool QMakeGlobals::initProperties() QT_PCLOSE(proc); } #endif - foreach (QByteArray line, data.split('\n')) { + const auto lines = data.split('\n'); + for (QByteArray line : lines) { int off = line.indexOf(':'); if (off < 0) // huh? continue; diff --git a/qmake/library/qmakeglobals.h b/qmake/library/qmakeglobals.h index de46ebbe74..79237e6ebe 100644 --- a/qmake/library/qmakeglobals.h +++ b/qmake/library/qmakeglobals.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -112,6 +107,7 @@ public: QString qmake_abslocation; QStringList qmake_args; + QString qtconf; QString qmakespec, xqmakespec; QString user_template, user_template_prefix; QString precmds, postcmds; diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp index 95a072392e..01d9c26e01 100644 --- a/qmake/library/qmakeparser.cpp +++ b/qmake/library/qmakeparser.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -52,7 +47,7 @@ QT_BEGIN_NAMESPACE ProFileCache::~ProFileCache() { - foreach (const Entry &ent, parsed_files) + for (const Entry &ent : qAsConst(parsed_files)) if (ent.pro) ent.pro->deref(); } diff --git a/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h index 7fa4f62a96..f78b3215bb 100644 --- a/qmake/library/qmakeparser.h +++ b/qmake/library/qmakeparser.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/library/qmakevfs.cpp b/qmake/library/qmakevfs.cpp index d23d1f06ff..e6e7e0fbaa 100644 --- a/qmake/library/qmakevfs.cpp +++ b/qmake/library/qmakevfs.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/library/qmakevfs.h b/qmake/library/qmakevfs.h index 1bc11d3593..8677ba08c1 100644 --- a/qmake/library/qmakevfs.h +++ b/qmake/library/qmakevfs.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/main.cpp b/qmake/main.cpp index 5f848d4820..8410e83cbf 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -130,7 +125,7 @@ static int doSed(int argc, char **argv) SedSubst subst; subst.from = QRegExp(phases.at(0), matchcase); subst.to = phases.at(1); - subst.to.replace("\\\\", "\\"); // QString::replace(rx, sub) groks \1, but not \\. + subst.to.replace(QLatin1String("\\\\"), QLatin1String("\\")); // QString::replace(rx, sub) groks \1, but not \\. substs << subst; } } else if (argv[i][0] == '-' && argv[i][1] != 0) { @@ -142,7 +137,7 @@ static int doSed(int argc, char **argv) } if (inFiles.isEmpty()) inFiles << "-"; - foreach (const char *inFile, inFiles) { + for (const char *inFile : qAsConst(inFiles)) { FILE *f; if (!strcmp(inFile, "-")) { f = stdin; diff --git a/qmake/meta.cpp b/qmake/meta.cpp index 719b2c060f..b47645b07f 100644 --- a/qmake/meta.cpp +++ b/qmake/meta.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -165,7 +160,7 @@ QMakeMetaInfo::readLibtoolFile(const QString &f) } } ProStringList &prlLibs = vars["QMAKE_PRL_LIBS"]; - foreach (const ProString &s, lst) { + for (const ProString &s : qAsConst(lst)) { prlLibs.removeAll(s); prlLibs.append(s); } diff --git a/qmake/meta.h b/qmake/meta.h index 7c91ffda44..dd53cdc7a3 100644 --- a/qmake/meta.h +++ b/qmake/meta.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/option.cpp b/qmake/option.cpp index 46bfa33dd3..52bd10bfee 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -172,6 +167,7 @@ bool usage(const char *a0) " -set <prop> <value> Set persistent property\n" " -unset <prop> Unset persistent property\n" " -query <prop> Query persistent property. Show all if <prop> is empty.\n" + " -qtconf file Use file instead of looking for qt.conf\n" " -cache file Use file as cache [makefile mode only]\n" " -spec spec Use spec as QMAKESPEC [makefile mode only]\n" " -nocache Don't use a cache file [makefile mode only]\n" @@ -395,6 +391,7 @@ Option::init(int argc, char **argv) } if(argc && argv) { QStringList args; + args.reserve(argc - 1); for (int i = 1; i < argc; i++) args << QString::fromLocal8Bit(argv[i]); @@ -643,6 +640,8 @@ qmakeAddCacheClear(qmakeCacheClearFunc func, void **data) QString qmake_libraryInfoFile() { + if (!Option::globals->qtconf.isEmpty()) + return Option::globals->qtconf; if (!Option::globals->qmake_abslocation.isEmpty()) return QDir(QFileInfo(Option::globals->qmake_abslocation).absolutePath()).filePath("qt.conf"); return QString(); diff --git a/qmake/option.h b/qmake/option.h index cb3eb1341a..8b9e2f1027 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -158,7 +153,7 @@ struct Option inline static bool hasFileExtension(const QString &str, const QStringList &extensions) { - foreach (const QString &ext, extensions) + for (const QString &ext : extensions) if (str.endsWith(ext)) return true; return false; diff --git a/qmake/project.cpp b/qmake/project.cpp index faea6da650..01adb7422c 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -78,7 +73,7 @@ static ProStringList prepareBuiltinArgs(const QList<ProStringList> &args) { ProStringList ret; ret.reserve(args.size()); - foreach (const ProStringList &arg, args) + for (const ProStringList &arg : args) ret << arg.join(' '); return ret; } @@ -151,13 +146,13 @@ void QMakeProject::dump() const it != m_valuemapStack.first().end(); ++it) { if (!it.key().startsWith('.')) { QString str = it.key() + " ="; - foreach (const ProString &v, it.value()) + for (const ProString &v : it.value()) str += ' ' + formatValue(v); out << str; } } out.sort(); - foreach (const QString &v, out) + for (const QString &v : qAsConst(out)) puts(qPrintable(v)); } diff --git a/qmake/project.h b/qmake/project.h index 7cd49a457c..aa9f7dfb3b 100644 --- a/qmake/project.h +++ b/qmake/project.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/property.cpp b/qmake/property.cpp index 817ae953d5..9ee08f4b55 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** @@ -144,7 +139,8 @@ QMakeProperty::exec() if(Option::qmake_mode == Option::QMAKE_QUERY_PROPERTY) { if(Option::prop::properties.isEmpty()) { initSettings(); - foreach (const QString &key, settings->childKeys()) { + const auto keys = settings->childKeys(); + for (const QString &key : keys) { QString val = settings->value(key).toString(); fprintf(stdout, "%s:%s\n", qPrintable(key), qPrintable(val)); } @@ -155,7 +151,7 @@ QMakeProperty::exec() #ifdef QT_VERSION_STR specialProps.append("QT_VERSION"); #endif - foreach (QString prop, specialProps) { + for (const QString &prop : qAsConst(specialProps)) { ProString val = value(ProKey(prop)); ProString pval = value(ProKey(prop + "/raw")); ProString gval = value(ProKey(prop + "/get")); diff --git a/qmake/property.h b/qmake/property.h index e00804967b..cd04e4bc03 100644 --- a/qmake/property.h +++ b/qmake/property.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/qmake/qmake-aux.pro b/qmake/qmake-aux.pro new file mode 100644 index 0000000000..33a7fbfd2d --- /dev/null +++ b/qmake/qmake-aux.pro @@ -0,0 +1,11 @@ +option(host_build) +TEMPLATE = aux + +# qmake documentation +QMAKE_DOCS = $$PWD/doc/qmake.qdocconf + +# qmake binary +win32: EXTENSION = .exe +qmake.path = $$[QT_HOST_BINS] +qmake.files = $$OUT_PWD/../bin/qmake$$EXTENSION +INSTALLS += qmake diff --git a/qmake/qmake-docs.pro b/qmake/qmake-docs.pro deleted file mode 100644 index 3123f7c5d8..0000000000 --- a/qmake/qmake-docs.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = aux -QMAKE_DOCS = $$PWD/doc/qmake.qdocconf diff --git a/qmake/qmake_pch.h b/qmake/qmake_pch.h index ab40d93682..c0f62b263d 100644 --- a/qmake/qmake_pch.h +++ b/qmake/qmake_pch.h @@ -1,31 +1,26 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the qmake application of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** |