summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-09-30 14:09:04 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-04 07:40:08 +0200
commitdf9d882d41b741fef7c5beeddb0abe9d904443d8 (patch)
tree6f3e90dacad4581b7f1cabe235cca298833a3da4 /qmake/generators
parent109e088c7c5d0c9325966e88d55fd9f7a58f67ea (diff)
Port from container.count()/length() to size()
This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp10
-rw-r--r--qmake/generators/makefile.cpp54
-rw-r--r--qmake/generators/makefiledeps.cpp2
-rw-r--r--qmake/generators/metamakefile.cpp16
-rw-r--r--qmake/generators/projectgenerator.cpp12
-rw-r--r--qmake/generators/unix/unixmake.cpp8
-rw-r--r--qmake/generators/unix/unixmake2.cpp20
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp24
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp2
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp18
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp10
-rw-r--r--qmake/generators/win32/winmakefile.cpp10
-rw-r--r--qmake/generators/xmloutput.cpp12
13 files changed, 99 insertions, 99 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index efc7528c56..53f1c4f793 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -524,14 +524,14 @@ bool ProjectBuilderMakefileGenerator::replaceLibrarySuffix(const QString &lib_fi
warn_msg(WarnLogic, "Failed to find expected suffix '%s' for library '%s'.",
qPrintable(librarySuffix), qPrintable(library));
} else {
- library.replace(pos, librarySuffix.length(), suffixSetting);
+ library.replace(pos, librarySuffix.size(), suffixSetting);
if (name.endsWith(librarySuffix))
- name.chop(librarySuffix.length());
+ name.chop(librarySuffix.size());
}
} else {
int pos = library.lastIndexOf(name);
if (pos != -1)
- library.insert(pos + name.length(), suffixSetting);
+ library.insert(pos + name.size(), suffixSetting);
}
}
}
@@ -955,7 +955,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
const int slsh = library.lastIndexOf(Option::dir_sep);
if(name.isEmpty()) {
if(slsh != -1)
- name = library.right(library.length() - slsh - 1);
+ name = library.right(library.size() - slsh - 1);
}
if(slsh != -1) {
const QString path = QFileInfo(library.left(slsh)).absoluteFilePath();
@@ -1970,7 +1970,7 @@ ProjectBuilderMakefileGenerator::pbxbuild()
static QString quotedStringLiteral(const QString &value)
{
QString result;
- const int len = value.length();
+ const int len = value.size();
result.reserve(int(len * 1.1) + 2);
result += QLatin1Char('"');
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 06ca1807a7..e94d088a3f 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -113,7 +113,7 @@ MakefileGenerator::initOutPaths()
if(!fi.makeAbsolute()) {
QString cache_r = fi.path(), pwd = Option::output_dir;
if(pwd.startsWith(cache_r) && !pwd.startsWith(root)) {
- pwd = root + pwd.mid(cache_r.length());
+ pwd = root + pwd.mid(cache_r.size());
if(exists(pwd))
v.insert("QMAKE_ABSOLUTE_SOURCE_PATH", ProStringList(pwd));
}
@@ -288,7 +288,7 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
real_dir = dir;
if(!(flags & VPATH_NoFixify))
real_dir = fileFixify(real_dir, FileFixifyBackwards) + '/';
- regex.remove(0, dir.length());
+ regex.remove(0, dir.size());
}
if(real_dir.isEmpty() || exists(real_dir)) {
QStringList files = QDir(real_dir).entryList(QStringList(regex),
@@ -491,7 +491,7 @@ MakefileGenerator::init()
inn.toLatin1().constData());
continue;
}
- outn = fileFixify(inn.left(inn.length() - 3), FileFixifyBackwards);
+ outn = fileFixify(inn.left(inn.size() - 3), FileFixifyBackwards);
}
const ProKey confign(sub + ".CONFIG");
@@ -512,7 +512,7 @@ MakefileGenerator::init()
QString line = QString::fromLatin1(in.readLine());
if (line.startsWith("!!IF ")) {
if (state.isEmpty() || state.top() == IN_CONDITION) {
- QString test = line.mid(5, line.length()-(5+1));
+ QString test = line.mid(5, line.size()-(5+1));
if (project->test(test, inn, count))
state.push(IN_CONDITION);
else
@@ -525,7 +525,7 @@ MakefileGenerator::init()
warn_msg(WarnLogic, "(%s:%d): Unexpected else condition",
in.fileName().toLatin1().constData(), count);
} else if (state.top() == PENDING_CONDITION) {
- QString test = line.mid(7, line.length()-(7+1));
+ QString test = line.mid(7, line.size()-(7+1));
if (project->test(test, inn, count)) {
state.pop();
state.push(IN_CONDITION);
@@ -634,7 +634,7 @@ MakefileGenerator::init()
}
{ //do the path fixifying
ProStringList paths;
- for(x = 0; x < compilers.count(); ++x) {
+ for(x = 0; x < compilers.size(); ++x) {
if(!paths.contains(compilers.at(x).variable_in))
paths << compilers.at(x).variable_in;
}
@@ -653,7 +653,7 @@ MakefileGenerator::init()
if(noIO() || !doDepends() || project->isActiveConfig("GNUmake"))
QMakeSourceFileInfo::setDependencyMode(QMakeSourceFileInfo::NonRecursive);
- for(x = 0; x < compilers.count(); ++x)
+ for(x = 0; x < compilers.size(); ++x)
initCompiler(compilers.at(x));
//merge actual compiler outputs into their variable_out. This is done last so that
@@ -764,7 +764,7 @@ MakefileGenerator::init()
incDirs.join(QString(" :: ")).toLatin1().constData());
//add to dependency engine
- for(x = 0; x < compilers.count(); ++x) {
+ for(x = 0; x < compilers.size(); ++x) {
const MakefileGenerator::Compiler &comp = compilers.at(x);
if(!(comp.flags & Compiler::CompilerNoCheckDeps)) {
const ProKey ikey(comp.variable_in);
@@ -820,7 +820,7 @@ MakefileGenerator::init()
QString dir, regex = Option::normalizePath(dep);
if (regex.lastIndexOf('/') != -1) {
dir = regex.left(regex.lastIndexOf('/') + 1);
- regex.remove(0, dir.length());
+ regex.remove(0, dir.size());
}
QStringList files = QDir(dir).entryList(QStringList(regex));
if(files.isEmpty()) {
@@ -1173,7 +1173,7 @@ QString
MakefileGenerator::filePrefixRoot(const QString &root, const QString &path)
{
QString ret(path);
- if(path.length() > 2 && path[1] == ':') //c:\foo
+ if(path.size() > 2 && path[1] == ':') //c:\foo
ret.insert(2, root);
else
ret.prepend(root);
@@ -1249,14 +1249,14 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
qPrintable(wild), qPrintable((*it).toQString()),
qPrintable(base_path));
} else {
- QString dir_sfx = dirstr.mid(base_path.length());
+ QString dir_sfx = dirstr.mid(base_path.size());
dst_dir += dir_sfx;
if (!dir_sfx.isEmpty() && !made_dirs.contains(dir_sfx)) {
made_dirs.insert(dir_sfx);
QString tmp_dst = fileFixify(dst_dir, FileFixifyAbsolute, false);
tmp_dst.chop(1);
inst << mkdir_p_asstring(filePrefixRoot(root, tmp_dst));
- for (int i = dst.length(); i < dst_dir.length(); i++) {
+ for (int i = dst.size(); i < dst_dir.size(); i++) {
if (dst_dir.at(i) == Option::dir_sep) {
QString subd = dst_dir.left(i);
if (!removed_dirs.contains(subd)) {
@@ -1616,7 +1616,7 @@ MakefileGenerator::replaceExtraCompilerVariables(
QFileInfo fi(fileInfo(Option::normalizePath(in.at(i))));
QString ext;
// Ensure complementarity with QMAKE_FILE_BASE
- int baseLen = fi.completeBaseName().length();
+ int baseLen = fi.completeBaseName().size();
if(baseLen == 0)
ext = fi.fileName();
else
@@ -1682,7 +1682,7 @@ MakefileGenerator::replaceExtraCompilerVariables(
fullVal = val.join(' ');
}
ret.replace(match.capturedStart(), match.capturedLength(), fullVal);
- rep += fullVal.length();
+ rep += fullVal.size();
} else {
rep = match.capturedEnd();
}
@@ -1998,8 +1998,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString files;
const int commandlineLimit = 2047; // NT limit, expanded
for (const QString &file : qAsConst(dels)) {
- if(del_statement.length() + files.length() +
- qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
+ if(del_statement.size() + files.size() +
+ qMax(fixEnvVariables(file).size(), file.size()) > commandlineLimit) {
cleans.append(files);
files.clear();
}
@@ -2382,7 +2382,7 @@ MakefileGenerator::findSubDirsSubTargets() const
if(new_slsh != -1)
basename = basename.mid(new_slsh+1);
if(st->profile != basename + Option::pro_ext)
- st->makefile += "." + st->profile.left(st->profile.length() - Option::pro_ext.length());
+ st->makefile += "." + st->profile.left(st->profile.size() - Option::pro_ext.size());
}
}
const ProKey dkey(fixedSubdir + ".depends");
@@ -2521,7 +2521,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(!out_directory.isEmpty() && !out_directory.endsWith(Option::dir_sep))
out_directory += Option::dir_sep;
if(!abs_source_path.isEmpty() && out_directory.startsWith(abs_source_path))
- out_directory = Option::output_dir + out_directory.mid(abs_source_path.length());
+ out_directory = Option::output_dir + out_directory.mid(abs_source_path.size());
QString out_directory_cdin = out_directory.isEmpty() ? QString("\n\t")
: "\n\tcd " + escapeFilePath(out_directory) + " && ";
@@ -2534,7 +2534,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
out = subtarget->makefile;
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
if(out.startsWith(in_directory))
- out = out.mid(in_directory.length());
+ out = out.mid(in_directory.size());
out = escapeFilePath(out);
t << subtarget->target << "-qmake_all: ";
if (flags & SubTargetOrdered) {
@@ -2699,7 +2699,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(!out_directory.isEmpty() && !out_directory.endsWith(Option::dir_sep))
out_directory += Option::dir_sep;
if(!abs_source_path.isEmpty() && out_directory.startsWith(abs_source_path))
- out_directory = Option::output_dir + out_directory.mid(abs_source_path.length());
+ out_directory = Option::output_dir + out_directory.mid(abs_source_path.size());
if(!recurse.contains(subtarget->name))
continue;
@@ -2714,7 +2714,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
out = subtarget->makefile;
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
if (out.startsWith(in_directory))
- out = out.mid(in_directory.length());
+ out = out.mid(in_directory.size());
out = escapeFilePath(out);
}
@@ -3016,7 +3016,7 @@ MakefileGenerator::fileFixify(const QString &file, FileFixifyTypes fix, bool can
if(ret == match_dir) {
ret = "";
} else if(ret.startsWith(match_dir + Option::dir_sep)) {
- ret = ret.mid(match_dir.length() + Option::dir_sep.length());
+ ret = ret.mid(match_dir.size() + Option::dir_sep.size());
} else {
//figure out the depth
int depth = 4;
@@ -3038,7 +3038,7 @@ MakefileGenerator::fileFixify(const QString &file, FileFixifyTypes fix, bool can
break;
if(ret.startsWith(match_dir + Option::dir_sep)) {
//concat
- int remlen = ret.length() - (match_dir.length() + 1);
+ int remlen = ret.size() - (match_dir.size() + 1);
if(remlen < 0)
remlen = 0;
ret = ret.right(remlen);
@@ -3112,12 +3112,12 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
depdirs.prepend(fileInfo(file.real()).absoluteDir().path());
QString pwd = qmake_getpwd();
- if(pwd.at(pwd.length()-1) != '/')
+ if(pwd.at(pwd.size()-1) != '/')
pwd += '/';
- for(int i = 0; i < depdirs.count(); i++) {
+ for(int i = 0; i < depdirs.size(); i++) {
QString dir = depdirs.at(i).real();
if(!QDir::isRelativePath(dir) && dir.startsWith(pwd))
- dir = dir.mid(pwd.length());
+ dir = dir.mid(pwd.size());
if(QDir::isRelativePath(dir)) {
if(!dir.endsWith(Option::dir_sep))
dir += Option::dir_sep;
@@ -3233,7 +3233,7 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
ret = project->first("TARGET").toQString();
int slsh = ret.lastIndexOf(Option::dir_sep);
if (slsh != -1)
- ret = ret.right(ret.length() - slsh - 1);
+ ret = ret.right(ret.size() - slsh - 1);
if (ret.startsWith("lib"))
ret = ret.mid(3);
int dot = ret.indexOf('.');
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index c8f4772dcb..1f3fe93141 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -164,7 +164,7 @@ void QMakeSourceFileInfo::setDependencyPaths(const QList<QMakeLocalFileName> &l)
{
// Ensure that depdirs does not contain the same paths several times, to minimize the stats
QList<QMakeLocalFileName> ll;
- for (int i = 0; i < l.count(); ++i) {
+ for (int i = 0; i < l.size(); ++i) {
if (!ll.contains(l.at(i)))
ll.append(l.at(i));
}
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 9616e560b5..febb993ddd 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -52,7 +52,7 @@ public:
void
BuildsMetaMakefileGenerator::clearBuilds()
{
- for(int i = 0; i < makefiles.count(); i++) {
+ for(int i = 0; i < makefiles.size(); i++) {
Build *build = makefiles[i];
if(QMakeProject *p = build->makefile->projectFile()) {
if(p != project)
@@ -126,7 +126,7 @@ BuildsMetaMakefileGenerator::write()
bool ret = true;
const QString &output_name = Option::output.fileName();
- for(int i = 0; ret && i < makefiles.count(); i++) {
+ for(int i = 0; ret && i < makefiles.size(); i++) {
Option::output.setFileName(output_name);
Build *build = makefiles[i];
@@ -223,7 +223,7 @@ void BuildsMetaMakefileGenerator::accumulateVariableFromBuilds(const ProKey &nam
void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
{
- if (makefiles.count() < 3) {
+ if (makefiles.size() < 3) {
// Checking for conflicts only makes sense if we have more than one BUILD,
// and the last entry in makefiles is the "glue" Build.
return;
@@ -234,7 +234,7 @@ void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
}
using TargetInfo = std::pair<Build *, ProString>;
QList<TargetInfo> targets;
- const int last = makefiles.count() - 1;
+ const int last = makefiles.size() - 1;
targets.resize(last);
for (int i = 0; i < last; ++i) {
Build *b = makefiles.at(i);
@@ -324,7 +324,7 @@ SubdirsMetaMakefileGenerator::init()
if(!subdir.isRelative()) { //we can try to make it relative
QString subdir_path = subdir.filePath();
if(subdir_path.startsWith(thispwd))
- subdir = QFileInfo(subdir_path.mid(thispwd.length()));
+ subdir = QFileInfo(subdir_path.mid(thispwd.size()));
}
//handle sub project
@@ -391,12 +391,12 @@ SubdirsMetaMakefileGenerator::write()
const QString &pwd = qmake_getpwd();
const QString &output_dir = Option::output_dir;
const QString &output_name = Option::output.fileName();
- for(int i = 0; ret && i < subs.count(); i++) {
+ for(int i = 0; ret && i < subs.size(); i++) {
const Subdir *sub = subs.at(i);
qmake_setpwd(sub->input_dir);
Option::output_dir = QFileInfo(sub->output_dir).absoluteFilePath();
Option::output.setFileName(sub->output_file);
- if(i != subs.count()-1) {
+ if(i != subs.size()-1) {
for (int ind = 0; ind < sub->indent; ++ind)
printf(" ");
printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+
@@ -414,7 +414,7 @@ SubdirsMetaMakefileGenerator::write()
SubdirsMetaMakefileGenerator::~SubdirsMetaMakefileGenerator()
{
- for(int i = 0; i < subs.count(); i++)
+ for(int i = 0; i < subs.size(); i++)
delete subs[i];
subs.clear();
}
diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp
index 8e9e8cd37f..ede5df496f 100644
--- a/qmake/generators/projectgenerator.cpp
+++ b/qmake/generators/projectgenerator.cpp
@@ -87,7 +87,7 @@ 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) {
@@ -155,7 +155,7 @@ 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);
@@ -231,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"];
@@ -358,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;
@@ -428,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);
}
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 54c8d6e6a3..51f6ffe142 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -48,7 +48,7 @@ UnixMakefileGenerator::init()
for (const ProString &iif : project->values("QMAKE_INTERNAL_INCLUDED_FILES")) {
if (iif == project->cacheFile())
continue;
- if (iif.startsWith(sroot) && iif.at(sroot.length()) == QLatin1Char('/'))
+ if (iif.startsWith(sroot) && iif.at(sroot.size()) == QLatin1Char('/'))
project->values("DISTFILES") += fileFixify(iif.toQString(), FileFixifyRelative);
}
@@ -101,7 +101,7 @@ UnixMakefileGenerator::init()
const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
for (int i = 0; i < rpathdirs.size(); ++i) {
QString rpathdir = rpathdirs[i].toQString();
- if (rpathdir.length() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(') {
+ if (rpathdir.size() > 1 && rpathdir.at(0) == '$' && rpathdir.at(1) != '(') {
rpathdir.replace(0, 1, "\\$$"); // Escape from make and the shell
} else if (!rpathdir.startsWith('@') && fileInfo(rpathdir).isRelative()) {
QString rpathbase = project->first("QMAKE_REL_RPATH_BASE").toQString();
@@ -436,7 +436,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
break;
}
} else {
- if (opt.length() == 10)
+ if (opt.size() == 10)
++it;
// Skip
}
@@ -689,7 +689,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
QString link = Option::fixPathToTargetOS(destdir + links[i], false);
int lslash = link.lastIndexOf(Option::dir_sep);
if(lslash != -1)
- link = link.right(link.length() - (lslash + 1));
+ link = link.right(link.size() - (lslash + 1));
QString dst_link = escapeFilePath(
filePrefixRoot(root, fileFixify(targetdir + link, FileFixifyAbsolute)));
ret += "\n\t-$(SYMLINK) $(TARGET) " + dst_link;
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 1b2989b978..0b485ab706 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -105,11 +105,11 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
if (!out_directory.isEmpty() && !out_directory.endsWith(Option::dir_sep))
out_directory += Option::dir_sep;
if (!abs_source_path.isEmpty() && out_directory.startsWith(abs_source_path))
- out_directory = Option::output_dir + out_directory.mid(abs_source_path.length());
+ out_directory = Option::output_dir + out_directory.mid(abs_source_path.size());
QString dist_directory = out_directory;
if (dist_directory.endsWith(Option::dir_sep))
- dist_directory.chop(Option::dir_sep.length());
+ dist_directory.chop(Option::dir_sep.size());
if (!dist_directory.startsWith(Option::dir_sep))
dist_directory.prepend(Option::dir_sep);
@@ -121,7 +121,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
QString out = subtarget->makefile;
QString in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
if (out.startsWith(in_directory))
- out.remove(0, in_directory.length());
+ out.remove(0, in_directory.size());
t << subtarget->target << "-distdir: FORCE";
writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out),
@@ -303,7 +303,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for(QStringList::Iterator cit = Option::c_ext.begin();
cit != Option::c_ext.end(); ++cit) {
if((*it).endsWith((*cit))) {
- d_file = (*it).left((*it).length() - (*cit).length()).toQString();
+ d_file = (*it).left((*it).length() - (*cit).size()).toQString();
break;
}
}
@@ -311,7 +311,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for(QStringList::Iterator cppit = Option::cpp_ext.begin();
cppit != Option::cpp_ext.end(); ++cppit) {
if((*it).endsWith((*cppit))) {
- d_file = (*it).left((*it).length() - (*cppit).length()).toQString();
+ d_file = (*it).left((*it).length() - (*cppit).size()).toQString();
break;
}
}
@@ -388,7 +388,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
//incremental target
QString incr_target = var("TARGET") + "_incremental";
if(incr_target.indexOf(Option::dir_sep) != -1)
- incr_target = incr_target.right(incr_target.length() -
+ incr_target = incr_target.right(incr_target.size() -
(incr_target.lastIndexOf(Option::dir_sep) + 1));
QString incr_deps, incr_objs;
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
@@ -489,7 +489,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString incr_target = var("QMAKE_ORIG_TARGET").replace(
QRegularExpression("\\." + s_ext), "").replace(QRegularExpression("^lib"), "") + "_incremental";
if(incr_target.indexOf(Option::dir_sep) != -1)
- incr_target = incr_target.right(incr_target.length() -
+ incr_target = incr_target.right(incr_target.size() -
(incr_target.lastIndexOf(Option::dir_sep) + 1));
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
@@ -1395,7 +1395,7 @@ UnixMakefileGenerator::libtoolFileName(bool fixify)
QString ret = var("TARGET");
int slsh = ret.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- ret = ret.right(ret.length() - slsh - 1);
+ ret = ret.right(ret.size() - slsh - 1);
int dot = ret.indexOf('.');
if(dot != -1)
ret = ret.left(dot);
@@ -1465,7 +1465,7 @@ UnixMakefileGenerator::writeLibtoolFile()
mkdir(fileInfo(fname).path());
int slsh = lname.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- lname = lname.right(lname.length() - slsh - 1);
+ lname = lname.right(lname.size() - slsh - 1);
QFile ft(fname);
if(!ft.open(QIODevice::WriteOnly))
return;
@@ -1495,7 +1495,7 @@ UnixMakefileGenerator::writeLibtoolFile()
t << "'\n\n";
t << "# The name of the static archive.\n"
- << "old_library='" << escapeFilePath(lname.left(lname.length()-Option::libtool_ext.length()))
+ << "old_library='" << escapeFilePath(lname.left(lname.size()-Option::libtool_ext.size()))
<< ".a'\n\n";
t << "# Libraries that this one depends upon.\n";
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index ba3bc37088..ce4a80b6c8 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -574,7 +574,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool)
void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
{
- if (tool.SingleProjects.count() == 0) {
+ if (tool.SingleProjects.size() == 0) {
warn_msg(WarnLogic, "Generator: .NET: no single project in merge project, no output");
return;
}
@@ -589,7 +589,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tag("ItemGroup")
<< attrTag("Label", "ProjectConfigurations");
- for (int i = 0; i < tool.SingleProjects.count(); ++i) {
+ for (int i = 0; i < tool.SingleProjects.size(); ++i) {
xml << tag("ProjectConfiguration")
<< attrTag("Include" , tool.SingleProjects.at(i).Configuration.Name)
<< tagValue("Configuration", tool.SingleProjects.at(i).Configuration.ConfigurationName)
@@ -613,7 +613,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
// config part.
xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
- for (int i = 0; i < tool.SingleProjects.count(); ++i)
+ for (int i = 0; i < tool.SingleProjects.size(); ++i)
write(xml, tool.SingleProjects.at(i).Configuration);
xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");
@@ -623,7 +623,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< closetag();
// PropertySheets
- for (int i = 0; i < tool.SingleProjects.count(); ++i) {
+ for (int i = 0; i < tool.SingleProjects.size(); ++i) {
xml << tag("ImportGroup")
<< attrTag("Condition", generateCondition(tool.SingleProjects.at(i).Configuration))
<< attrTag("Label", "PropertySheets");
@@ -641,7 +641,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< closetag();
xml << tag("PropertyGroup");
- for (int i = 0; i < tool.SingleProjects.count(); ++i) {
+ for (int i = 0; i < tool.SingleProjects.size(); ++i) {
const VCConfiguration &config = tool.SingleProjects.at(i).Configuration;
const QString condition = generateCondition(config);
@@ -708,7 +708,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
}
xml << closetag();
- for (int i = 0; i < tool.SingleProjects.count(); ++i) {
+ for (int i = 0; i < tool.SingleProjects.size(); ++i) {
const VCConfiguration &config = tool.SingleProjects.at(i).Configuration;
xml << tag("ItemDefinitionGroup")
@@ -1737,7 +1737,7 @@ void VCXProjectWriter::addFilters(VCProject &project, XmlOutput &xmlFilter, cons
{
bool added = false;
- for (int i = 0; i < project.SingleProjects.count(); ++i) {
+ for (int i = 0; i < project.SingleProjects.size(); ++i) {
const VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
if(!filter.Files.isEmpty() && !added) {
xmlFilter << tag("Filter")
@@ -1759,10 +1759,10 @@ void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutpu
else
root.reset(new XTreeNode);
- for (int i = 0; i < project.SingleProjects.count(); ++i) {
+ for (int i = 0; i < project.SingleProjects.size(); ++i) {
const VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
// Merge all files in this filter to root tree
- for (int x = 0; x < filter.Files.count(); ++x)
+ for (int x = 0; x < filter.Files.size(); ++x)
root->addElement(filter.Files.at(x));
}
@@ -1789,8 +1789,8 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
// We need to check if the file has any custom build step.
// If there is one then it has to be included with "CustomBuild Include"
bool hasCustomBuildStep = false;
- QVarLengthArray<OutputFilterData> data(project.SingleProjects.count());
- for (int i = 0; i < project.SingleProjects.count(); ++i) {
+ QVarLengthArray<OutputFilterData> data(project.SingleProjects.size());
+ for (int i = 0; i < project.SingleProjects.size(); ++i) {
data[i].filter = project.SingleProjects.at(i).filterByName(cleanFilterName);
if (!data[i].filter.Config) // only if the filter is not empty
continue;
@@ -1812,7 +1812,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
}
bool fileAdded = false;
- for (int i = 0; i < project.SingleProjects.count(); ++i) {
+ for (int i = 0; i < project.SingleProjects.size(); ++i) {
OutputFilterData *d = &data[i];
if (!d->filter.Config) // only if the filter is not empty
continue;
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 7e0eb4ed41..bc22ba9c8f 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -290,7 +290,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
for (int y = 0; directories[y]; y++) {
QString dirTemp = project->first(directories[y]).toQString();
if (dirTemp.endsWith("\\"))
- dirTemp.truncate(dirTemp.length()-1);
+ dirTemp.truncate(dirTemp.size()-1);
if(!dirTemp.isEmpty())
source_directories.insert(dirTemp);
}
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 62214bb66a..04f2a99ded 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2304,7 +2304,7 @@ void VCFilter::modifyPCHstage(QString str)
VCFilterFile VCFilter::findFile(const QString &filePath, bool *found) const
{
- for (int i = 0; i < Files.count(); ++i) {
+ for (int i = 0; i < Files.size(); ++i) {
const VCFilterFile &f = Files.at(i);
if (f.file == filePath) {
*found = true;
@@ -2330,7 +2330,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
hasBuiltIn = Project->hasBuiltinCompiler(objectMappedFile);
// Remove the fake file suffix we've added initially to generate correct command lines.
- inFile.chop(Project->customBuildToolFilterFileSuffix.length());
+ inFile.chop(Project->customBuildToolFilterFileSuffix.size());
// qDebug("*** Extra compiler file has object mapped file '%s' => '%s'", qPrintable(inFile), qPrintable(objectMappedFile.join(' ')));
}
@@ -2595,7 +2595,7 @@ void VCProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool)
void VCProjectWriter::write(XmlOutput &xml, VCProject &tool)
{
- if (tool.SingleProjects.count() == 0) {
+ if (tool.SingleProjects.size() == 0) {
warn_msg(WarnLogic, "Generator: .NET: no single project in merge project, no output");
return;
}
@@ -2615,7 +2615,7 @@ void VCProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< closetag(_Platforms)
<< tag(_Configurations);
// Output each configuration
- for (int i = 0; i < tool.SingleProjects.count(); ++i)
+ for (int i = 0; i < tool.SingleProjects.size(); ++i)
write(xml, tool.SingleProjects.at(i).Configuration);
xml << closetag(_Configurations)
<< tag(q_Files);
@@ -2930,7 +2930,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool)
void VCProjectWriter::write(XmlOutput &xml, VCFilter &tool)
{
- if(!tool.Files.count())
+ if(!tool.Files.size())
return;
if (!tool.Name.isEmpty()) {
@@ -2940,7 +2940,7 @@ void VCProjectWriter::write(XmlOutput &xml, VCFilter &tool)
<< attrS(_UniqueIdentifier, tool.Guid)
<< attrT(_ParseFiles, tool.ParseFiles);
}
- for (int i = 0; i < tool.Files.count(); ++i) {
+ for (int i = 0; i < tool.Files.size(); ++i) {
const VCFilterFile &info = tool.Files.at(i);
xml << tag(q_File)
<< attrS(_RelativePath, Option::fixPathToTargetOS(info.file))
@@ -2964,11 +2964,11 @@ void VCProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, const QSt
QString name, extfilter, guid;
triState parse = unset;
- for (int i = 0; i < project.SingleProjects.count(); ++i) {
+ for (int i = 0; i < project.SingleProjects.size(); ++i) {
const VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
// Merge all files in this filter to root tree
- for (int x = 0; x < filter.Files.count(); ++x)
+ for (int x = 0; x < filter.Files.size(); ++x)
root->addElement(filter.Files.at(x));
// Save filter setting from first filter. Next filters
@@ -3003,7 +3003,7 @@ void VCProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, cons
{
xml << tag(q_File)
<< attrS(_RelativePath, Option::fixPathToTargetOS(info.file));
- for (int i = 0; i < project.SingleProjects.count(); ++i) {
+ for (int i = 0; i < project.SingleProjects.size(); ++i) {
VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
if (filter.Config) // only if the filter is not empty
outputFileConfig(filter, xml, info.file);
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 6116ed9376..73dc65e7bf 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -142,14 +142,14 @@ bool VcprojGenerator::writeProjectMakefile()
// Generate project file
if(project->first("TEMPLATE") == "vcapp" ||
project->first("TEMPLATE") == "vclib") {
- if (!mergedProjects.count()) {
+ if (!mergedProjects.size()) {
warn_msg(WarnLogic, "Generator: MSVC.NET: no single configuration created, cannot output project!");
return false;
}
debug_msg(1, "Generator: MSVC.NET: Writing project file");
VCProject mergedProject;
- for (int i = 0; i < mergedProjects.count(); ++i) {
+ for (int i = 0; i < mergedProjects.size(); ++i) {
VCProjectSingleConfig *singleProject = &(mergedProjects.at(i)->vcProject);
mergedProject.SingleProjects += *singleProject;
for (int j = 0; j < singleProject->ExtraCompilersFiles.count(); ++j) {
@@ -159,7 +159,7 @@ bool VcprojGenerator::writeProjectMakefile()
}
}
- if(mergedProjects.count() > 1 &&
+ if(mergedProjects.size() > 1 &&
mergedProjects.at(0)->vcProject.Name ==
mergedProjects.at(1)->vcProject.Name)
mergedProjects.at(0)->writePrlFile();
@@ -418,7 +418,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
newDep->uuid = tmp_proj.isEmpty("QMAKE_UUID") ? getProjectUUID(Option::fixPathToLocalOS(vcprojDir + QDir::separator() + vcproj)).toString().toUpper(): tmp_proj.first("QMAKE_UUID").toQString();
// We want to store it as the .lib name.
if (newDep->target.endsWith(".dll"))
- newDep->target = newDep->target.left(newDep->target.length()-3) + "lib";
+ newDep->target = newDep->target.left(newDep->target.size()-3) + "lib";
projGuids.insert(newDep->projectName, newDep->target);
if (tmpList.size()) {
@@ -1213,7 +1213,7 @@ void VcprojGenerator::initDeploymentTool()
continue;
// We want to deploy .dlls not .libs
if (dllName.endsWith(QLatin1String(".lib")))
- dllName.replace(dllName.length() - 3, 3, QLatin1String("dll"));
+ dllName.replace(dllName.size() - 3, 3, QLatin1String("dll"));
// 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;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 4f56bad28a..5ae4d095c7 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -479,8 +479,8 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
const int commandlineLimit = 2047; // NT limit, expanded
for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
file = ' ' + escapeFilePath(Option::fixPathToTargetOS((*it).toQString()));
- if(del_statement.length() + files.length() +
- qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
+ if(del_statement.size() + files.size() +
+ qMax(fixEnvVariables(file).size(), file.size()) > commandlineLimit) {
t << "\n\t" << del_statement << files;
files.clear();
}
@@ -508,8 +508,8 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
const int commandlineLimit = 2047; // NT limit, expanded
for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
file = " " + escapeFilePath(Option::fixPathToTargetOS((*it).toQString()));
- if(del_statement.length() + files.length() +
- qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
+ if(del_statement.size() + files.size() +
+ qMax(fixEnvVariables(file).size(), file.size()) > commandlineLimit) {
t << "\n\t" << del_statement << files;
files.clear();
}
@@ -749,7 +749,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
QString dst_prl = Option::fixPathToTargetOS(project->first("QMAKE_INTERNAL_PRL_FILE").toQString());
int slsh = dst_prl.lastIndexOf(Option::dir_sep);
if(slsh != -1)
- dst_prl = dst_prl.right(dst_prl.length() - slsh - 1);
+ dst_prl = dst_prl.right(dst_prl.size() - slsh - 1);
dst_prl = filePrefixRoot(root, targetdir + dst_prl);
if (!ret.isEmpty())
ret += "\n\t";
diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp
index 713c1eca44..be64176f33 100644
--- a/qmake/generators/xmloutput.cpp
+++ b/qmake/generators/xmloutput.cpp
@@ -240,9 +240,9 @@ void XmlOutput::closeTag()
{
switch(currentState) {
case Bare:
- if (tagStack.count())
+ if (tagStack.size())
//warn_msg(WarnLogic, "<Root>: Cannot close tag in Bare state, %d tags on stack", tagStack.count());
- qDebug("<Root>: Cannot close tag in Bare state, %d tags on stack", int(tagStack.count()));
+ qDebug("<Root>: Cannot close tag in Bare state, %d tags on stack", int(tagStack.size()));
else
//warn_msg(WarnLogic, "<Root>: Cannot close tag, no tags on stack");
qDebug("<Root>: Cannot close tag, no tags on stack");
@@ -271,7 +271,7 @@ void XmlOutput::closeTo(const QString &tag)
qDebug("<%s>: Cannot close to tag <%s>, not on stack", tagStack.last().toLatin1().constData(), tag.toLatin1().constData());
return;
}
- int left = tagStack.count();
+ int left = tagStack.size();
while (left-- && cont) {
cont = tagStack.last().compare(tag) != 0;
closeTag();
@@ -280,7 +280,7 @@ void XmlOutput::closeTo(const QString &tag)
void XmlOutput::closeAll()
{
- if (!tagStack.count())
+ if (!tagStack.size())
return;
closeTo(QString());
}
@@ -315,7 +315,7 @@ void XmlOutput::addAttribute(const QString &attribute, const QString &value)
case Tag:
//warn_msg(WarnLogic, "<%s>: Cannot add attribute since tags not open", tagStack.last().toLatin1().constData());
qDebug("<%s>: Cannot add attribute (%s) since tag's not open",
- (tagStack.count() ? tagStack.last().toLatin1().constData() : "Root"),
+ (tagStack.size() ? tagStack.last().toLatin1().constData() : "Root"),
attribute.toLatin1().constData());
return;
case Attribute:
@@ -333,7 +333,7 @@ void XmlOutput::addAttributeTag(const QString &attribute, const QString &value)
case Tag:
//warn_msg(WarnLogic, "<%s>: Cannot add attribute since tags not open", tagStack.last().toLatin1().constData());
qDebug("<%s>: Cannot add attribute (%s) since tag's not open",
- (tagStack.count() ? tagStack.last().toLatin1().constData() : "Root"),
+ (tagStack.size() ? tagStack.last().toLatin1().constData() : "Root"),
attribute.toLatin1().constData());
return;
case Attribute: