summaryrefslogtreecommitdiffstats
path: root/qmake/generators/projectgenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/projectgenerator.cpp')
-rw-r--r--qmake/generators/projectgenerator.cpp61
1 files changed, 18 insertions, 43 deletions
diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp
index 4e1b32fb69..96d7b26370 100644
--- a/qmake/generators/projectgenerator.cpp
+++ b/qmake/generators/projectgenerator.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** 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: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 https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "projectgenerator.h"
#include "option.h"
@@ -79,7 +54,7 @@ ProjectGenerator::init()
dirs.prepend(qmake_getpwd());
}
- for(int i = 0; i < dirs.count(); ++i) {
+ for(int i = 0; i < dirs.size(); ++i) {
QString dir, regex, pd = dirs.at(i);
bool add_depend = false;
if(exists(pd)) {
@@ -91,7 +66,7 @@ ProjectGenerator::init()
dir += Option::dir_sep;
if (Option::recursive) {
QStringList files = QDir(dir).entryList(QDir::Files);
- for (int i = 0; i < files.count(); i++)
+ for (int i = 0; i < files.size(); i++)
dirs.append(dir + files[i] + QDir::separator() + builtin_regex);
}
regex = builtin_regex;
@@ -112,16 +87,16 @@ ProjectGenerator::init()
int s = regex.lastIndexOf(Option::dir_sep);
if(s != -1) {
dir = regex.left(s+1);
- regex = regex.right(regex.length() - (s+1));
+ regex = regex.right(regex.size() - (s+1));
}
const QDir d(dir);
if (Option::recursive) {
QStringList entries = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
- for (int i = 0; i < entries.count(); i++)
+ for (int i = 0; i < entries.size(); i++)
dirs.append(dir + entries[i] + QDir::separator() + regex);
}
QStringList files = d.entryList(QDir::nameFiltersFromString(regex));
- for(int i = 0; i < (int)files.count(); i++) {
+ for(int i = 0; i < (int)files.size(); i++) {
QString file = d.absoluteFilePath(files[i]);
if (addFile(file)) {
add_depend = true;
@@ -141,7 +116,7 @@ ProjectGenerator::init()
if(Option::projfile::do_pwd)
knownDirs.prepend(".");
const QString out_file = fileFixify(Option::output.fileName());
- for(int i = 0; i < knownDirs.count(); ++i) {
+ for(int i = 0; i < knownDirs.size(); ++i) {
QString pd = knownDirs.at(i);
if(exists(pd)) {
QString newdir = pd;
@@ -154,7 +129,7 @@ ProjectGenerator::init()
subdirs.append(newdir);
} else {
QStringList profiles = QDir(newdir).entryList(QStringList("*" + Option::pro_ext), QDir::Files);
- for(int i = 0; i < (int)profiles.count(); i++) {
+ for(int i = 0; i < (int)profiles.size(); i++) {
QString nd = newdir;
if(nd == ".")
nd = "";
@@ -168,7 +143,7 @@ ProjectGenerator::init()
}
if (Option::recursive) {
QStringList dirs = QDir(newdir).entryList(QDir::Dirs | QDir::NoDotAndDotDot);
- for(int i = 0; i < (int)dirs.count(); i++) {
+ for(int i = 0; i < (int)dirs.size(); i++) {
QString nd = fileFixify(newdir + QDir::separator() + dirs[i]);
if (!knownDirs.contains(nd, Qt::CaseInsensitive))
knownDirs.append(nd);
@@ -180,12 +155,12 @@ ProjectGenerator::init()
int s = regx.lastIndexOf(Option::dir_sep);
if(s != -1) {
dir = regx.left(s+1);
- regx = regx.right(regx.length() - (s+1));
+ regx = regx.right(regx.size() - (s+1));
}
QStringList files = QDir(dir).entryList(QDir::nameFiltersFromString(regx),
QDir::Dirs | QDir::NoDotAndDotDot);
ProStringList &subdirs = v["SUBDIRS"];
- for(int i = 0; i < (int)files.count(); i++) {
+ for(int i = 0; i < (int)files.size(); i++) {
QString newdir(dir + files[i]);
QFileInfo fi(fileInfo(newdir));
{
@@ -195,7 +170,7 @@ ProjectGenerator::init()
subdirs.append(newdir);
} else {
QStringList profiles = QDir(newdir).entryList(QStringList("*" + Option::pro_ext), QDir::Files);
- for(int i = 0; i < (int)profiles.count(); i++) {
+ for(int i = 0; i < (int)profiles.size(); i++) {
QString nd = newdir + QDir::separator() + files[i];
fileFixify(nd);
if(files[i] != "." && files[i] != ".." && !subdirs.contains(nd, Qt::CaseInsensitive)) {
@@ -256,7 +231,7 @@ ProjectGenerator::init()
}
if(!h_ext.isEmpty()) {
for(int cppit = 0; cppit < Option::cpp_ext.size(); ++cppit) {
- QString src(dep.left(dep.length() - h_ext.length()) +
+ QString src(dep.left(dep.size() - h_ext.size()) +
Option::cpp_ext.at(cppit));
if(exists(src)) {
ProStringList &srcl = v["SOURCES"];
@@ -346,7 +321,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
"# Please consult the documentation of the deprecated API in order to know\n"
"# how to port your code away from it.\n"
"# You can also select to disable deprecated APIs only up to a certain version of Qt.\n"
- "#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0\n\n";
+ "#DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x060000 # disables all APIs deprecated in Qt 6.0.0 and earlier\n\n";
t << "# Input" << "\n";
t << getWritableVar("HEADERS")
@@ -383,7 +358,7 @@ ProjectGenerator::addFile(QString file)
int s = file.lastIndexOf(Option::dir_sep);
if(s != -1)
dir = file.left(s+1);
- if(file.mid(dir.length(), Option::h_moc_mod.length()) == Option::h_moc_mod)
+ if(file.mid(dir.size(), Option::h_moc_mod.size()) == Option::h_moc_mod)
return false;
ProKey where;
@@ -453,9 +428,9 @@ ProjectGenerator::getWritableVar(const char *vk, bool)
else
ret = v + " += ";
QString join = vals.join(' ');
- if(ret.length() + join.length() > 80) {
+ if(ret.size() + join.size() > 80) {
QString spaces;
- for(int i = 0; i < ret.length(); i++)
+ for(int i = 0; i < ret.size(); i++)
spaces += " ";
join = vals.join(" \\\n" + spaces);
}