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>
This commit is contained in:
parent
109e088c7c
commit
df9d882d41
@ -65,7 +65,7 @@ struct FileInfoCacheKey
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
inline bool isRelativePath(const QString &file) {
|
inline bool isRelativePath(const QString &file) {
|
||||||
int length = file.length();
|
int length = file.size();
|
||||||
if (!length)
|
if (!length)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -524,14 +524,14 @@ bool ProjectBuilderMakefileGenerator::replaceLibrarySuffix(const QString &lib_fi
|
|||||||
warn_msg(WarnLogic, "Failed to find expected suffix '%s' for library '%s'.",
|
warn_msg(WarnLogic, "Failed to find expected suffix '%s' for library '%s'.",
|
||||||
qPrintable(librarySuffix), qPrintable(library));
|
qPrintable(librarySuffix), qPrintable(library));
|
||||||
} else {
|
} else {
|
||||||
library.replace(pos, librarySuffix.length(), suffixSetting);
|
library.replace(pos, librarySuffix.size(), suffixSetting);
|
||||||
if (name.endsWith(librarySuffix))
|
if (name.endsWith(librarySuffix))
|
||||||
name.chop(librarySuffix.length());
|
name.chop(librarySuffix.size());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int pos = library.lastIndexOf(name);
|
int pos = library.lastIndexOf(name);
|
||||||
if (pos != -1)
|
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);
|
const int slsh = library.lastIndexOf(Option::dir_sep);
|
||||||
if(name.isEmpty()) {
|
if(name.isEmpty()) {
|
||||||
if(slsh != -1)
|
if(slsh != -1)
|
||||||
name = library.right(library.length() - slsh - 1);
|
name = library.right(library.size() - slsh - 1);
|
||||||
}
|
}
|
||||||
if(slsh != -1) {
|
if(slsh != -1) {
|
||||||
const QString path = QFileInfo(library.left(slsh)).absoluteFilePath();
|
const QString path = QFileInfo(library.left(slsh)).absoluteFilePath();
|
||||||
@ -1970,7 +1970,7 @@ ProjectBuilderMakefileGenerator::pbxbuild()
|
|||||||
static QString quotedStringLiteral(const QString &value)
|
static QString quotedStringLiteral(const QString &value)
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
const int len = value.length();
|
const int len = value.size();
|
||||||
result.reserve(int(len * 1.1) + 2);
|
result.reserve(int(len * 1.1) + 2);
|
||||||
|
|
||||||
result += QLatin1Char('"');
|
result += QLatin1Char('"');
|
||||||
|
@ -113,7 +113,7 @@ MakefileGenerator::initOutPaths()
|
|||||||
if(!fi.makeAbsolute()) {
|
if(!fi.makeAbsolute()) {
|
||||||
QString cache_r = fi.path(), pwd = Option::output_dir;
|
QString cache_r = fi.path(), pwd = Option::output_dir;
|
||||||
if(pwd.startsWith(cache_r) && !pwd.startsWith(root)) {
|
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))
|
if(exists(pwd))
|
||||||
v.insert("QMAKE_ABSOLUTE_SOURCE_PATH", ProStringList(pwd));
|
v.insert("QMAKE_ABSOLUTE_SOURCE_PATH", ProStringList(pwd));
|
||||||
}
|
}
|
||||||
@ -288,7 +288,7 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
|
|||||||
real_dir = dir;
|
real_dir = dir;
|
||||||
if(!(flags & VPATH_NoFixify))
|
if(!(flags & VPATH_NoFixify))
|
||||||
real_dir = fileFixify(real_dir, FileFixifyBackwards) + '/';
|
real_dir = fileFixify(real_dir, FileFixifyBackwards) + '/';
|
||||||
regex.remove(0, dir.length());
|
regex.remove(0, dir.size());
|
||||||
}
|
}
|
||||||
if(real_dir.isEmpty() || exists(real_dir)) {
|
if(real_dir.isEmpty() || exists(real_dir)) {
|
||||||
QStringList files = QDir(real_dir).entryList(QStringList(regex),
|
QStringList files = QDir(real_dir).entryList(QStringList(regex),
|
||||||
@ -491,7 +491,7 @@ MakefileGenerator::init()
|
|||||||
inn.toLatin1().constData());
|
inn.toLatin1().constData());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
outn = fileFixify(inn.left(inn.length() - 3), FileFixifyBackwards);
|
outn = fileFixify(inn.left(inn.size() - 3), FileFixifyBackwards);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProKey confign(sub + ".CONFIG");
|
const ProKey confign(sub + ".CONFIG");
|
||||||
@ -512,7 +512,7 @@ MakefileGenerator::init()
|
|||||||
QString line = QString::fromLatin1(in.readLine());
|
QString line = QString::fromLatin1(in.readLine());
|
||||||
if (line.startsWith("!!IF ")) {
|
if (line.startsWith("!!IF ")) {
|
||||||
if (state.isEmpty() || state.top() == IN_CONDITION) {
|
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))
|
if (project->test(test, inn, count))
|
||||||
state.push(IN_CONDITION);
|
state.push(IN_CONDITION);
|
||||||
else
|
else
|
||||||
@ -525,7 +525,7 @@ MakefileGenerator::init()
|
|||||||
warn_msg(WarnLogic, "(%s:%d): Unexpected else condition",
|
warn_msg(WarnLogic, "(%s:%d): Unexpected else condition",
|
||||||
in.fileName().toLatin1().constData(), count);
|
in.fileName().toLatin1().constData(), count);
|
||||||
} else if (state.top() == PENDING_CONDITION) {
|
} 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)) {
|
if (project->test(test, inn, count)) {
|
||||||
state.pop();
|
state.pop();
|
||||||
state.push(IN_CONDITION);
|
state.push(IN_CONDITION);
|
||||||
@ -634,7 +634,7 @@ MakefileGenerator::init()
|
|||||||
}
|
}
|
||||||
{ //do the path fixifying
|
{ //do the path fixifying
|
||||||
ProStringList paths;
|
ProStringList paths;
|
||||||
for(x = 0; x < compilers.count(); ++x) {
|
for(x = 0; x < compilers.size(); ++x) {
|
||||||
if(!paths.contains(compilers.at(x).variable_in))
|
if(!paths.contains(compilers.at(x).variable_in))
|
||||||
paths << compilers.at(x).variable_in;
|
paths << compilers.at(x).variable_in;
|
||||||
}
|
}
|
||||||
@ -653,7 +653,7 @@ MakefileGenerator::init()
|
|||||||
|
|
||||||
if(noIO() || !doDepends() || project->isActiveConfig("GNUmake"))
|
if(noIO() || !doDepends() || project->isActiveConfig("GNUmake"))
|
||||||
QMakeSourceFileInfo::setDependencyMode(QMakeSourceFileInfo::NonRecursive);
|
QMakeSourceFileInfo::setDependencyMode(QMakeSourceFileInfo::NonRecursive);
|
||||||
for(x = 0; x < compilers.count(); ++x)
|
for(x = 0; x < compilers.size(); ++x)
|
||||||
initCompiler(compilers.at(x));
|
initCompiler(compilers.at(x));
|
||||||
|
|
||||||
//merge actual compiler outputs into their variable_out. This is done last so that
|
//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());
|
incDirs.join(QString(" :: ")).toLatin1().constData());
|
||||||
|
|
||||||
//add to dependency engine
|
//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);
|
const MakefileGenerator::Compiler &comp = compilers.at(x);
|
||||||
if(!(comp.flags & Compiler::CompilerNoCheckDeps)) {
|
if(!(comp.flags & Compiler::CompilerNoCheckDeps)) {
|
||||||
const ProKey ikey(comp.variable_in);
|
const ProKey ikey(comp.variable_in);
|
||||||
@ -820,7 +820,7 @@ MakefileGenerator::init()
|
|||||||
QString dir, regex = Option::normalizePath(dep);
|
QString dir, regex = Option::normalizePath(dep);
|
||||||
if (regex.lastIndexOf('/') != -1) {
|
if (regex.lastIndexOf('/') != -1) {
|
||||||
dir = regex.left(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));
|
QStringList files = QDir(dir).entryList(QStringList(regex));
|
||||||
if(files.isEmpty()) {
|
if(files.isEmpty()) {
|
||||||
@ -1173,7 +1173,7 @@ QString
|
|||||||
MakefileGenerator::filePrefixRoot(const QString &root, const QString &path)
|
MakefileGenerator::filePrefixRoot(const QString &root, const QString &path)
|
||||||
{
|
{
|
||||||
QString ret(path);
|
QString ret(path);
|
||||||
if(path.length() > 2 && path[1] == ':') //c:\foo
|
if(path.size() > 2 && path[1] == ':') //c:\foo
|
||||||
ret.insert(2, root);
|
ret.insert(2, root);
|
||||||
else
|
else
|
||||||
ret.prepend(root);
|
ret.prepend(root);
|
||||||
@ -1249,14 +1249,14 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
|
|||||||
qPrintable(wild), qPrintable((*it).toQString()),
|
qPrintable(wild), qPrintable((*it).toQString()),
|
||||||
qPrintable(base_path));
|
qPrintable(base_path));
|
||||||
} else {
|
} else {
|
||||||
QString dir_sfx = dirstr.mid(base_path.length());
|
QString dir_sfx = dirstr.mid(base_path.size());
|
||||||
dst_dir += dir_sfx;
|
dst_dir += dir_sfx;
|
||||||
if (!dir_sfx.isEmpty() && !made_dirs.contains(dir_sfx)) {
|
if (!dir_sfx.isEmpty() && !made_dirs.contains(dir_sfx)) {
|
||||||
made_dirs.insert(dir_sfx);
|
made_dirs.insert(dir_sfx);
|
||||||
QString tmp_dst = fileFixify(dst_dir, FileFixifyAbsolute, false);
|
QString tmp_dst = fileFixify(dst_dir, FileFixifyAbsolute, false);
|
||||||
tmp_dst.chop(1);
|
tmp_dst.chop(1);
|
||||||
inst << mkdir_p_asstring(filePrefixRoot(root, tmp_dst));
|
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) {
|
if (dst_dir.at(i) == Option::dir_sep) {
|
||||||
QString subd = dst_dir.left(i);
|
QString subd = dst_dir.left(i);
|
||||||
if (!removed_dirs.contains(subd)) {
|
if (!removed_dirs.contains(subd)) {
|
||||||
@ -1616,7 +1616,7 @@ MakefileGenerator::replaceExtraCompilerVariables(
|
|||||||
QFileInfo fi(fileInfo(Option::normalizePath(in.at(i))));
|
QFileInfo fi(fileInfo(Option::normalizePath(in.at(i))));
|
||||||
QString ext;
|
QString ext;
|
||||||
// Ensure complementarity with QMAKE_FILE_BASE
|
// Ensure complementarity with QMAKE_FILE_BASE
|
||||||
int baseLen = fi.completeBaseName().length();
|
int baseLen = fi.completeBaseName().size();
|
||||||
if(baseLen == 0)
|
if(baseLen == 0)
|
||||||
ext = fi.fileName();
|
ext = fi.fileName();
|
||||||
else
|
else
|
||||||
@ -1682,7 +1682,7 @@ MakefileGenerator::replaceExtraCompilerVariables(
|
|||||||
fullVal = val.join(' ');
|
fullVal = val.join(' ');
|
||||||
}
|
}
|
||||||
ret.replace(match.capturedStart(), match.capturedLength(), fullVal);
|
ret.replace(match.capturedStart(), match.capturedLength(), fullVal);
|
||||||
rep += fullVal.length();
|
rep += fullVal.size();
|
||||||
} else {
|
} else {
|
||||||
rep = match.capturedEnd();
|
rep = match.capturedEnd();
|
||||||
}
|
}
|
||||||
@ -1998,8 +1998,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
QString files;
|
QString files;
|
||||||
const int commandlineLimit = 2047; // NT limit, expanded
|
const int commandlineLimit = 2047; // NT limit, expanded
|
||||||
for (const QString &file : qAsConst(dels)) {
|
for (const QString &file : qAsConst(dels)) {
|
||||||
if(del_statement.length() + files.length() +
|
if(del_statement.size() + files.size() +
|
||||||
qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
|
qMax(fixEnvVariables(file).size(), file.size()) > commandlineLimit) {
|
||||||
cleans.append(files);
|
cleans.append(files);
|
||||||
files.clear();
|
files.clear();
|
||||||
}
|
}
|
||||||
@ -2382,7 +2382,7 @@ MakefileGenerator::findSubDirsSubTargets() const
|
|||||||
if(new_slsh != -1)
|
if(new_slsh != -1)
|
||||||
basename = basename.mid(new_slsh+1);
|
basename = basename.mid(new_slsh+1);
|
||||||
if(st->profile != basename + Option::pro_ext)
|
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");
|
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))
|
if(!out_directory.isEmpty() && !out_directory.endsWith(Option::dir_sep))
|
||||||
out_directory += Option::dir_sep;
|
out_directory += Option::dir_sep;
|
||||||
if(!abs_source_path.isEmpty() && out_directory.startsWith(abs_source_path))
|
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")
|
QString out_directory_cdin = out_directory.isEmpty() ? QString("\n\t")
|
||||||
: "\n\tcd " + escapeFilePath(out_directory) + " && ";
|
: "\n\tcd " + escapeFilePath(out_directory) + " && ";
|
||||||
@ -2534,7 +2534,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
out = subtarget->makefile;
|
out = subtarget->makefile;
|
||||||
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
||||||
if(out.startsWith(in_directory))
|
if(out.startsWith(in_directory))
|
||||||
out = out.mid(in_directory.length());
|
out = out.mid(in_directory.size());
|
||||||
out = escapeFilePath(out);
|
out = escapeFilePath(out);
|
||||||
t << subtarget->target << "-qmake_all: ";
|
t << subtarget->target << "-qmake_all: ";
|
||||||
if (flags & SubTargetOrdered) {
|
if (flags & SubTargetOrdered) {
|
||||||
@ -2699,7 +2699,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
if(!out_directory.isEmpty() && !out_directory.endsWith(Option::dir_sep))
|
if(!out_directory.isEmpty() && !out_directory.endsWith(Option::dir_sep))
|
||||||
out_directory += Option::dir_sep;
|
out_directory += Option::dir_sep;
|
||||||
if(!abs_source_path.isEmpty() && out_directory.startsWith(abs_source_path))
|
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))
|
if(!recurse.contains(subtarget->name))
|
||||||
continue;
|
continue;
|
||||||
@ -2714,7 +2714,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
|||||||
out = subtarget->makefile;
|
out = subtarget->makefile;
|
||||||
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
||||||
if (out.startsWith(in_directory))
|
if (out.startsWith(in_directory))
|
||||||
out = out.mid(in_directory.length());
|
out = out.mid(in_directory.size());
|
||||||
out = escapeFilePath(out);
|
out = escapeFilePath(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3016,7 +3016,7 @@ MakefileGenerator::fileFixify(const QString &file, FileFixifyTypes fix, bool can
|
|||||||
if(ret == match_dir) {
|
if(ret == match_dir) {
|
||||||
ret = "";
|
ret = "";
|
||||||
} else if(ret.startsWith(match_dir + Option::dir_sep)) {
|
} 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 {
|
} else {
|
||||||
//figure out the depth
|
//figure out the depth
|
||||||
int depth = 4;
|
int depth = 4;
|
||||||
@ -3038,7 +3038,7 @@ MakefileGenerator::fileFixify(const QString &file, FileFixifyTypes fix, bool can
|
|||||||
break;
|
break;
|
||||||
if(ret.startsWith(match_dir + Option::dir_sep)) {
|
if(ret.startsWith(match_dir + Option::dir_sep)) {
|
||||||
//concat
|
//concat
|
||||||
int remlen = ret.length() - (match_dir.length() + 1);
|
int remlen = ret.size() - (match_dir.size() + 1);
|
||||||
if(remlen < 0)
|
if(remlen < 0)
|
||||||
remlen = 0;
|
remlen = 0;
|
||||||
ret = ret.right(remlen);
|
ret = ret.right(remlen);
|
||||||
@ -3112,12 +3112,12 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
|
|||||||
QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
|
QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
|
||||||
depdirs.prepend(fileInfo(file.real()).absoluteDir().path());
|
depdirs.prepend(fileInfo(file.real()).absoluteDir().path());
|
||||||
QString pwd = qmake_getpwd();
|
QString pwd = qmake_getpwd();
|
||||||
if(pwd.at(pwd.length()-1) != '/')
|
if(pwd.at(pwd.size()-1) != '/')
|
||||||
pwd += '/';
|
pwd += '/';
|
||||||
for(int i = 0; i < depdirs.count(); i++) {
|
for(int i = 0; i < depdirs.size(); i++) {
|
||||||
QString dir = depdirs.at(i).real();
|
QString dir = depdirs.at(i).real();
|
||||||
if(!QDir::isRelativePath(dir) && dir.startsWith(pwd))
|
if(!QDir::isRelativePath(dir) && dir.startsWith(pwd))
|
||||||
dir = dir.mid(pwd.length());
|
dir = dir.mid(pwd.size());
|
||||||
if(QDir::isRelativePath(dir)) {
|
if(QDir::isRelativePath(dir)) {
|
||||||
if(!dir.endsWith(Option::dir_sep))
|
if(!dir.endsWith(Option::dir_sep))
|
||||||
dir += Option::dir_sep;
|
dir += Option::dir_sep;
|
||||||
@ -3233,7 +3233,7 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
|
|||||||
ret = project->first("TARGET").toQString();
|
ret = project->first("TARGET").toQString();
|
||||||
int slsh = ret.lastIndexOf(Option::dir_sep);
|
int slsh = ret.lastIndexOf(Option::dir_sep);
|
||||||
if (slsh != -1)
|
if (slsh != -1)
|
||||||
ret = ret.right(ret.length() - slsh - 1);
|
ret = ret.right(ret.size() - slsh - 1);
|
||||||
if (ret.startsWith("lib"))
|
if (ret.startsWith("lib"))
|
||||||
ret = ret.mid(3);
|
ret = ret.mid(3);
|
||||||
int dot = ret.indexOf('.');
|
int dot = ret.indexOf('.');
|
||||||
|
@ -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
|
// Ensure that depdirs does not contain the same paths several times, to minimize the stats
|
||||||
QList<QMakeLocalFileName> ll;
|
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)))
|
if (!ll.contains(l.at(i)))
|
||||||
ll.append(l.at(i));
|
ll.append(l.at(i));
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
void
|
void
|
||||||
BuildsMetaMakefileGenerator::clearBuilds()
|
BuildsMetaMakefileGenerator::clearBuilds()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < makefiles.count(); i++) {
|
for(int i = 0; i < makefiles.size(); i++) {
|
||||||
Build *build = makefiles[i];
|
Build *build = makefiles[i];
|
||||||
if(QMakeProject *p = build->makefile->projectFile()) {
|
if(QMakeProject *p = build->makefile->projectFile()) {
|
||||||
if(p != project)
|
if(p != project)
|
||||||
@ -126,7 +126,7 @@ BuildsMetaMakefileGenerator::write()
|
|||||||
|
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
const QString &output_name = Option::output.fileName();
|
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);
|
Option::output.setFileName(output_name);
|
||||||
Build *build = makefiles[i];
|
Build *build = makefiles[i];
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ void BuildsMetaMakefileGenerator::accumulateVariableFromBuilds(const ProKey &nam
|
|||||||
|
|
||||||
void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
|
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,
|
// Checking for conflicts only makes sense if we have more than one BUILD,
|
||||||
// and the last entry in makefiles is the "glue" Build.
|
// and the last entry in makefiles is the "glue" Build.
|
||||||
return;
|
return;
|
||||||
@ -234,7 +234,7 @@ void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
|
|||||||
}
|
}
|
||||||
using TargetInfo = std::pair<Build *, ProString>;
|
using TargetInfo = std::pair<Build *, ProString>;
|
||||||
QList<TargetInfo> targets;
|
QList<TargetInfo> targets;
|
||||||
const int last = makefiles.count() - 1;
|
const int last = makefiles.size() - 1;
|
||||||
targets.resize(last);
|
targets.resize(last);
|
||||||
for (int i = 0; i < last; ++i) {
|
for (int i = 0; i < last; ++i) {
|
||||||
Build *b = makefiles.at(i);
|
Build *b = makefiles.at(i);
|
||||||
@ -324,7 +324,7 @@ SubdirsMetaMakefileGenerator::init()
|
|||||||
if(!subdir.isRelative()) { //we can try to make it relative
|
if(!subdir.isRelative()) { //we can try to make it relative
|
||||||
QString subdir_path = subdir.filePath();
|
QString subdir_path = subdir.filePath();
|
||||||
if(subdir_path.startsWith(thispwd))
|
if(subdir_path.startsWith(thispwd))
|
||||||
subdir = QFileInfo(subdir_path.mid(thispwd.length()));
|
subdir = QFileInfo(subdir_path.mid(thispwd.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//handle sub project
|
//handle sub project
|
||||||
@ -391,12 +391,12 @@ SubdirsMetaMakefileGenerator::write()
|
|||||||
const QString &pwd = qmake_getpwd();
|
const QString &pwd = qmake_getpwd();
|
||||||
const QString &output_dir = Option::output_dir;
|
const QString &output_dir = Option::output_dir;
|
||||||
const QString &output_name = Option::output.fileName();
|
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);
|
const Subdir *sub = subs.at(i);
|
||||||
qmake_setpwd(sub->input_dir);
|
qmake_setpwd(sub->input_dir);
|
||||||
Option::output_dir = QFileInfo(sub->output_dir).absoluteFilePath();
|
Option::output_dir = QFileInfo(sub->output_dir).absoluteFilePath();
|
||||||
Option::output.setFileName(sub->output_file);
|
Option::output.setFileName(sub->output_file);
|
||||||
if(i != subs.count()-1) {
|
if(i != subs.size()-1) {
|
||||||
for (int ind = 0; ind < sub->indent; ++ind)
|
for (int ind = 0; ind < sub->indent; ++ind)
|
||||||
printf(" ");
|
printf(" ");
|
||||||
printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+
|
printf("Writing %s\n", QDir::cleanPath(Option::output_dir+"/"+
|
||||||
@ -414,7 +414,7 @@ SubdirsMetaMakefileGenerator::write()
|
|||||||
|
|
||||||
SubdirsMetaMakefileGenerator::~SubdirsMetaMakefileGenerator()
|
SubdirsMetaMakefileGenerator::~SubdirsMetaMakefileGenerator()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < subs.count(); i++)
|
for(int i = 0; i < subs.size(); i++)
|
||||||
delete subs[i];
|
delete subs[i];
|
||||||
subs.clear();
|
subs.clear();
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ ProjectGenerator::init()
|
|||||||
int s = regex.lastIndexOf(Option::dir_sep);
|
int s = regex.lastIndexOf(Option::dir_sep);
|
||||||
if(s != -1) {
|
if(s != -1) {
|
||||||
dir = regex.left(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);
|
const QDir d(dir);
|
||||||
if (Option::recursive) {
|
if (Option::recursive) {
|
||||||
@ -155,7 +155,7 @@ ProjectGenerator::init()
|
|||||||
int s = regx.lastIndexOf(Option::dir_sep);
|
int s = regx.lastIndexOf(Option::dir_sep);
|
||||||
if(s != -1) {
|
if(s != -1) {
|
||||||
dir = regx.left(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),
|
QStringList files = QDir(dir).entryList(QDir::nameFiltersFromString(regx),
|
||||||
QDir::Dirs | QDir::NoDotAndDotDot);
|
QDir::Dirs | QDir::NoDotAndDotDot);
|
||||||
@ -231,7 +231,7 @@ ProjectGenerator::init()
|
|||||||
}
|
}
|
||||||
if(!h_ext.isEmpty()) {
|
if(!h_ext.isEmpty()) {
|
||||||
for(int cppit = 0; cppit < Option::cpp_ext.size(); ++cppit) {
|
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));
|
Option::cpp_ext.at(cppit));
|
||||||
if(exists(src)) {
|
if(exists(src)) {
|
||||||
ProStringList &srcl = v["SOURCES"];
|
ProStringList &srcl = v["SOURCES"];
|
||||||
@ -358,7 +358,7 @@ ProjectGenerator::addFile(QString file)
|
|||||||
int s = file.lastIndexOf(Option::dir_sep);
|
int s = file.lastIndexOf(Option::dir_sep);
|
||||||
if(s != -1)
|
if(s != -1)
|
||||||
dir = file.left(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;
|
return false;
|
||||||
|
|
||||||
ProKey where;
|
ProKey where;
|
||||||
@ -428,9 +428,9 @@ ProjectGenerator::getWritableVar(const char *vk, bool)
|
|||||||
else
|
else
|
||||||
ret = v + " += ";
|
ret = v + " += ";
|
||||||
QString join = vals.join(' ');
|
QString join = vals.join(' ');
|
||||||
if(ret.length() + join.length() > 80) {
|
if(ret.size() + join.size() > 80) {
|
||||||
QString spaces;
|
QString spaces;
|
||||||
for(int i = 0; i < ret.length(); i++)
|
for(int i = 0; i < ret.size(); i++)
|
||||||
spaces += " ";
|
spaces += " ";
|
||||||
join = vals.join(" \\\n" + spaces);
|
join = vals.join(" \\\n" + spaces);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ UnixMakefileGenerator::init()
|
|||||||
for (const ProString &iif : project->values("QMAKE_INTERNAL_INCLUDED_FILES")) {
|
for (const ProString &iif : project->values("QMAKE_INTERNAL_INCLUDED_FILES")) {
|
||||||
if (iif == project->cacheFile())
|
if (iif == project->cacheFile())
|
||||||
continue;
|
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);
|
project->values("DISTFILES") += fileFixify(iif.toQString(), FileFixifyRelative);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ UnixMakefileGenerator::init()
|
|||||||
const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
|
const ProStringList &rpathdirs = project->values("QMAKE_RPATHDIR");
|
||||||
for (int i = 0; i < rpathdirs.size(); ++i) {
|
for (int i = 0; i < rpathdirs.size(); ++i) {
|
||||||
QString rpathdir = rpathdirs[i].toQString();
|
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
|
rpathdir.replace(0, 1, "\\$$"); // Escape from make and the shell
|
||||||
} else if (!rpathdir.startsWith('@') && fileInfo(rpathdir).isRelative()) {
|
} else if (!rpathdir.startsWith('@') && fileInfo(rpathdir).isRelative()) {
|
||||||
QString rpathbase = project->first("QMAKE_REL_RPATH_BASE").toQString();
|
QString rpathbase = project->first("QMAKE_REL_RPATH_BASE").toQString();
|
||||||
@ -436,7 +436,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (opt.length() == 10)
|
if (opt.size() == 10)
|
||||||
++it;
|
++it;
|
||||||
// Skip
|
// Skip
|
||||||
}
|
}
|
||||||
@ -689,7 +689,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
|
|||||||
QString link = Option::fixPathToTargetOS(destdir + links[i], false);
|
QString link = Option::fixPathToTargetOS(destdir + links[i], false);
|
||||||
int lslash = link.lastIndexOf(Option::dir_sep);
|
int lslash = link.lastIndexOf(Option::dir_sep);
|
||||||
if(lslash != -1)
|
if(lslash != -1)
|
||||||
link = link.right(link.length() - (lslash + 1));
|
link = link.right(link.size() - (lslash + 1));
|
||||||
QString dst_link = escapeFilePath(
|
QString dst_link = escapeFilePath(
|
||||||
filePrefixRoot(root, fileFixify(targetdir + link, FileFixifyAbsolute)));
|
filePrefixRoot(root, fileFixify(targetdir + link, FileFixifyAbsolute)));
|
||||||
ret += "\n\t-$(SYMLINK) $(TARGET) " + dst_link;
|
ret += "\n\t-$(SYMLINK) $(TARGET) " + dst_link;
|
||||||
|
@ -105,11 +105,11 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
|||||||
if (!out_directory.isEmpty() && !out_directory.endsWith(Option::dir_sep))
|
if (!out_directory.isEmpty() && !out_directory.endsWith(Option::dir_sep))
|
||||||
out_directory += Option::dir_sep;
|
out_directory += Option::dir_sep;
|
||||||
if (!abs_source_path.isEmpty() && out_directory.startsWith(abs_source_path))
|
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;
|
QString dist_directory = out_directory;
|
||||||
if (dist_directory.endsWith(Option::dir_sep))
|
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))
|
if (!dist_directory.startsWith(Option::dir_sep))
|
||||||
dist_directory.prepend(Option::dir_sep);
|
dist_directory.prepend(Option::dir_sep);
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
|||||||
QString out = subtarget->makefile;
|
QString out = subtarget->makefile;
|
||||||
QString in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
QString in = escapeFilePath(fileFixify(in_directory + subtarget->profile, FileFixifyAbsolute));
|
||||||
if (out.startsWith(in_directory))
|
if (out.startsWith(in_directory))
|
||||||
out.remove(0, in_directory.length());
|
out.remove(0, in_directory.size());
|
||||||
|
|
||||||
t << subtarget->target << "-distdir: FORCE";
|
t << subtarget->target << "-distdir: FORCE";
|
||||||
writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out),
|
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();
|
for(QStringList::Iterator cit = Option::c_ext.begin();
|
||||||
cit != Option::c_ext.end(); ++cit) {
|
cit != Option::c_ext.end(); ++cit) {
|
||||||
if((*it).endsWith((*cit))) {
|
if((*it).endsWith((*cit))) {
|
||||||
d_file = (*it).left((*it).length() - (*cit).length()).toQString();
|
d_file = (*it).left((*it).length() - (*cit).size()).toQString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
for(QStringList::Iterator cppit = Option::cpp_ext.begin();
|
for(QStringList::Iterator cppit = Option::cpp_ext.begin();
|
||||||
cppit != Option::cpp_ext.end(); ++cppit) {
|
cppit != Option::cpp_ext.end(); ++cppit) {
|
||||||
if((*it).endsWith((*cppit))) {
|
if((*it).endsWith((*cppit))) {
|
||||||
d_file = (*it).left((*it).length() - (*cppit).length()).toQString();
|
d_file = (*it).left((*it).length() - (*cppit).size()).toQString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -388,7 +388,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
//incremental target
|
//incremental target
|
||||||
QString incr_target = var("TARGET") + "_incremental";
|
QString incr_target = var("TARGET") + "_incremental";
|
||||||
if(incr_target.indexOf(Option::dir_sep) != -1)
|
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));
|
(incr_target.lastIndexOf(Option::dir_sep) + 1));
|
||||||
QString incr_deps, incr_objs;
|
QString incr_deps, incr_objs;
|
||||||
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
|
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
|
||||||
@ -489,7 +489,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
QString incr_target = var("QMAKE_ORIG_TARGET").replace(
|
QString incr_target = var("QMAKE_ORIG_TARGET").replace(
|
||||||
QRegularExpression("\\." + s_ext), "").replace(QRegularExpression("^lib"), "") + "_incremental";
|
QRegularExpression("\\." + s_ext), "").replace(QRegularExpression("^lib"), "") + "_incremental";
|
||||||
if(incr_target.indexOf(Option::dir_sep) != -1)
|
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));
|
(incr_target.lastIndexOf(Option::dir_sep) + 1));
|
||||||
|
|
||||||
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
|
if(project->first("QMAKE_INCREMENTAL_STYLE") == "ld") {
|
||||||
@ -1395,7 +1395,7 @@ UnixMakefileGenerator::libtoolFileName(bool fixify)
|
|||||||
QString ret = var("TARGET");
|
QString ret = var("TARGET");
|
||||||
int slsh = ret.lastIndexOf(Option::dir_sep);
|
int slsh = ret.lastIndexOf(Option::dir_sep);
|
||||||
if(slsh != -1)
|
if(slsh != -1)
|
||||||
ret = ret.right(ret.length() - slsh - 1);
|
ret = ret.right(ret.size() - slsh - 1);
|
||||||
int dot = ret.indexOf('.');
|
int dot = ret.indexOf('.');
|
||||||
if(dot != -1)
|
if(dot != -1)
|
||||||
ret = ret.left(dot);
|
ret = ret.left(dot);
|
||||||
@ -1465,7 +1465,7 @@ UnixMakefileGenerator::writeLibtoolFile()
|
|||||||
mkdir(fileInfo(fname).path());
|
mkdir(fileInfo(fname).path());
|
||||||
int slsh = lname.lastIndexOf(Option::dir_sep);
|
int slsh = lname.lastIndexOf(Option::dir_sep);
|
||||||
if(slsh != -1)
|
if(slsh != -1)
|
||||||
lname = lname.right(lname.length() - slsh - 1);
|
lname = lname.right(lname.size() - slsh - 1);
|
||||||
QFile ft(fname);
|
QFile ft(fname);
|
||||||
if(!ft.open(QIODevice::WriteOnly))
|
if(!ft.open(QIODevice::WriteOnly))
|
||||||
return;
|
return;
|
||||||
@ -1495,7 +1495,7 @@ UnixMakefileGenerator::writeLibtoolFile()
|
|||||||
t << "'\n\n";
|
t << "'\n\n";
|
||||||
|
|
||||||
t << "# The name of the static archive.\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";
|
<< ".a'\n\n";
|
||||||
|
|
||||||
t << "# Libraries that this one depends upon.\n";
|
t << "# Libraries that this one depends upon.\n";
|
||||||
|
@ -574,7 +574,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool)
|
|||||||
|
|
||||||
void VCXProjectWriter::write(XmlOutput &xml, VCProject &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");
|
warn_msg(WarnLogic, "Generator: .NET: no single project in merge project, no output");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -589,7 +589,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
|
|||||||
<< tag("ItemGroup")
|
<< tag("ItemGroup")
|
||||||
<< attrTag("Label", "ProjectConfigurations");
|
<< attrTag("Label", "ProjectConfigurations");
|
||||||
|
|
||||||
for (int i = 0; i < tool.SingleProjects.count(); ++i) {
|
for (int i = 0; i < tool.SingleProjects.size(); ++i) {
|
||||||
xml << tag("ProjectConfiguration")
|
xml << tag("ProjectConfiguration")
|
||||||
<< attrTag("Include" , tool.SingleProjects.at(i).Configuration.Name)
|
<< attrTag("Include" , tool.SingleProjects.at(i).Configuration.Name)
|
||||||
<< tagValue("Configuration", tool.SingleProjects.at(i).Configuration.ConfigurationName)
|
<< tagValue("Configuration", tool.SingleProjects.at(i).Configuration.ConfigurationName)
|
||||||
@ -613,7 +613,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
|
|||||||
|
|
||||||
// config part.
|
// config part.
|
||||||
xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
|
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);
|
write(xml, tool.SingleProjects.at(i).Configuration);
|
||||||
xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");
|
xml << import("Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
|
|||||||
<< closetag();
|
<< closetag();
|
||||||
|
|
||||||
// PropertySheets
|
// PropertySheets
|
||||||
for (int i = 0; i < tool.SingleProjects.count(); ++i) {
|
for (int i = 0; i < tool.SingleProjects.size(); ++i) {
|
||||||
xml << tag("ImportGroup")
|
xml << tag("ImportGroup")
|
||||||
<< attrTag("Condition", generateCondition(tool.SingleProjects.at(i).Configuration))
|
<< attrTag("Condition", generateCondition(tool.SingleProjects.at(i).Configuration))
|
||||||
<< attrTag("Label", "PropertySheets");
|
<< attrTag("Label", "PropertySheets");
|
||||||
@ -641,7 +641,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
|
|||||||
<< closetag();
|
<< closetag();
|
||||||
|
|
||||||
xml << tag("PropertyGroup");
|
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 VCConfiguration &config = tool.SingleProjects.at(i).Configuration;
|
||||||
const QString condition = generateCondition(config);
|
const QString condition = generateCondition(config);
|
||||||
|
|
||||||
@ -708,7 +708,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
|
|||||||
}
|
}
|
||||||
xml << closetag();
|
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;
|
const VCConfiguration &config = tool.SingleProjects.at(i).Configuration;
|
||||||
|
|
||||||
xml << tag("ItemDefinitionGroup")
|
xml << tag("ItemDefinitionGroup")
|
||||||
@ -1737,7 +1737,7 @@ void VCXProjectWriter::addFilters(VCProject &project, XmlOutput &xmlFilter, cons
|
|||||||
{
|
{
|
||||||
bool added = false;
|
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);
|
const VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
|
||||||
if(!filter.Files.isEmpty() && !added) {
|
if(!filter.Files.isEmpty() && !added) {
|
||||||
xmlFilter << tag("Filter")
|
xmlFilter << tag("Filter")
|
||||||
@ -1759,10 +1759,10 @@ void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutpu
|
|||||||
else
|
else
|
||||||
root.reset(new XTreeNode);
|
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);
|
const VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
|
||||||
// Merge all files in this filter to root tree
|
// 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));
|
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.
|
// 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"
|
// If there is one then it has to be included with "CustomBuild Include"
|
||||||
bool hasCustomBuildStep = false;
|
bool hasCustomBuildStep = false;
|
||||||
QVarLengthArray<OutputFilterData> data(project.SingleProjects.count());
|
QVarLengthArray<OutputFilterData> data(project.SingleProjects.size());
|
||||||
for (int i = 0; i < project.SingleProjects.count(); ++i) {
|
for (int i = 0; i < project.SingleProjects.size(); ++i) {
|
||||||
data[i].filter = project.SingleProjects.at(i).filterByName(cleanFilterName);
|
data[i].filter = project.SingleProjects.at(i).filterByName(cleanFilterName);
|
||||||
if (!data[i].filter.Config) // only if the filter is not empty
|
if (!data[i].filter.Config) // only if the filter is not empty
|
||||||
continue;
|
continue;
|
||||||
@ -1812,7 +1812,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool fileAdded = false;
|
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];
|
OutputFilterData *d = &data[i];
|
||||||
if (!d->filter.Config) // only if the filter is not empty
|
if (!d->filter.Config) // only if the filter is not empty
|
||||||
continue;
|
continue;
|
||||||
|
@ -290,7 +290,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
|
|||||||
for (int y = 0; directories[y]; y++) {
|
for (int y = 0; directories[y]; y++) {
|
||||||
QString dirTemp = project->first(directories[y]).toQString();
|
QString dirTemp = project->first(directories[y]).toQString();
|
||||||
if (dirTemp.endsWith("\\"))
|
if (dirTemp.endsWith("\\"))
|
||||||
dirTemp.truncate(dirTemp.length()-1);
|
dirTemp.truncate(dirTemp.size()-1);
|
||||||
if(!dirTemp.isEmpty())
|
if(!dirTemp.isEmpty())
|
||||||
source_directories.insert(dirTemp);
|
source_directories.insert(dirTemp);
|
||||||
}
|
}
|
||||||
|
@ -2304,7 +2304,7 @@ void VCFilter::modifyPCHstage(QString str)
|
|||||||
|
|
||||||
VCFilterFile VCFilter::findFile(const QString &filePath, bool *found) const
|
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);
|
const VCFilterFile &f = Files.at(i);
|
||||||
if (f.file == filePath) {
|
if (f.file == filePath) {
|
||||||
*found = true;
|
*found = true;
|
||||||
@ -2330,7 +2330,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
|
|||||||
hasBuiltIn = Project->hasBuiltinCompiler(objectMappedFile);
|
hasBuiltIn = Project->hasBuiltinCompiler(objectMappedFile);
|
||||||
|
|
||||||
// Remove the fake file suffix we've added initially to generate correct command lines.
|
// 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(' ')));
|
// 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)
|
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");
|
warn_msg(WarnLogic, "Generator: .NET: no single project in merge project, no output");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2615,7 +2615,7 @@ void VCProjectWriter::write(XmlOutput &xml, VCProject &tool)
|
|||||||
<< closetag(_Platforms)
|
<< closetag(_Platforms)
|
||||||
<< tag(_Configurations);
|
<< tag(_Configurations);
|
||||||
// Output each configuration
|
// 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);
|
write(xml, tool.SingleProjects.at(i).Configuration);
|
||||||
xml << closetag(_Configurations)
|
xml << closetag(_Configurations)
|
||||||
<< tag(q_Files);
|
<< tag(q_Files);
|
||||||
@ -2930,7 +2930,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool)
|
|||||||
|
|
||||||
void VCProjectWriter::write(XmlOutput &xml, VCFilter &tool)
|
void VCProjectWriter::write(XmlOutput &xml, VCFilter &tool)
|
||||||
{
|
{
|
||||||
if(!tool.Files.count())
|
if(!tool.Files.size())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!tool.Name.isEmpty()) {
|
if (!tool.Name.isEmpty()) {
|
||||||
@ -2940,7 +2940,7 @@ void VCProjectWriter::write(XmlOutput &xml, VCFilter &tool)
|
|||||||
<< attrS(_UniqueIdentifier, tool.Guid)
|
<< attrS(_UniqueIdentifier, tool.Guid)
|
||||||
<< attrT(_ParseFiles, tool.ParseFiles);
|
<< 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);
|
const VCFilterFile &info = tool.Files.at(i);
|
||||||
xml << tag(q_File)
|
xml << tag(q_File)
|
||||||
<< attrS(_RelativePath, Option::fixPathToTargetOS(info.file))
|
<< attrS(_RelativePath, Option::fixPathToTargetOS(info.file))
|
||||||
@ -2964,11 +2964,11 @@ void VCProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, const QSt
|
|||||||
QString name, extfilter, guid;
|
QString name, extfilter, guid;
|
||||||
triState parse = unset;
|
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);
|
const VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
|
||||||
|
|
||||||
// Merge all files in this filter to root tree
|
// 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));
|
root->addElement(filter.Files.at(x));
|
||||||
|
|
||||||
// Save filter setting from first filter. Next filters
|
// Save filter setting from first filter. Next filters
|
||||||
@ -3003,7 +3003,7 @@ void VCProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, cons
|
|||||||
{
|
{
|
||||||
xml << tag(q_File)
|
xml << tag(q_File)
|
||||||
<< attrS(_RelativePath, Option::fixPathToTargetOS(info.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);
|
VCFilter filter = project.SingleProjects.at(i).filterByName(filtername);
|
||||||
if (filter.Config) // only if the filter is not empty
|
if (filter.Config) // only if the filter is not empty
|
||||||
outputFileConfig(filter, xml, info.file);
|
outputFileConfig(filter, xml, info.file);
|
||||||
|
@ -142,14 +142,14 @@ bool VcprojGenerator::writeProjectMakefile()
|
|||||||
// Generate project file
|
// Generate project file
|
||||||
if(project->first("TEMPLATE") == "vcapp" ||
|
if(project->first("TEMPLATE") == "vcapp" ||
|
||||||
project->first("TEMPLATE") == "vclib") {
|
project->first("TEMPLATE") == "vclib") {
|
||||||
if (!mergedProjects.count()) {
|
if (!mergedProjects.size()) {
|
||||||
warn_msg(WarnLogic, "Generator: MSVC.NET: no single configuration created, cannot output project!");
|
warn_msg(WarnLogic, "Generator: MSVC.NET: no single configuration created, cannot output project!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug_msg(1, "Generator: MSVC.NET: Writing project file");
|
debug_msg(1, "Generator: MSVC.NET: Writing project file");
|
||||||
VCProject mergedProject;
|
VCProject mergedProject;
|
||||||
for (int i = 0; i < mergedProjects.count(); ++i) {
|
for (int i = 0; i < mergedProjects.size(); ++i) {
|
||||||
VCProjectSingleConfig *singleProject = &(mergedProjects.at(i)->vcProject);
|
VCProjectSingleConfig *singleProject = &(mergedProjects.at(i)->vcProject);
|
||||||
mergedProject.SingleProjects += *singleProject;
|
mergedProject.SingleProjects += *singleProject;
|
||||||
for (int j = 0; j < singleProject->ExtraCompilersFiles.count(); ++j) {
|
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(0)->vcProject.Name ==
|
||||||
mergedProjects.at(1)->vcProject.Name)
|
mergedProjects.at(1)->vcProject.Name)
|
||||||
mergedProjects.at(0)->writePrlFile();
|
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();
|
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.
|
// We want to store it as the .lib name.
|
||||||
if (newDep->target.endsWith(".dll"))
|
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);
|
projGuids.insert(newDep->projectName, newDep->target);
|
||||||
|
|
||||||
if (tmpList.size()) {
|
if (tmpList.size()) {
|
||||||
@ -1213,7 +1213,7 @@ void VcprojGenerator::initDeploymentTool()
|
|||||||
continue;
|
continue;
|
||||||
// We want to deploy .dlls not .libs
|
// We want to deploy .dlls not .libs
|
||||||
if (dllName.endsWith(QLatin1String(".lib")))
|
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
|
// 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);
|
dllName.remove(0, dllName.lastIndexOf(QLatin1Char('/')) + 1);
|
||||||
QFileInfo info;
|
QFileInfo info;
|
||||||
|
@ -479,8 +479,8 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
|
|||||||
const int commandlineLimit = 2047; // NT limit, expanded
|
const int commandlineLimit = 2047; // NT limit, expanded
|
||||||
for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
|
for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
|
||||||
file = ' ' + escapeFilePath(Option::fixPathToTargetOS((*it).toQString()));
|
file = ' ' + escapeFilePath(Option::fixPathToTargetOS((*it).toQString()));
|
||||||
if(del_statement.length() + files.length() +
|
if(del_statement.size() + files.size() +
|
||||||
qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
|
qMax(fixEnvVariables(file).size(), file.size()) > commandlineLimit) {
|
||||||
t << "\n\t" << del_statement << files;
|
t << "\n\t" << del_statement << files;
|
||||||
files.clear();
|
files.clear();
|
||||||
}
|
}
|
||||||
@ -508,8 +508,8 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
|
|||||||
const int commandlineLimit = 2047; // NT limit, expanded
|
const int commandlineLimit = 2047; // NT limit, expanded
|
||||||
for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
|
for (ProStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
|
||||||
file = " " + escapeFilePath(Option::fixPathToTargetOS((*it).toQString()));
|
file = " " + escapeFilePath(Option::fixPathToTargetOS((*it).toQString()));
|
||||||
if(del_statement.length() + files.length() +
|
if(del_statement.size() + files.size() +
|
||||||
qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
|
qMax(fixEnvVariables(file).size(), file.size()) > commandlineLimit) {
|
||||||
t << "\n\t" << del_statement << files;
|
t << "\n\t" << del_statement << files;
|
||||||
files.clear();
|
files.clear();
|
||||||
}
|
}
|
||||||
@ -749,7 +749,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
|
|||||||
QString dst_prl = Option::fixPathToTargetOS(project->first("QMAKE_INTERNAL_PRL_FILE").toQString());
|
QString dst_prl = Option::fixPathToTargetOS(project->first("QMAKE_INTERNAL_PRL_FILE").toQString());
|
||||||
int slsh = dst_prl.lastIndexOf(Option::dir_sep);
|
int slsh = dst_prl.lastIndexOf(Option::dir_sep);
|
||||||
if(slsh != -1)
|
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);
|
dst_prl = filePrefixRoot(root, targetdir + dst_prl);
|
||||||
if (!ret.isEmpty())
|
if (!ret.isEmpty())
|
||||||
ret += "\n\t";
|
ret += "\n\t";
|
||||||
|
@ -240,9 +240,9 @@ void XmlOutput::closeTag()
|
|||||||
{
|
{
|
||||||
switch(currentState) {
|
switch(currentState) {
|
||||||
case Bare:
|
case Bare:
|
||||||
if (tagStack.count())
|
if (tagStack.size())
|
||||||
//warn_msg(WarnLogic, "<Root>: Cannot close tag in Bare state, %d tags on stack", tagStack.count());
|
//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
|
else
|
||||||
//warn_msg(WarnLogic, "<Root>: Cannot close tag, no tags on stack");
|
//warn_msg(WarnLogic, "<Root>: Cannot close tag, no tags on stack");
|
||||||
qDebug("<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());
|
qDebug("<%s>: Cannot close to tag <%s>, not on stack", tagStack.last().toLatin1().constData(), tag.toLatin1().constData());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int left = tagStack.count();
|
int left = tagStack.size();
|
||||||
while (left-- && cont) {
|
while (left-- && cont) {
|
||||||
cont = tagStack.last().compare(tag) != 0;
|
cont = tagStack.last().compare(tag) != 0;
|
||||||
closeTag();
|
closeTag();
|
||||||
@ -280,7 +280,7 @@ void XmlOutput::closeTo(const QString &tag)
|
|||||||
|
|
||||||
void XmlOutput::closeAll()
|
void XmlOutput::closeAll()
|
||||||
{
|
{
|
||||||
if (!tagStack.count())
|
if (!tagStack.size())
|
||||||
return;
|
return;
|
||||||
closeTo(QString());
|
closeTo(QString());
|
||||||
}
|
}
|
||||||
@ -315,7 +315,7 @@ void XmlOutput::addAttribute(const QString &attribute, const QString &value)
|
|||||||
case Tag:
|
case Tag:
|
||||||
//warn_msg(WarnLogic, "<%s>: Cannot add attribute since tags not open", tagStack.last().toLatin1().constData());
|
//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",
|
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());
|
attribute.toLatin1().constData());
|
||||||
return;
|
return;
|
||||||
case Attribute:
|
case Attribute:
|
||||||
@ -333,7 +333,7 @@ void XmlOutput::addAttributeTag(const QString &attribute, const QString &value)
|
|||||||
case Tag:
|
case Tag:
|
||||||
//warn_msg(WarnLogic, "<%s>: Cannot add attribute since tags not open", tagStack.last().toLatin1().constData());
|
//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",
|
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());
|
attribute.toLatin1().constData());
|
||||||
return;
|
return;
|
||||||
case Attribute:
|
case Attribute:
|
||||||
|
@ -136,7 +136,7 @@ bool isSpecialChar(ushort c, const uchar (&iqm)[16])
|
|||||||
inline static
|
inline static
|
||||||
bool hasSpecialChars(const QString &arg, const uchar (&iqm)[16])
|
bool hasSpecialChars(const QString &arg, const uchar (&iqm)[16])
|
||||||
{
|
{
|
||||||
for (int x = arg.length() - 1; x >= 0; --x) {
|
for (int x = arg.size() - 1; x >= 0; --x) {
|
||||||
if (isSpecialChar(arg.unicode()[x].unicode(), iqm))
|
if (isSpecialChar(arg.unicode()[x].unicode(), iqm))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ QString IoUtils::shellQuoteUnix(const QString &arg)
|
|||||||
0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x78
|
0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x78
|
||||||
}; // 0-32 \'"$`<>|;&(){}*?#!~[]
|
}; // 0-32 \'"$`<>|;&(){}*?#!~[]
|
||||||
|
|
||||||
if (!arg.length())
|
if (!arg.size())
|
||||||
return QString::fromLatin1("''");
|
return QString::fromLatin1("''");
|
||||||
|
|
||||||
QString ret(arg);
|
QString ret(arg);
|
||||||
@ -179,7 +179,7 @@ QString IoUtils::shellQuoteWin(const QString &arg)
|
|||||||
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10
|
0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10
|
||||||
}; // &()<>^|
|
}; // &()<>^|
|
||||||
|
|
||||||
if (!arg.length())
|
if (!arg.size())
|
||||||
return QString::fromLatin1("\"\"");
|
return QString::fromLatin1("\"\"");
|
||||||
|
|
||||||
QString ret(arg);
|
QString ret(arg);
|
||||||
@ -195,7 +195,7 @@ QString IoUtils::shellQuoteWin(const QString &arg)
|
|||||||
// to the called process verbatim. In the unquoted state, the circumflex escapes
|
// to the called process verbatim. In the unquoted state, the circumflex escapes
|
||||||
// meta chars (including itself and quotes), and is removed from the command.
|
// meta chars (including itself and quotes), and is removed from the command.
|
||||||
bool quoted = true;
|
bool quoted = true;
|
||||||
for (int i = 0; i < ret.length(); i++) {
|
for (int i = 0; i < ret.size(); i++) {
|
||||||
QChar c = ret.unicode()[i];
|
QChar c = ret.unicode()[i];
|
||||||
if (c.unicode() == '"')
|
if (c.unicode() == '"')
|
||||||
quoted = !quoted;
|
quoted = !quoted;
|
||||||
|
@ -40,13 +40,13 @@ ProString::ProString(const ProString &other, OmitPreHashing) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProString::ProString(const QString &str, DoPreHashing) :
|
ProString::ProString(const QString &str, DoPreHashing) :
|
||||||
m_string(str), m_offset(0), m_length(str.length()), m_file(0)
|
m_string(str), m_offset(0), m_length(str.size()), m_file(0)
|
||||||
{
|
{
|
||||||
updatedHash();
|
updatedHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProString::ProString(const QString &str) :
|
ProString::ProString(const QString &str) :
|
||||||
m_string(str), m_offset(0), m_length(str.length()), m_file(0), m_hash(0x80000000)
|
m_string(str), m_offset(0), m_length(str.size()), m_file(0), m_hash(0x80000000)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ ProString::ProString(const QString &str, int offset, int length) :
|
|||||||
|
|
||||||
void ProString::setValue(const QString &str)
|
void ProString::setValue(const QString &str)
|
||||||
{
|
{
|
||||||
m_string = str, m_offset = 0, m_length = str.length(), m_hash = 0x80000000;
|
m_string = str, m_offset = 0, m_length = str.size(), m_hash = 0x80000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ProString::updatedHash() const
|
size_t ProString::updatedHash() const
|
||||||
@ -121,7 +121,7 @@ ProKey::ProKey(const QString &str, int off, int len, uint hash) :
|
|||||||
|
|
||||||
void ProKey::setValue(const QString &str)
|
void ProKey::setValue(const QString &str)
|
||||||
{
|
{
|
||||||
m_string = str, m_offset = 0, m_length = str.length();
|
m_string = str, m_offset = 0, m_length = str.size();
|
||||||
updatedHash();
|
updatedHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ ProString &ProString::prepend(const ProString &other)
|
|||||||
} else {
|
} else {
|
||||||
m_string = other.toQStringView() + toQStringView();
|
m_string = other.toQStringView() + toQStringView();
|
||||||
m_offset = 0;
|
m_offset = 0;
|
||||||
m_length = m_string.length();
|
m_length = m_string.size();
|
||||||
if (!m_file)
|
if (!m_file)
|
||||||
m_file = other.m_file;
|
m_file = other.m_file;
|
||||||
m_hash = 0x80000000;
|
m_hash = 0x80000000;
|
||||||
@ -156,10 +156,10 @@ ProString &ProString::prepend(const ProString &other)
|
|||||||
ProString &ProString::append(const QLatin1String other)
|
ProString &ProString::append(const QLatin1String other)
|
||||||
{
|
{
|
||||||
if (other.size()) {
|
if (other.size()) {
|
||||||
if (m_length != m_string.length()) {
|
if (m_length != m_string.size()) {
|
||||||
m_string = toQStringView() + other;
|
m_string = toQStringView() + other;
|
||||||
m_offset = 0;
|
m_offset = 0;
|
||||||
m_length = m_string.length();
|
m_length = m_string.size();
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT(m_offset == 0);
|
Q_ASSERT(m_offset == 0);
|
||||||
m_string.append(other);
|
m_string.append(other);
|
||||||
@ -172,10 +172,10 @@ ProString &ProString::append(const QLatin1String other)
|
|||||||
|
|
||||||
ProString &ProString::append(QChar other)
|
ProString &ProString::append(QChar other)
|
||||||
{
|
{
|
||||||
if (m_length != m_string.length()) {
|
if (m_length != m_string.size()) {
|
||||||
m_string = toQStringView() + other;
|
m_string = toQStringView() + other;
|
||||||
m_offset = 0;
|
m_offset = 0;
|
||||||
m_length = m_string.length();
|
m_length = m_string.size();
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT(m_offset == 0);
|
Q_ASSERT(m_offset == 0);
|
||||||
m_string.append(other);
|
m_string.append(other);
|
||||||
@ -192,14 +192,14 @@ ProString &ProString::append(const ProString &other, bool *pending)
|
|||||||
if (!m_length) {
|
if (!m_length) {
|
||||||
*this = other;
|
*this = other;
|
||||||
} else {
|
} else {
|
||||||
if (m_length != m_string.length())
|
if (m_length != m_string.size())
|
||||||
m_string = toQString();
|
m_string = toQString();
|
||||||
if (pending && !*pending) {
|
if (pending && !*pending) {
|
||||||
m_string += QLatin1Char(' ') + other.toQStringView();
|
m_string += QLatin1Char(' ') + other.toQStringView();
|
||||||
} else {
|
} else {
|
||||||
m_string += other.toQStringView();
|
m_string += other.toQStringView();
|
||||||
}
|
}
|
||||||
m_length = m_string.length();
|
m_length = m_string.size();
|
||||||
m_offset = 0;
|
m_offset = 0;
|
||||||
if (other.m_file)
|
if (other.m_file)
|
||||||
m_file = other.m_file;
|
m_file = other.m_file;
|
||||||
@ -242,7 +242,7 @@ ProString &ProString::append(const ProStringList &other, bool *pending, bool ski
|
|||||||
const ProString &str = other.at(i);
|
const ProString &str = other.at(i);
|
||||||
m_string += str.toQStringView();
|
m_string += str.toQStringView();
|
||||||
}
|
}
|
||||||
m_length = m_string.length();
|
m_length = m_string.size();
|
||||||
if (other.last().m_file)
|
if (other.last().m_file)
|
||||||
m_file = other.last().m_file;
|
m_file = other.last().m_file;
|
||||||
m_hash = 0x80000000;
|
m_hash = 0x80000000;
|
||||||
|
@ -687,7 +687,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
outstr = QLatin1Char(' ');
|
outstr = QLatin1Char(' ');
|
||||||
}
|
}
|
||||||
QString numstr = QString::number(num, obase);
|
QString numstr = QString::number(num, obase);
|
||||||
int space = width - outstr.length() - numstr.length();
|
int space = width - outstr.size() - numstr.size();
|
||||||
if (space <= 0) {
|
if (space <= 0) {
|
||||||
outstr += numstr;
|
outstr += numstr;
|
||||||
} else if (leftalign) {
|
} else if (leftalign) {
|
||||||
@ -936,7 +936,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
for (int i = 0; i < args.size(); ++i) {
|
for (int i = 0; i < args.size(); ++i) {
|
||||||
QString str = args.at(i).toQString();
|
QString str = args.at(i).toQString();
|
||||||
QChar *i_data = str.data();
|
QChar *i_data = str.data();
|
||||||
int i_len = str.length();
|
int i_len = str.size();
|
||||||
for (int x = 0; x < i_len; ++x) {
|
for (int x = 0; x < i_len; ++x) {
|
||||||
if (*(i_data+x) == QLatin1Char('\\') && x < i_len-1) {
|
if (*(i_data+x) == QLatin1Char('\\') && x < i_len-1) {
|
||||||
if (*(i_data+x+1) == QLatin1Char('\\')) {
|
if (*(i_data+x+1) == QLatin1Char('\\')) {
|
||||||
@ -988,7 +988,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
rstr = rstr.toUpper();
|
rstr = rstr.toUpper();
|
||||||
} else {
|
} else {
|
||||||
rstr = rstr.toLower();
|
rstr = rstr.toLower();
|
||||||
if (func_t == E_TITLE && rstr.length() > 0)
|
if (func_t == E_TITLE && rstr.size() > 0)
|
||||||
rstr[0] = rstr.at(0).toTitleCase();
|
rstr[0] = rstr.at(0).toTitleCase();
|
||||||
}
|
}
|
||||||
ret << u1.extract(rstr);
|
ret << u1.extract(rstr);
|
||||||
@ -1569,7 +1569,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
const ProStringList &configs = values(statics.strCONFIG);
|
const ProStringList &configs = values(statics.strCONFIG);
|
||||||
|
|
||||||
for (int i = configs.size() - 1; i >= 0; i--) {
|
for (int i = configs.size() - 1; i >= 0; i--) {
|
||||||
for (int mut = 0; mut < mutuals.count(); mut++) {
|
for (int mut = 0; mut < mutuals.size(); mut++) {
|
||||||
if (configs[i].toQStringView() == mutuals[mut].trimmed())
|
if (configs[i].toQStringView() == mutuals[mut].trimmed())
|
||||||
return returnBool(configs[i] == args[0]);
|
return returnBool(configs[i] == args[0]);
|
||||||
}
|
}
|
||||||
@ -1605,7 +1605,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
|
|||||||
Qt::SkipEmptyParts);
|
Qt::SkipEmptyParts);
|
||||||
for (int i = l.size() - 1; i >= 0; i--) {
|
for (int i = l.size() - 1; i >= 0; i--) {
|
||||||
const ProString &val = l[i];
|
const ProString &val = l[i];
|
||||||
for (int mut = 0; mut < mutuals.count(); mut++) {
|
for (int mut = 0; mut < mutuals.size(); mut++) {
|
||||||
if (val.toQStringView() == mutuals[mut].trimmed()) {
|
if (val.toQStringView() == mutuals[mut].trimmed()) {
|
||||||
if (val == qry)
|
if (val == qry)
|
||||||
return ReturnTrue;
|
return ReturnTrue;
|
||||||
|
@ -859,13 +859,13 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable(
|
|||||||
}
|
}
|
||||||
QChar sep = val.at(1);
|
QChar sep = val.at(1);
|
||||||
auto func = val.split(sep, Qt::KeepEmptyParts);
|
auto func = val.split(sep, Qt::KeepEmptyParts);
|
||||||
if (func.count() < 3 || func.count() > 4) {
|
if (func.size() < 3 || func.size() > 4) {
|
||||||
evalError(fL1S("The s/// function expects 3 or 4 arguments."));
|
evalError(fL1S("The s/// function expects 3 or 4 arguments."));
|
||||||
return ReturnTrue;
|
return ReturnTrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool global = false, quote = false, case_sense = false;
|
bool global = false, quote = false, case_sense = false;
|
||||||
if (func.count() == 4) {
|
if (func.size() == 4) {
|
||||||
global = func[3].indexOf(QLatin1Char('g')) != -1;
|
global = func[3].indexOf(QLatin1Char('g')) != -1;
|
||||||
case_sense = func[3].indexOf(QLatin1Char('i')) == -1;
|
case_sense = func[3].indexOf(QLatin1Char('i')) == -1;
|
||||||
quote = func[3].indexOf(QLatin1Char('q')) != -1;
|
quote = func[3].indexOf(QLatin1Char('q')) != -1;
|
||||||
@ -1570,7 +1570,7 @@ ProString QMakeEvaluator::propertyValue(const ProKey &name) const
|
|||||||
|
|
||||||
ProFile *QMakeEvaluator::currentProFile() const
|
ProFile *QMakeEvaluator::currentProFile() const
|
||||||
{
|
{
|
||||||
if (m_profileStack.count() > 0)
|
if (m_profileStack.size() > 0)
|
||||||
return m_profileStack.top();
|
return m_profileStack.top();
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -1693,12 +1693,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFunction(
|
|||||||
m_locationStack.push(m_current);
|
m_locationStack.push(m_current);
|
||||||
|
|
||||||
ProStringList args;
|
ProStringList args;
|
||||||
for (int i = 0; i < argumentsList.count(); ++i) {
|
for (int i = 0; i < argumentsList.size(); ++i) {
|
||||||
args += argumentsList[i];
|
args += argumentsList[i];
|
||||||
m_valuemapStack.top()[ProKey(QString::number(i+1))] = argumentsList[i];
|
m_valuemapStack.top()[ProKey(QString::number(i+1))] = argumentsList[i];
|
||||||
}
|
}
|
||||||
m_valuemapStack.top()[statics.strARGS] = args;
|
m_valuemapStack.top()[statics.strARGS] = args;
|
||||||
m_valuemapStack.top()[statics.strARGC] = ProStringList(ProString(QString::number(argumentsList.count())));
|
m_valuemapStack.top()[statics.strARGC] = ProStringList(ProString(QString::number(argumentsList.size())));
|
||||||
vr = visitProBlock(func.pro(), func.tokPtr());
|
vr = visitProBlock(func.pro(), func.tokPtr());
|
||||||
if (vr == ReturnReturn)
|
if (vr == ReturnReturn)
|
||||||
vr = ReturnTrue;
|
vr = ReturnTrue;
|
||||||
|
@ -213,8 +213,8 @@ void QMakeGlobals::setDirectories(const QString &input_dir, const QString &outpu
|
|||||||
QString dstpath = output_dir;
|
QString dstpath = output_dir;
|
||||||
if (!dstpath.endsWith(QLatin1Char('/')))
|
if (!dstpath.endsWith(QLatin1Char('/')))
|
||||||
dstpath += QLatin1Char('/');
|
dstpath += QLatin1Char('/');
|
||||||
int srcLen = srcpath.length();
|
int srcLen = srcpath.size();
|
||||||
int dstLen = dstpath.length();
|
int dstLen = dstpath.size();
|
||||||
int lastSl = -1;
|
int lastSl = -1;
|
||||||
while (++lastSl, --srcLen, --dstLen,
|
while (++lastSl, --srcLen, --dstLen,
|
||||||
srcLen && dstLen && srcpath.at(srcLen) == dstpath.at(dstLen))
|
srcLen && dstLen && srcpath.at(srcLen) == dstpath.at(dstLen))
|
||||||
@ -230,9 +230,9 @@ QString QMakeGlobals::shadowedPath(const QString &fileName) const
|
|||||||
if (source_root.isEmpty())
|
if (source_root.isEmpty())
|
||||||
return fileName;
|
return fileName;
|
||||||
if (fileName.startsWith(source_root)
|
if (fileName.startsWith(source_root)
|
||||||
&& (fileName.length() == source_root.length()
|
&& (fileName.size() == source_root.size()
|
||||||
|| fileName.at(source_root.length()) == QLatin1Char('/'))) {
|
|| fileName.at(source_root.size()) == QLatin1Char('/'))) {
|
||||||
return build_root + fileName.mid(source_root.length());
|
return build_root + fileName.mid(source_root.size());
|
||||||
}
|
}
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ QString QMakeGlobals::expandEnvVars(const QString &str) const
|
|||||||
startIndex = string.indexOf(QLatin1Char('$'), startIndex);
|
startIndex = string.indexOf(QLatin1Char('$'), startIndex);
|
||||||
if (startIndex < 0)
|
if (startIndex < 0)
|
||||||
break;
|
break;
|
||||||
if (string.length() < startIndex + 3)
|
if (string.size() < startIndex + 3)
|
||||||
break;
|
break;
|
||||||
if (string.at(startIndex + 1) != QLatin1Char('(')) {
|
if (string.at(startIndex + 1) != QLatin1Char('(')) {
|
||||||
startIndex++;
|
startIndex++;
|
||||||
@ -283,7 +283,7 @@ QString QMakeGlobals::expandEnvVars(const QString &str) const
|
|||||||
break;
|
break;
|
||||||
QString value = getEnv(string.mid(startIndex + 2, endIndex - startIndex - 2));
|
QString value = getEnv(string.mid(startIndex + 2, endIndex - startIndex - 2));
|
||||||
string.replace(startIndex, endIndex - startIndex + 1, value);
|
string.replace(startIndex, endIndex - startIndex + 1, value);
|
||||||
startIndex += value.length();
|
startIndex += value.size();
|
||||||
}
|
}
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
@ -732,7 +732,7 @@ void QMakeParser::read(ProFile *pro, QStringView in, int line, SubGrammar gramma
|
|||||||
if (!m_blockstack.top().braceLevel) {
|
if (!m_blockstack.top().braceLevel) {
|
||||||
parseError(fL1S("Excess closing brace."));
|
parseError(fL1S("Excess closing brace."));
|
||||||
} else if (!--m_blockstack.top().braceLevel
|
} else if (!--m_blockstack.top().braceLevel
|
||||||
&& m_blockstack.count() != 1) {
|
&& m_blockstack.size() != 1) {
|
||||||
leaveScope(tokPtr);
|
leaveScope(tokPtr);
|
||||||
m_state = StNew;
|
m_state = StNew;
|
||||||
m_canElse = false;
|
m_canElse = false;
|
||||||
@ -1246,7 +1246,7 @@ bool QMakeParser::resolveVariable(ushort *xprPtr, int tlen, int needSep, ushort
|
|||||||
// The string is typically longer than the variable reference, so we need
|
// The string is typically longer than the variable reference, so we need
|
||||||
// to ensure that there is enough space in the output buffer - as unlikely
|
// to ensure that there is enough space in the output buffer - as unlikely
|
||||||
// as an overflow is to actually happen in practice.
|
// as an overflow is to actually happen in practice.
|
||||||
int need = (in.length() - (cur - (const ushort *)in.constData()) + 2) * 5 + out.length();
|
int need = (in.length() - (cur - (const ushort *)in.constData()) + 2) * 5 + out.size();
|
||||||
int tused = *tokPtr - (ushort *)tokBuff->constData();
|
int tused = *tokPtr - (ushort *)tokBuff->constData();
|
||||||
int xused;
|
int xused;
|
||||||
int total;
|
int total;
|
||||||
@ -1277,9 +1277,9 @@ bool QMakeParser::resolveVariable(ushort *xprPtr, int tlen, int needSep, ushort
|
|||||||
}
|
}
|
||||||
xprPtr -= 2; // Was set up for variable reference
|
xprPtr -= 2; // Was set up for variable reference
|
||||||
xprPtr[-2] = TokLiteral | needSep;
|
xprPtr[-2] = TokLiteral | needSep;
|
||||||
xprPtr[-1] = out.length();
|
xprPtr[-1] = out.size();
|
||||||
memcpy(xprPtr, out.constData(), out.length() * 2);
|
memcpy(xprPtr, out.constData(), out.size() * 2);
|
||||||
*ptr = xprPtr + out.length();
|
*ptr = xprPtr + out.size();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1539,7 +1539,7 @@ QString QMakeParser::formatProBlock(const QString &block)
|
|||||||
QString outStr;
|
QString outStr;
|
||||||
outStr += fL1S("\n << TS(");
|
outStr += fL1S("\n << TS(");
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
getBlock(reinterpret_cast<const ushort *>(block.constData()), block.length(),
|
getBlock(reinterpret_cast<const ushort *>(block.constData()), block.size(),
|
||||||
offset, &outStr, 0);
|
offset, &outStr, 0);
|
||||||
outStr += QLatin1Char(')');
|
outStr += QLatin1Char(')');
|
||||||
return outStr;
|
return outStr;
|
||||||
|
@ -479,7 +479,7 @@ int runQMake(int argc, char **argv)
|
|||||||
|
|
||||||
Option::output_dir = dir.path();
|
Option::output_dir = dir.path();
|
||||||
QString absoluteFilePath = QDir::cleanPath(fi.absoluteFilePath());
|
QString absoluteFilePath = QDir::cleanPath(fi.absoluteFilePath());
|
||||||
Option::output.setFileName(absoluteFilePath.mid(Option::output_dir.length() + 1));
|
Option::output.setFileName(absoluteFilePath.mid(Option::output_dir.size() + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
QMakeProperty prop;
|
QMakeProperty prop;
|
||||||
@ -531,7 +531,7 @@ int runQMake(int argc, char **argv)
|
|||||||
if(!qmake_setpwd(fn.left(di)))
|
if(!qmake_setpwd(fn.left(di)))
|
||||||
fprintf(stderr, "Cannot find directory: %s\n",
|
fprintf(stderr, "Cannot find directory: %s\n",
|
||||||
QDir::toNativeSeparators(fn.left(di)).toLatin1().constData());
|
QDir::toNativeSeparators(fn.left(di)).toLatin1().constData());
|
||||||
fn = fn.right(fn.length() - di - 1);
|
fn = fn.right(fn.size() - di - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Option::prepareProject(fn);
|
Option::prepareProject(fn);
|
||||||
|
@ -77,7 +77,7 @@ static Option::QMAKE_MODE default_mode(QString progname)
|
|||||||
{
|
{
|
||||||
int s = progname.lastIndexOf(QDir::separator());
|
int s = progname.lastIndexOf(QDir::separator());
|
||||||
if(s != -1)
|
if(s != -1)
|
||||||
progname = progname.right(progname.length() - (s + 1));
|
progname = progname.right(progname.size() - (s + 1));
|
||||||
if(progname == "qmakegen")
|
if(progname == "qmakegen")
|
||||||
return Option::QMAKE_GENERATE_PROJECT;
|
return Option::QMAKE_GENERATE_PROJECT;
|
||||||
else if(progname == "qt-config")
|
else if(progname == "qt-config")
|
||||||
@ -465,7 +465,7 @@ bool Option::postProcessProject(QMakeProject *project)
|
|||||||
|
|
||||||
if (!project->buildRoot().isEmpty() && Option::output_dir.startsWith(project->buildRoot()))
|
if (!project->buildRoot().isEmpty() && Option::output_dir.startsWith(project->buildRoot()))
|
||||||
Option::mkfile::cachefile_depth =
|
Option::mkfile::cachefile_depth =
|
||||||
Option::output_dir.mid(project->buildRoot().length()).count('/');
|
Option::output_dir.mid(project->buildRoot().size()).count('/');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -528,7 +528,7 @@ Option::fixString(QString string, uchar flags)
|
|||||||
|
|
||||||
if ((string.startsWith("\"") && string.endsWith("\"")) ||
|
if ((string.startsWith("\"") && string.endsWith("\"")) ||
|
||||||
(string.startsWith("\'") && string.endsWith("\'")))
|
(string.startsWith("\'") && string.endsWith("\'")))
|
||||||
string = string.mid(1, string.length()-2);
|
string = string.mid(1, string.size()-2);
|
||||||
|
|
||||||
//cache
|
//cache
|
||||||
//qDebug() << "Fix" << orig_string << "->" << string;
|
//qDebug() << "Fix" << orig_string << "->" << string;
|
||||||
|
@ -10,7 +10,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
void qmakePropertyPrinter(const QList<QPair<QString, QString>> &values)
|
void qmakePropertyPrinter(const QList<QPair<QString, QString>> &values)
|
||||||
{
|
{
|
||||||
// Assume single property request
|
// Assume single property request
|
||||||
if (values.count() == 1) {
|
if (values.size() == 1) {
|
||||||
std::cout << qPrintable(values.at(0).second) << std::endl;
|
std::cout << qPrintable(values.at(0).second) << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ void QMakeLibraryInfo::sysrootify(QString &path)
|
|||||||
if (sysroot.isEmpty())
|
if (sysroot.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (path.length() > 2 && path.at(1) == QLatin1Char(':')
|
if (path.size() > 2 && path.at(1) == QLatin1Char(':')
|
||||||
&& (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) {
|
&& (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) {
|
||||||
path.replace(0, 2, sysroot); // Strip out the drive on Windows targets
|
path.replace(0, 2, sysroot); // Strip out the drive on Windows targets
|
||||||
} else {
|
} else {
|
||||||
@ -217,7 +217,7 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group
|
|||||||
startIndex = ret.indexOf(QLatin1Char('$'), startIndex);
|
startIndex = ret.indexOf(QLatin1Char('$'), startIndex);
|
||||||
if (startIndex < 0)
|
if (startIndex < 0)
|
||||||
break;
|
break;
|
||||||
if (ret.length() < startIndex + 3)
|
if (ret.size() < startIndex + 3)
|
||||||
break;
|
break;
|
||||||
if (ret.at(startIndex + 1) != QLatin1Char('(')) {
|
if (ret.at(startIndex + 1) != QLatin1Char('(')) {
|
||||||
startIndex++;
|
startIndex++;
|
||||||
@ -231,7 +231,7 @@ QString QMakeLibraryInfo::rawLocation(int loc, QMakeLibraryInfo::PathGroup group
|
|||||||
QString value =
|
QString value =
|
||||||
QString::fromLocal8Bit(qgetenv(envVarName.toLocal8Bit().constData()));
|
QString::fromLocal8Bit(qgetenv(envVarName.toLocal8Bit().constData()));
|
||||||
ret.replace(startIndex, endIndex - startIndex + 1, value);
|
ret.replace(startIndex, endIndex - startIndex + 1, value);
|
||||||
startIndex += value.length();
|
startIndex += value.size();
|
||||||
}
|
}
|
||||||
config->endGroup();
|
config->endGroup();
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ public:
|
|||||||
void reserveSpace(int resultCount)
|
void reserveSpace(int resultCount)
|
||||||
{
|
{
|
||||||
currentResultCount = resultCount;
|
currentResultCount = resultCount;
|
||||||
resizeList(qMax(resultCount, vector.count()));
|
resizeList(qMax(resultCount, vector.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void reportResults(int begin)
|
void reportResults(int begin)
|
||||||
|
@ -283,7 +283,7 @@ void QUnifiedTimer::updateAnimationTimers()
|
|||||||
QScopedValueRollback<bool> guard(insideTick, true);
|
QScopedValueRollback<bool> guard(insideTick, true);
|
||||||
if (profilerCallback)
|
if (profilerCallback)
|
||||||
profilerCallback(delta);
|
profilerCallback(delta);
|
||||||
for (currentAnimationIdx = 0; currentAnimationIdx < animationTimers.count(); ++currentAnimationIdx) {
|
for (currentAnimationIdx = 0; currentAnimationIdx < animationTimers.size(); ++currentAnimationIdx) {
|
||||||
QAbstractAnimationTimer *animation = animationTimers.at(currentAnimationIdx);
|
QAbstractAnimationTimer *animation = animationTimers.at(currentAnimationIdx);
|
||||||
animation->updateAnimationsTime(delta);
|
animation->updateAnimationsTime(delta);
|
||||||
}
|
}
|
||||||
@ -294,7 +294,7 @@ void QUnifiedTimer::updateAnimationTimers()
|
|||||||
int QUnifiedTimer::runningAnimationCount()
|
int QUnifiedTimer::runningAnimationCount()
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (int i = 0; i < animationTimers.count(); ++i)
|
for (int i = 0; i < animationTimers.size(); ++i)
|
||||||
count += animationTimers.at(i)->runningAnimationCount();
|
count += animationTimers.at(i)->runningAnimationCount();
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@ -309,7 +309,7 @@ void QUnifiedTimer::localRestart()
|
|||||||
if (insideRestart)
|
if (insideRestart)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!pausedAnimationTimers.isEmpty() && (animationTimers.count() + animationTimersToStart.count() == pausedAnimationTimers.count())) {
|
if (!pausedAnimationTimers.isEmpty() && (animationTimers.size() + animationTimersToStart.size() == pausedAnimationTimers.size())) {
|
||||||
driver->stop();
|
driver->stop();
|
||||||
int closestTimeToFinish = closestPausedAnimationTimerTimeToFinish();
|
int closestTimeToFinish = closestPausedAnimationTimerTimeToFinish();
|
||||||
// use a precise timer if the pause will be short
|
// use a precise timer if the pause will be short
|
||||||
@ -327,7 +327,7 @@ void QUnifiedTimer::restart()
|
|||||||
{
|
{
|
||||||
{
|
{
|
||||||
QScopedValueRollback<bool> guard(insideRestart, true);
|
QScopedValueRollback<bool> guard(insideRestart, true);
|
||||||
for (int i = 0; i < animationTimers.count(); ++i)
|
for (int i = 0; i < animationTimers.size(); ++i)
|
||||||
animationTimers.at(i)->restartAnimationTimer();
|
animationTimers.at(i)->restartAnimationTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,7 +568,7 @@ void QAnimationTimer::updateAnimationsTime(qint64 delta)
|
|||||||
//when the CPU load is high
|
//when the CPU load is high
|
||||||
if (delta) {
|
if (delta) {
|
||||||
QScopedValueRollback<bool> guard(insideTick, true);
|
QScopedValueRollback<bool> guard(insideTick, true);
|
||||||
for (currentAnimationIdx = 0; currentAnimationIdx < animations.count(); ++currentAnimationIdx) {
|
for (currentAnimationIdx = 0; currentAnimationIdx < animations.size(); ++currentAnimationIdx) {
|
||||||
QAbstractAnimation *animation = animations.at(currentAnimationIdx);
|
QAbstractAnimation *animation = animations.at(currentAnimationIdx);
|
||||||
int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime
|
int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime
|
||||||
+ (animation->direction() == QAbstractAnimation::Forward ? delta : -delta);
|
+ (animation->direction() == QAbstractAnimation::Forward ? delta : -delta);
|
||||||
|
@ -247,7 +247,7 @@ public:
|
|||||||
void updateAnimationsTime(qint64 delta) override;
|
void updateAnimationsTime(qint64 delta) override;
|
||||||
|
|
||||||
//useful for profiling/debugging
|
//useful for profiling/debugging
|
||||||
int runningAnimationCount() override { return animations.count(); }
|
int runningAnimationCount() override { return animations.size(); }
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void startAnimations();
|
void startAnimations();
|
||||||
|
@ -138,7 +138,7 @@ int QAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const
|
|||||||
void QAnimationGroup::addAnimation(QAbstractAnimation *animation)
|
void QAnimationGroup::addAnimation(QAbstractAnimation *animation)
|
||||||
{
|
{
|
||||||
Q_D(QAnimationGroup);
|
Q_D(QAnimationGroup);
|
||||||
insertAnimation(d->animations.count(), animation);
|
insertAnimation(d->animations.size(), animation);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -261,7 +261,7 @@ void QAnimationGroupPrivate::clear(bool onDestruction)
|
|||||||
const QList<QAbstractAnimation *> animationsCopy = animations; // taking a copy
|
const QList<QAbstractAnimation *> animationsCopy = animations; // taking a copy
|
||||||
animations.clear();
|
animations.clear();
|
||||||
// Clearing backwards so the indices doesn't change while we remove animations.
|
// Clearing backwards so the indices doesn't change while we remove animations.
|
||||||
for (int i = animationsCopy.count() - 1; i >= 0; --i) {
|
for (int i = animationsCopy.size() - 1; i >= 0; --i) {
|
||||||
QAbstractAnimation *animation = animationsCopy.at(i);
|
QAbstractAnimation *animation = animationsCopy.at(i);
|
||||||
animation->setParent(nullptr);
|
animation->setParent(nullptr);
|
||||||
QAbstractAnimationPrivate::get(animation)->group = nullptr;
|
QAbstractAnimationPrivate::get(animation)->group = nullptr;
|
||||||
|
@ -172,7 +172,7 @@ void QSequentialAnimationGroupPrivate::rewindForwards(const AnimationIndex &newA
|
|||||||
// we need to force activation because setCurrentAnimation will have no effect
|
// we need to force activation because setCurrentAnimation will have no effect
|
||||||
activateCurrentAnimation();
|
activateCurrentAnimation();
|
||||||
else
|
else
|
||||||
setCurrentAnimation(animations.count() - 1, true);
|
setCurrentAnimation(animations.size() - 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// and now we need to fast rewind from the current position to
|
// and now we need to fast rewind from the current position to
|
||||||
@ -396,7 +396,7 @@ void QSequentialAnimationGroupPrivate::setCurrentAnimation(int index, bool inter
|
|||||||
// currentAnimation.removeBindingUnlessInWrapper()
|
// currentAnimation.removeBindingUnlessInWrapper()
|
||||||
// is not necessary here, since it is read only
|
// is not necessary here, since it is read only
|
||||||
|
|
||||||
index = qMin(index, animations.count() - 1);
|
index = qMin(index, animations.size() - 1);
|
||||||
|
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
Q_ASSERT(animations.isEmpty());
|
Q_ASSERT(animations.isEmpty());
|
||||||
@ -517,7 +517,7 @@ void QSequentialAnimationGroupPrivate::animationRemoved(int index, QAbstractAnim
|
|||||||
|
|
||||||
disconnectUncontrolledAnimation(currentAnimation);
|
disconnectUncontrolledAnimation(currentAnimation);
|
||||||
|
|
||||||
if (index < animations.count())
|
if (index < animations.size())
|
||||||
setCurrentAnimation(index); //let's try to take the next one
|
setCurrentAnimation(index); //let's try to take the next one
|
||||||
else if (index > 0)
|
else if (index > 0)
|
||||||
setCurrentAnimation(index - 1);
|
setCurrentAnimation(index - 1);
|
||||||
|
@ -547,7 +547,7 @@ QString QLibraryInfoPrivate::path(QLibraryInfo::LibraryPath p, UsageMode usageMo
|
|||||||
startIndex = ret.indexOf(u'$', startIndex);
|
startIndex = ret.indexOf(u'$', startIndex);
|
||||||
if (startIndex < 0)
|
if (startIndex < 0)
|
||||||
break;
|
break;
|
||||||
if (ret.length() < startIndex + 3)
|
if (ret.size() < startIndex + 3)
|
||||||
break;
|
break;
|
||||||
if (ret.at(startIndex + 1) != u'(') {
|
if (ret.at(startIndex + 1) != u'(') {
|
||||||
startIndex++;
|
startIndex++;
|
||||||
@ -559,7 +559,7 @@ QString QLibraryInfoPrivate::path(QLibraryInfo::LibraryPath p, UsageMode usageMo
|
|||||||
auto envVarName = QStringView{ret}.mid(startIndex + 2, endIndex - startIndex - 2);
|
auto envVarName = QStringView{ret}.mid(startIndex + 2, endIndex - startIndex - 2);
|
||||||
QString value = QString::fromLocal8Bit(qgetenv(envVarName.toLocal8Bit().constData()));
|
QString value = QString::fromLocal8Bit(qgetenv(envVarName.toLocal8Bit().constData()));
|
||||||
ret.replace(startIndex, endIndex - startIndex + 1, value);
|
ret.replace(startIndex, endIndex - startIndex + 1, value);
|
||||||
startIndex += value.length();
|
startIndex += value.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
config->endGroup();
|
config->endGroup();
|
||||||
|
@ -1183,7 +1183,7 @@ void QMessagePattern::setPattern(const QString &pattern)
|
|||||||
tokens[i] = timeTokenC;
|
tokens[i] = timeTokenC;
|
||||||
int spaceIdx = lexeme.indexOf(QChar::fromLatin1(' '));
|
int spaceIdx = lexeme.indexOf(QChar::fromLatin1(' '));
|
||||||
if (spaceIdx > 0)
|
if (spaceIdx > 0)
|
||||||
timeArgs.append(lexeme.mid(spaceIdx + 1, lexeme.length() - spaceIdx - 2));
|
timeArgs.append(lexeme.mid(spaceIdx + 1, lexeme.size() - spaceIdx - 2));
|
||||||
else
|
else
|
||||||
timeArgs.append(QString());
|
timeArgs.append(QString());
|
||||||
} else if (lexeme.startsWith(QLatin1StringView(backtraceTokenC))) {
|
} else if (lexeme.startsWith(QLatin1StringView(backtraceTokenC))) {
|
||||||
|
@ -276,19 +276,19 @@ static bool readEtcFile(QUnixOSVersion &v, const char *filename,
|
|||||||
line.setRawData(ptr, eol - ptr);
|
line.setRawData(ptr, eol - ptr);
|
||||||
|
|
||||||
if (line.startsWith(idKey)) {
|
if (line.startsWith(idKey)) {
|
||||||
ptr += idKey.length();
|
ptr += idKey.size();
|
||||||
v.productType = unquote(ptr, eol);
|
v.productType = unquote(ptr, eol);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.startsWith(prettyNameKey)) {
|
if (line.startsWith(prettyNameKey)) {
|
||||||
ptr += prettyNameKey.length();
|
ptr += prettyNameKey.size();
|
||||||
v.prettyName = unquote(ptr, eol);
|
v.prettyName = unquote(ptr, eol);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.startsWith(versionKey)) {
|
if (line.startsWith(versionKey)) {
|
||||||
ptr += versionKey.length();
|
ptr += versionKey.size();
|
||||||
v.productVersion = unquote(ptr, eol);
|
v.productVersion = unquote(ptr, eol);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ static bool readEtcLsbRelease(QUnixOSVersion &v)
|
|||||||
int fd = qt_safe_open(distrorelease, O_RDONLY);
|
int fd = qt_safe_open(distrorelease, O_RDONLY);
|
||||||
if (fd != -1) {
|
if (fd != -1) {
|
||||||
QT_STATBUF sbuf;
|
QT_STATBUF sbuf;
|
||||||
if (QT_FSTAT(fd, &sbuf) != -1 && sbuf.st_size > v.prettyName.length()) {
|
if (QT_FSTAT(fd, &sbuf) != -1 && sbuf.st_size > v.prettyName.size()) {
|
||||||
// file apparently contains interesting information
|
// file apparently contains interesting information
|
||||||
QByteArray buffer(sbuf.st_size, Qt::Uninitialized);
|
QByteArray buffer(sbuf.st_size, Qt::Uninitialized);
|
||||||
buffer.resize(qt_safe_read(fd, buffer.data(), sbuf.st_size));
|
buffer.resize(qt_safe_read(fd, buffer.data(), sbuf.st_size));
|
||||||
|
@ -112,7 +112,7 @@ public:
|
|||||||
inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
|
inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
|
||||||
inline QDebug &operator<<(const char* t) { stream->ts << QString::fromUtf8(t); return maybeSpace(); }
|
inline QDebug &operator<<(const char* t) { stream->ts << QString::fromUtf8(t); return maybeSpace(); }
|
||||||
inline QDebug &operator<<(const char16_t *t) { stream->ts << QStringView(t); return maybeSpace(); }
|
inline QDebug &operator<<(const char16_t *t) { stream->ts << QStringView(t); return maybeSpace(); }
|
||||||
inline QDebug &operator<<(const QString & t) { putString(t.constData(), size_t(t.length())); return maybeSpace(); }
|
inline QDebug &operator<<(const QString & t) { putString(t.constData(), size_t(t.size())); return maybeSpace(); }
|
||||||
inline QDebug &operator<<(QStringView s) { putString(s.data(), size_t(s.size())); return maybeSpace(); }
|
inline QDebug &operator<<(QStringView s) { putString(s.data(), size_t(s.size())); return maybeSpace(); }
|
||||||
inline QDebug &operator<<(QUtf8StringView s) { putByteArray(reinterpret_cast<const char*>(s.data()), s.size(), ContainsBinary); return maybeSpace(); }
|
inline QDebug &operator<<(QUtf8StringView s) { putByteArray(reinterpret_cast<const char*>(s.data()), s.size(), ContainsBinary); return maybeSpace(); }
|
||||||
inline QDebug &operator<<(QLatin1StringView t) { putByteArray(t.latin1(), t.size(), ContainsLatin1); return maybeSpace(); }
|
inline QDebug &operator<<(QLatin1StringView t) { putByteArray(t.latin1(), t.size(), ContainsLatin1); return maybeSpace(); }
|
||||||
|
@ -144,12 +144,12 @@ inline void QDirPrivate::setPath(const QString &path)
|
|||||||
{
|
{
|
||||||
QString p = QDir::fromNativeSeparators(path);
|
QString p = QDir::fromNativeSeparators(path);
|
||||||
if (p.endsWith(u'/')
|
if (p.endsWith(u'/')
|
||||||
&& p.length() > 1
|
&& p.size() > 1
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
&& (!(p.length() == 3 && p.at(1).unicode() == ':' && p.at(0).isLetter()))
|
&& (!(p.length() == 3 && p.at(1).unicode() == ':' && p.at(0).isLetter()))
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
p.truncate(p.length() - 1);
|
p.truncate(p.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
dirEntry = QFileSystemEntry(p, QFileSystemEntry::FromInternalPath());
|
dirEntry = QFileSystemEntry(p, QFileSystemEntry::FromInternalPath());
|
||||||
@ -1052,7 +1052,7 @@ Q_GLOBAL_STATIC(DirSearchPaths, dirSearchPaths)
|
|||||||
*/
|
*/
|
||||||
void QDir::setSearchPaths(const QString &prefix, const QStringList &searchPaths)
|
void QDir::setSearchPaths(const QString &prefix, const QStringList &searchPaths)
|
||||||
{
|
{
|
||||||
if (prefix.length() < 2) {
|
if (prefix.size() < 2) {
|
||||||
qWarning("QDir::setSearchPaths: Prefix must be longer than 1 character");
|
qWarning("QDir::setSearchPaths: Prefix must be longer than 1 character");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2303,7 +2303,7 @@ static QString qt_cleanPath(const QString &path, bool *ok)
|
|||||||
QString ret = qt_normalizePathSegments(name, OSSupportsUncPaths ? QDirPrivate::AllowUncPaths : QDirPrivate::DefaultNormalization, ok);
|
QString ret = qt_normalizePathSegments(name, OSSupportsUncPaths ? QDirPrivate::AllowUncPaths : QDirPrivate::DefaultNormalization, ok);
|
||||||
|
|
||||||
// Strip away last slash except for root directories
|
// Strip away last slash except for root directories
|
||||||
if (ret.length() > 1 && ret.endsWith(u'/')) {
|
if (ret.size() > 1 && ret.endsWith(u'/')) {
|
||||||
#if defined (Q_OS_WIN)
|
#if defined (Q_OS_WIN)
|
||||||
if (!(ret.length() == 3 && ret.at(1) == u':'))
|
if (!(ret.length() == 3 && ret.at(1) == u':'))
|
||||||
#endif
|
#endif
|
||||||
|
@ -591,7 +591,7 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
|
|||||||
Q_CHECK_FILE_NAME(link, link);
|
Q_CHECK_FILE_NAME(link, link);
|
||||||
|
|
||||||
QByteArray s = qt_readlink(link.nativeFilePath().constData());
|
QByteArray s = qt_readlink(link.nativeFilePath().constData());
|
||||||
if (s.length() > 0) {
|
if (s.size() > 0) {
|
||||||
QString ret;
|
QString ret;
|
||||||
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
|
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
|
||||||
fillMetaData(link, data, QFileSystemMetaData::DirectoryType);
|
fillMetaData(link, data, QFileSystemMetaData::DirectoryType);
|
||||||
@ -713,13 +713,13 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
|
|||||||
QFileSystemEntry cur(currentPath());
|
QFileSystemEntry cur(currentPath());
|
||||||
result = cur.nativeFilePath();
|
result = cur.nativeFilePath();
|
||||||
}
|
}
|
||||||
if (!orig.isEmpty() && !(orig.length() == 1 && orig[0] == '.')) {
|
if (!orig.isEmpty() && !(orig.size() == 1 && orig[0] == '.')) {
|
||||||
if (!result.isEmpty() && !result.endsWith('/'))
|
if (!result.isEmpty() && !result.endsWith('/'))
|
||||||
result.append('/');
|
result.append('/');
|
||||||
result.append(orig);
|
result.append(orig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.length() == 1 && result[0] == '/')
|
if (result.size() == 1 && result[0] == '/')
|
||||||
return QFileSystemEntry(result, QFileSystemEntry::FromNativePath());
|
return QFileSystemEntry(result, QFileSystemEntry::FromNativePath());
|
||||||
const bool isDir = result.endsWith('/');
|
const bool isDir = result.endsWith('/');
|
||||||
|
|
||||||
@ -1152,7 +1152,7 @@ bool QFileSystemEngine::removeDirectory(const QFileSystemEntry &entry, bool remo
|
|||||||
|
|
||||||
if (removeEmptyParents) {
|
if (removeEmptyParents) {
|
||||||
QString dirName = QDir::cleanPath(entry.filePath());
|
QString dirName = QDir::cleanPath(entry.filePath());
|
||||||
for (int oldslash = 0, slash=dirName.length(); slash > 0; oldslash = slash) {
|
for (int oldslash = 0, slash=dirName.size(); slash > 0; oldslash = slash) {
|
||||||
const QByteArray chunk = QFile::encodeName(dirName.left(slash));
|
const QByteArray chunk = QFile::encodeName(dirName.left(slash));
|
||||||
QT_STATBUF st;
|
QT_STATBUF st;
|
||||||
if (QT_STAT(chunk.constData(), &st) != -1) {
|
if (QT_STAT(chunk.constData(), &st) != -1) {
|
||||||
|
@ -468,7 +468,7 @@ void QFSFileEnginePrivate::unmapAll()
|
|||||||
{
|
{
|
||||||
if (!maps.isEmpty()) {
|
if (!maps.isEmpty()) {
|
||||||
const QList<uchar*> keys = maps.keys(); // Make a copy since unmap() modifies the map.
|
const QList<uchar*> keys = maps.keys(); // Make a copy since unmap() modifies the map.
|
||||||
for (int i = 0; i < keys.count(); ++i)
|
for (int i = 0; i < keys.size(); ++i)
|
||||||
unmap(keys.at(i));
|
unmap(keys.at(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -779,7 +779,7 @@ int QResourceRoot::findNode(const QString &_path, const QLocale &locale) const
|
|||||||
if (!root.endsWith(u'/'))
|
if (!root.endsWith(u'/'))
|
||||||
root += u'/';
|
root += u'/';
|
||||||
if (path.size() >= root.size() && path.startsWith(root))
|
if (path.size() >= root.size() && path.startsWith(root))
|
||||||
path = path.mid(root.length() - 1);
|
path = path.mid(root.size() - 1);
|
||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
path = u'/';
|
path = u'/';
|
||||||
}
|
}
|
||||||
|
@ -356,7 +356,7 @@ QVariant QSettingsPrivate::stringListToVariantList(const QStringList &l)
|
|||||||
const QString &str = outStringList.at(i);
|
const QString &str = outStringList.at(i);
|
||||||
|
|
||||||
if (str.startsWith(u'@')) {
|
if (str.startsWith(u'@')) {
|
||||||
if (str.length() < 2 || str.at(1) != u'@') {
|
if (str.size() < 2 || str.at(1) != u'@') {
|
||||||
QVariantList variantList;
|
QVariantList variantList;
|
||||||
variantList.reserve(l.count());
|
variantList.reserve(l.count());
|
||||||
for (const auto &s : l)
|
for (const auto &s : l)
|
||||||
@ -509,7 +509,7 @@ QVariant QSettingsPrivate::stringToVariant(const QString &s)
|
|||||||
|
|
||||||
void QSettingsPrivate::iniEscapedKey(const QString &key, QByteArray &result)
|
void QSettingsPrivate::iniEscapedKey(const QString &key, QByteArray &result)
|
||||||
{
|
{
|
||||||
result.reserve(result.length() + key.length() * 3 / 2);
|
result.reserve(result.size() + key.size() * 3 / 2);
|
||||||
for (qsizetype i = 0; i < key.size(); ++i) {
|
for (qsizetype i = 0; i < key.size(); ++i) {
|
||||||
uint ch = key.at(i).unicode();
|
uint ch = key.at(i).unicode();
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ bool QSettingsPrivate::iniUnescapedKey(QByteArrayView key, QString &result)
|
|||||||
{
|
{
|
||||||
const QString decoded = QString::fromUtf8(key);
|
const QString decoded = QString::fromUtf8(key);
|
||||||
const qsizetype size = decoded.size();
|
const qsizetype size = decoded.size();
|
||||||
result.reserve(result.length() + size);
|
result.reserve(result.size() + size);
|
||||||
qsizetype i = 0;
|
qsizetype i = 0;
|
||||||
bool lowercaseOnly = true;
|
bool lowercaseOnly = true;
|
||||||
while (i < size) {
|
while (i < size) {
|
||||||
@ -731,7 +731,7 @@ StSkipSpaces:
|
|||||||
// fallthrough
|
// fallthrough
|
||||||
|
|
||||||
StNormal:
|
StNormal:
|
||||||
qsizetype chopLimit = stringResult.length();
|
qsizetype chopLimit = stringResult.size();
|
||||||
while (i < str.size()) {
|
while (i < str.size()) {
|
||||||
switch (str.at(i)) {
|
switch (str.at(i)) {
|
||||||
case '\\':
|
case '\\':
|
||||||
@ -769,7 +769,7 @@ StNormal:
|
|||||||
} else {
|
} else {
|
||||||
// the character is skipped
|
// the character is skipped
|
||||||
}
|
}
|
||||||
chopLimit = stringResult.length();
|
chopLimit = stringResult.size();
|
||||||
break;
|
break;
|
||||||
case '"':
|
case '"':
|
||||||
++i;
|
++i;
|
||||||
@ -856,7 +856,7 @@ end:
|
|||||||
|
|
||||||
QStringList QSettingsPrivate::splitArgs(const QString &s, qsizetype idx)
|
QStringList QSettingsPrivate::splitArgs(const QString &s, qsizetype idx)
|
||||||
{
|
{
|
||||||
qsizetype l = s.length();
|
qsizetype l = s.size();
|
||||||
Q_ASSERT(l > 0);
|
Q_ASSERT(l > 0);
|
||||||
Q_ASSERT(s.at(idx) == u'(');
|
Q_ASSERT(s.at(idx) == u'(');
|
||||||
Q_ASSERT(s.at(l - 1) == u')');
|
Q_ASSERT(s.at(l - 1) == u')');
|
||||||
|
@ -269,7 +269,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
|
|||||||
result = QDir::homePath() + value.mid(5);
|
result = QDir::homePath() + value.mid(5);
|
||||||
else
|
else
|
||||||
result = value.toString();
|
result = value.toString();
|
||||||
if (result.length() > 1 && result.endsWith(u'/'))
|
if (result.size() > 1 && result.endsWith(u'/'))
|
||||||
result.chop(1);
|
result.chop(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -711,8 +711,8 @@ void QStorageInfoPrivate::initRootPath()
|
|||||||
const QString mountDir = it.rootPath();
|
const QString mountDir = it.rootPath();
|
||||||
const QByteArray fsName = it.fileSystemType();
|
const QByteArray fsName = it.fileSystemType();
|
||||||
// we try to find most suitable entry
|
// we try to find most suitable entry
|
||||||
if (isParentOf(mountDir, oldRootPath) && maxLength < mountDir.length()) {
|
if (isParentOf(mountDir, oldRootPath) && maxLength < mountDir.size()) {
|
||||||
maxLength = mountDir.length();
|
maxLength = mountDir.size();
|
||||||
rootPath = mountDir;
|
rootPath = mountDir;
|
||||||
device = it.device();
|
device = it.device();
|
||||||
fileSystemType = fsName;
|
fileSystemType = fsName;
|
||||||
|
@ -45,7 +45,7 @@ QTemporaryFileName::QTemporaryFileName(const QString &templateName)
|
|||||||
{
|
{
|
||||||
// Ensure there is a placeholder mask
|
// Ensure there is a placeholder mask
|
||||||
QString qfilename = QDir::fromNativeSeparators(templateName);
|
QString qfilename = QDir::fromNativeSeparators(templateName);
|
||||||
uint phPos = qfilename.length();
|
uint phPos = qfilename.size();
|
||||||
uint phLength = 0;
|
uint phLength = 0;
|
||||||
|
|
||||||
while (phPos != 0) {
|
while (phPos != 0) {
|
||||||
|
@ -510,7 +510,7 @@ public:
|
|||||||
ErrorCode validityError(QString *source = nullptr, qsizetype *position = nullptr) const;
|
ErrorCode validityError(QString *source = nullptr, qsizetype *position = nullptr) const;
|
||||||
bool validateComponent(Section section, const QString &input, qsizetype begin, qsizetype end);
|
bool validateComponent(Section section, const QString &input, qsizetype begin, qsizetype end);
|
||||||
bool validateComponent(Section section, const QString &input)
|
bool validateComponent(Section section, const QString &input)
|
||||||
{ return validateComponent(section, input, 0, input.length()); }
|
{ return validateComponent(section, input, 0, input.size()); }
|
||||||
|
|
||||||
// no QString scheme() const;
|
// no QString scheme() const;
|
||||||
void appendAuthority(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const;
|
void appendAuthority(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const;
|
||||||
@ -1191,7 +1191,7 @@ static const QChar *parseIpFuture(QString &host, const QChar *begin, const QChar
|
|||||||
|
|
||||||
// uppercase the version, if necessary
|
// uppercase the version, if necessary
|
||||||
if (begin[2].unicode() >= 'a')
|
if (begin[2].unicode() >= 'a')
|
||||||
host[host.length() - 2] = QChar{begin[2].unicode() - 0x20};
|
host[host.size() - 2] = QChar{begin[2].unicode() - 0x20};
|
||||||
|
|
||||||
begin += 4;
|
begin += 4;
|
||||||
--end;
|
--end;
|
||||||
@ -1341,7 +1341,7 @@ QUrlPrivate::setHost(const QString &value, qsizetype from, qsizetype iend, QUrl:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// recurse
|
// recurse
|
||||||
return setHost(s, 0, s.length(), QUrl::StrictMode);
|
return setHost(s, 0, s.size(), QUrl::StrictMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
s = qt_ACE_do(value.mid(from, iend - from), NormalizeAce, ForbidLeadingDot, {});
|
s = qt_ACE_do(value.mid(from, iend - from), NormalizeAce, ForbidLeadingDot, {});
|
||||||
@ -1377,7 +1377,7 @@ inline void QUrlPrivate::parse(const QString &url, QUrl::ParsingMode parsingMode
|
|||||||
qsizetype colon = -1;
|
qsizetype colon = -1;
|
||||||
qsizetype question = -1;
|
qsizetype question = -1;
|
||||||
qsizetype hash = -1;
|
qsizetype hash = -1;
|
||||||
const qsizetype len = url.length();
|
const qsizetype len = url.size();
|
||||||
const QChar *const begin = url.constData();
|
const QChar *const begin = url.constData();
|
||||||
const ushort *const data = reinterpret_cast<const ushort *>(begin);
|
const ushort *const data = reinterpret_cast<const ushort *>(begin);
|
||||||
|
|
||||||
@ -1628,7 +1628,7 @@ inline QUrlPrivate::ErrorCode QUrlPrivate::validityError(QString *source, qsizet
|
|||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
return NoError;
|
return NoError;
|
||||||
if (path.at(0) == u'/') {
|
if (path.at(0) == u'/') {
|
||||||
if (hasAuthority() || path.length() == 1 || path.at(1) != u'/')
|
if (hasAuthority() || path.size() == 1 || path.at(1) != u'/')
|
||||||
return NoError;
|
return NoError;
|
||||||
if (source) {
|
if (source) {
|
||||||
*source = path;
|
*source = path;
|
||||||
@ -1648,7 +1648,7 @@ inline QUrlPrivate::ErrorCode QUrlPrivate::validityError(QString *source, qsizet
|
|||||||
return NoError;
|
return NoError;
|
||||||
|
|
||||||
// check for a path of "text:text/"
|
// check for a path of "text:text/"
|
||||||
for (qsizetype i = 0; i < path.length(); ++i) {
|
for (qsizetype i = 0; i < path.size(); ++i) {
|
||||||
ushort c = path.at(i).unicode();
|
ushort c = path.at(i).unicode();
|
||||||
if (c == '/') {
|
if (c == '/') {
|
||||||
// found the slash before the colon
|
// found the slash before the colon
|
||||||
@ -1956,7 +1956,7 @@ void QUrl::setScheme(const QString &scheme)
|
|||||||
d->flags &= ~QUrlPrivate::IsLocalFile;
|
d->flags &= ~QUrlPrivate::IsLocalFile;
|
||||||
d->scheme.clear();
|
d->scheme.clear();
|
||||||
} else {
|
} else {
|
||||||
d->setScheme(scheme, scheme.length(), /* do set error */ true);
|
d->setScheme(scheme, scheme.size(), /* do set error */ true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2016,7 +2016,7 @@ void QUrl::setAuthority(const QString &authority, ParsingMode mode)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->setAuthority(authority, 0, authority.length(), mode);
|
d->setAuthority(authority, 0, authority.size(), mode);
|
||||||
if (authority.isNull()) {
|
if (authority.isNull()) {
|
||||||
// QUrlPrivate::setAuthority cleared almost everything
|
// QUrlPrivate::setAuthority cleared almost everything
|
||||||
// but it leaves the Host bit set
|
// but it leaves the Host bit set
|
||||||
@ -2087,7 +2087,7 @@ void QUrl::setUserInfo(const QString &userInfo, ParsingMode mode)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->setUserInfo(trimmed, 0, trimmed.length());
|
d->setUserInfo(trimmed, 0, trimmed.size());
|
||||||
if (userInfo.isNull()) {
|
if (userInfo.isNull()) {
|
||||||
// QUrlPrivate::setUserInfo cleared almost everything
|
// QUrlPrivate::setUserInfo cleared almost everything
|
||||||
// but it leaves the UserName bit set
|
// but it leaves the UserName bit set
|
||||||
@ -2159,7 +2159,7 @@ void QUrl::setUserName(const QString &userName, ParsingMode mode)
|
|||||||
mode = TolerantMode;
|
mode = TolerantMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->setUserName(data, 0, data.length());
|
d->setUserName(data, 0, data.size());
|
||||||
if (userName.isNull())
|
if (userName.isNull())
|
||||||
d->sectionIsPresent &= ~QUrlPrivate::UserName;
|
d->sectionIsPresent &= ~QUrlPrivate::UserName;
|
||||||
else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::UserName, userName))
|
else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::UserName, userName))
|
||||||
@ -2222,7 +2222,7 @@ void QUrl::setPassword(const QString &password, ParsingMode mode)
|
|||||||
mode = TolerantMode;
|
mode = TolerantMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->setPassword(data, 0, data.length());
|
d->setPassword(data, 0, data.size());
|
||||||
if (password.isNull())
|
if (password.isNull())
|
||||||
d->sectionIsPresent &= ~QUrlPrivate::Password;
|
d->sectionIsPresent &= ~QUrlPrivate::Password;
|
||||||
else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Password, password))
|
else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Password, password))
|
||||||
@ -2284,7 +2284,7 @@ void QUrl::setHost(const QString &host, ParsingMode mode)
|
|||||||
mode = TolerantMode;
|
mode = TolerantMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d->setHost(data, 0, data.length(), mode)) {
|
if (d->setHost(data, 0, data.size(), mode)) {
|
||||||
if (host.isNull())
|
if (host.isNull())
|
||||||
d->sectionIsPresent &= ~QUrlPrivate::Host;
|
d->sectionIsPresent &= ~QUrlPrivate::Host;
|
||||||
} else if (!data.startsWith(u'[')) {
|
} else if (!data.startsWith(u'[')) {
|
||||||
@ -2293,7 +2293,7 @@ void QUrl::setHost(const QString &host, ParsingMode mode)
|
|||||||
|
|
||||||
data.prepend(u'[');
|
data.prepend(u'[');
|
||||||
data.append(u']');
|
data.append(u']');
|
||||||
if (!d->setHost(data, 0, data.length(), mode)) {
|
if (!d->setHost(data, 0, data.size(), mode)) {
|
||||||
// failed again
|
// failed again
|
||||||
if (data.contains(u':')) {
|
if (data.contains(u':')) {
|
||||||
// source data contains ':', so it's an IPv6 error
|
// source data contains ':', so it's an IPv6 error
|
||||||
@ -2330,7 +2330,7 @@ QString QUrl::host(ComponentFormattingOptions options) const
|
|||||||
if (d) {
|
if (d) {
|
||||||
d->appendHost(result, options);
|
d->appendHost(result, options);
|
||||||
if (result.startsWith(u'['))
|
if (result.startsWith(u'['))
|
||||||
result = result.mid(1, result.length() - 2);
|
result = result.mid(1, result.size() - 2);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -2409,7 +2409,7 @@ void QUrl::setPath(const QString &path, ParsingMode mode)
|
|||||||
mode = TolerantMode;
|
mode = TolerantMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->setPath(data, 0, data.length());
|
d->setPath(data, 0, data.size());
|
||||||
|
|
||||||
// optimized out, since there is no path delimiter
|
// optimized out, since there is no path delimiter
|
||||||
// if (path.isNull())
|
// if (path.isNull())
|
||||||
@ -2545,7 +2545,7 @@ void QUrl::setQuery(const QString &query, ParsingMode mode)
|
|||||||
mode = TolerantMode;
|
mode = TolerantMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->setQuery(data, 0, data.length());
|
d->setQuery(data, 0, data.size());
|
||||||
if (query.isNull())
|
if (query.isNull())
|
||||||
d->sectionIsPresent &= ~QUrlPrivate::Query;
|
d->sectionIsPresent &= ~QUrlPrivate::Query;
|
||||||
else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Query, query))
|
else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Query, query))
|
||||||
@ -2643,7 +2643,7 @@ void QUrl::setFragment(const QString &fragment, ParsingMode mode)
|
|||||||
mode = TolerantMode;
|
mode = TolerantMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->setFragment(data, 0, data.length());
|
d->setFragment(data, 0, data.size());
|
||||||
if (fragment.isNull())
|
if (fragment.isNull())
|
||||||
d->sectionIsPresent &= ~QUrlPrivate::Fragment;
|
d->sectionIsPresent &= ~QUrlPrivate::Fragment;
|
||||||
else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Fragment, fragment))
|
else if (mode == StrictMode && !d->validateComponent(QUrlPrivate::Fragment, fragment))
|
||||||
@ -2937,7 +2937,7 @@ QUrl QUrl::adjusted(QUrl::FormattingOptions options) const
|
|||||||
that.detach();
|
that.detach();
|
||||||
QString path;
|
QString path;
|
||||||
d->appendPath(path, options | FullyEncoded, QUrlPrivate::Path);
|
d->appendPath(path, options | FullyEncoded, QUrlPrivate::Path);
|
||||||
that.d->setPath(path, 0, path.length());
|
that.d->setPath(path, 0, path.size());
|
||||||
}
|
}
|
||||||
return that;
|
return that;
|
||||||
}
|
}
|
||||||
@ -3346,7 +3346,7 @@ QUrl QUrl::fromLocalFile(const QString &localFile)
|
|||||||
QString deslashified = fromNativeSeparators(localFile);
|
QString deslashified = fromNativeSeparators(localFile);
|
||||||
|
|
||||||
// magic for drives on windows
|
// magic for drives on windows
|
||||||
if (deslashified.length() > 1 && deslashified.at(1) == u':' && deslashified.at(0) != u'/') {
|
if (deslashified.size() > 1 && deslashified.at(1) == u':' && deslashified.at(0) != u'/') {
|
||||||
deslashified.prepend(u'/');
|
deslashified.prepend(u'/');
|
||||||
} else if (deslashified.startsWith("//"_L1)) {
|
} else if (deslashified.startsWith("//"_L1)) {
|
||||||
// magic for shared drive on windows
|
// magic for shared drive on windows
|
||||||
@ -3367,7 +3367,7 @@ QUrl QUrl::fromLocalFile(const QString &localFile)
|
|||||||
// Path hostname is not a valid URL host, so set it entirely in the path
|
// Path hostname is not a valid URL host, so set it entirely in the path
|
||||||
// (by leaving deslashified unchanged)
|
// (by leaving deslashified unchanged)
|
||||||
} else if (indexOfPath > 2) {
|
} else if (indexOfPath > 2) {
|
||||||
deslashified = deslashified.right(deslashified.length() - indexOfPath);
|
deslashified = deslashified.right(deslashified.size() - indexOfPath);
|
||||||
} else {
|
} else {
|
||||||
deslashified.clear();
|
deslashified.clear();
|
||||||
}
|
}
|
||||||
@ -3431,16 +3431,16 @@ bool QUrl::isParentOf(const QUrl &childUrl) const
|
|||||||
if (!d)
|
if (!d)
|
||||||
return ((childUrl.scheme().isEmpty())
|
return ((childUrl.scheme().isEmpty())
|
||||||
&& (childUrl.authority().isEmpty())
|
&& (childUrl.authority().isEmpty())
|
||||||
&& childPath.length() > 0 && childPath.at(0) == u'/');
|
&& childPath.size() > 0 && childPath.at(0) == u'/');
|
||||||
|
|
||||||
QString ourPath = path();
|
QString ourPath = path();
|
||||||
|
|
||||||
return ((childUrl.scheme().isEmpty() || d->scheme == childUrl.scheme())
|
return ((childUrl.scheme().isEmpty() || d->scheme == childUrl.scheme())
|
||||||
&& (childUrl.authority().isEmpty() || authority() == childUrl.authority())
|
&& (childUrl.authority().isEmpty() || authority() == childUrl.authority())
|
||||||
&& childPath.startsWith(ourPath)
|
&& childPath.startsWith(ourPath)
|
||||||
&& ((ourPath.endsWith(u'/') && childPath.length() > ourPath.length())
|
&& ((ourPath.endsWith(u'/') && childPath.size() > ourPath.size())
|
||||||
|| (!ourPath.endsWith(u'/') && childPath.length() > ourPath.length()
|
|| (!ourPath.endsWith(u'/') && childPath.size() > ourPath.size()
|
||||||
&& childPath.at(ourPath.length()) == u'/')));
|
&& childPath.at(ourPath.size()) == u'/')));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3488,7 +3488,7 @@ QDebug operator<<(QDebug d, const QUrl &url)
|
|||||||
|
|
||||||
static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &errorSource, qsizetype errorPosition)
|
static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &errorSource, qsizetype errorPosition)
|
||||||
{
|
{
|
||||||
QChar c = size_t(errorPosition) < size_t(errorSource.length()) ?
|
QChar c = size_t(errorPosition) < size_t(errorSource.size()) ?
|
||||||
errorSource.at(errorPosition) : QChar(QChar::Null);
|
errorSource.at(errorPosition) : QChar(QChar::Null);
|
||||||
|
|
||||||
switch (errorCode) {
|
switch (errorCode) {
|
||||||
|
@ -177,7 +177,7 @@ Q_AUTOTEST_EXPORT QString qt_punycodeDecoder(const QString &pc)
|
|||||||
// Do not try to decode strings longer than allowable for a domain label.
|
// Do not try to decode strings longer than allowable for a domain label.
|
||||||
// Non-ASCII strings are not allowed here anyway, so there is no need
|
// Non-ASCII strings are not allowed here anyway, so there is no need
|
||||||
// to account for surrogates.
|
// to account for surrogates.
|
||||||
if (pc.length() > MaxDomainLabelLength)
|
if (pc.size() > MaxDomainLabelLength)
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
// strip any ACE prefix
|
// strip any ACE prefix
|
||||||
@ -709,7 +709,7 @@ bool DomainValidityChecker::checkLabel(const QString &label, QUrl::AceProcessing
|
|||||||
if (label != label.normalized(QString::NormalizationForm_C))
|
if (label != label.normalized(QString::NormalizationForm_C))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (label.length() >= 4) {
|
if (label.size() >= 4) {
|
||||||
// This assumes that the first two characters are in BMP, but that's ok
|
// This assumes that the first two characters are in BMP, but that's ok
|
||||||
// because non-BMP characters are unlikely to be used for specifying
|
// because non-BMP characters are unlikely to be used for specifying
|
||||||
// future extensions.
|
// future extensions.
|
||||||
|
@ -515,7 +515,7 @@ QString QUrlQuery::query(QUrl::ComponentFormattingOptions encoding) const
|
|||||||
{
|
{
|
||||||
int size = 0;
|
int size = 0;
|
||||||
for ( ; it != end; ++it)
|
for ( ; it != end; ++it)
|
||||||
size += it->first.length() + 1 + it->second.length() + 1;
|
size += it->first.size() + 1 + it->second.size() + 1;
|
||||||
result.reserve(size + size / 4);
|
result.reserve(size + size / 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -840,13 +840,13 @@ void QAbstractItemModelPrivate::removePersistentIndexData(QPersistentModelIndexD
|
|||||||
Q_UNUSED(removed);
|
Q_UNUSED(removed);
|
||||||
}
|
}
|
||||||
// make sure our optimization still works
|
// make sure our optimization still works
|
||||||
for (int i = persistent.moved.count() - 1; i >= 0; --i) {
|
for (int i = persistent.moved.size() - 1; i >= 0; --i) {
|
||||||
int idx = persistent.moved.at(i).indexOf(data);
|
int idx = persistent.moved.at(i).indexOf(data);
|
||||||
if (idx >= 0)
|
if (idx >= 0)
|
||||||
persistent.moved[i].remove(idx);
|
persistent.moved[i].remove(idx);
|
||||||
}
|
}
|
||||||
// update the references to invalidated persistent indexes
|
// update the references to invalidated persistent indexes
|
||||||
for (int i = persistent.invalidated.count() - 1; i >= 0; --i) {
|
for (int i = persistent.invalidated.size() - 1; i >= 0; --i) {
|
||||||
int idx = persistent.invalidated.at(i).indexOf(data);
|
int idx = persistent.invalidated.at(i).indexOf(data);
|
||||||
if (idx >= 0)
|
if (idx >= 0)
|
||||||
persistent.invalidated[i].remove(idx);
|
persistent.invalidated[i].remove(idx);
|
||||||
@ -2775,15 +2775,15 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare
|
|||||||
|
|
||||||
// Compute the number of continuous rows upon insertion and modify the rows to match
|
// Compute the number of continuous rows upon insertion and modify the rows to match
|
||||||
QList<int> rowsToInsert(bottom + 1);
|
QList<int> rowsToInsert(bottom + 1);
|
||||||
for (int i = 0; i < rows.count(); ++i)
|
for (int i = 0; i < rows.size(); ++i)
|
||||||
rowsToInsert[rows.at(i)] = 1;
|
rowsToInsert[rows.at(i)] = 1;
|
||||||
for (int i = 0; i < rowsToInsert.count(); ++i) {
|
for (int i = 0; i < rowsToInsert.size(); ++i) {
|
||||||
if (rowsToInsert.at(i) == 1){
|
if (rowsToInsert.at(i) == 1){
|
||||||
rowsToInsert[i] = dragRowCount;
|
rowsToInsert[i] = dragRowCount;
|
||||||
++dragRowCount;
|
++dragRowCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; i < rows.count(); ++i)
|
for (int i = 0; i < rows.size(); ++i)
|
||||||
rows[i] = top + rowsToInsert.at(rows.at(i));
|
rows[i] = top + rowsToInsert.at(rows.at(i));
|
||||||
|
|
||||||
QBitArray isWrittenTo(dragRowCount * dragColumnCount);
|
QBitArray isWrittenTo(dragRowCount * dragColumnCount);
|
||||||
@ -3473,7 +3473,7 @@ QModelIndexList QAbstractItemModel::persistentIndexList() const
|
|||||||
{
|
{
|
||||||
Q_D(const QAbstractItemModel);
|
Q_D(const QAbstractItemModel);
|
||||||
QModelIndexList result;
|
QModelIndexList result;
|
||||||
result.reserve(d->persistent.indexes.count());
|
result.reserve(d->persistent.indexes.size());
|
||||||
for (auto *data : qAsConst(d->persistent.indexes))
|
for (auto *data : qAsConst(d->persistent.indexes))
|
||||||
result.append(data->index);
|
result.append(data->index);
|
||||||
return result;
|
return result;
|
||||||
|
@ -688,7 +688,7 @@ void QConcatenateTablesProxyModelPrivate::updateColumnCount()
|
|||||||
int QConcatenateTablesProxyModelPrivate::columnCountAfterChange(const QAbstractItemModel *model, int newCount) const
|
int QConcatenateTablesProxyModelPrivate::columnCountAfterChange(const QAbstractItemModel *model, int newCount) const
|
||||||
{
|
{
|
||||||
int newColumnCount = 0;
|
int newColumnCount = 0;
|
||||||
for (int i = 0; i < m_models.count(); ++i) {
|
for (int i = 0; i < m_models.size(); ++i) {
|
||||||
const QAbstractItemModel *mod = m_models.at(i);
|
const QAbstractItemModel *mod = m_models.at(i);
|
||||||
const int colCount = mod == model ? newCount : mod->columnCount();
|
const int colCount = mod == model ? newCount : mod->columnCount();
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
|
@ -878,7 +878,7 @@ static QItemSelection mergeRowLengths(const QList<QPair<QPersistentModelIndex, u
|
|||||||
|
|
||||||
QItemSelection result;
|
QItemSelection result;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < rowLengths.count()) {
|
while (i < rowLengths.size()) {
|
||||||
const QPersistentModelIndex &tl = rowLengths.at(i).first;
|
const QPersistentModelIndex &tl = rowLengths.at(i).first;
|
||||||
if (!tl.isValid()) {
|
if (!tl.isValid()) {
|
||||||
++i;
|
++i;
|
||||||
@ -886,7 +886,7 @@ static QItemSelection mergeRowLengths(const QList<QPair<QPersistentModelIndex, u
|
|||||||
}
|
}
|
||||||
QPersistentModelIndex br = tl;
|
QPersistentModelIndex br = tl;
|
||||||
const uint length = rowLengths.at(i).second;
|
const uint length = rowLengths.at(i).second;
|
||||||
while (++i < rowLengths.count()) {
|
while (++i < rowLengths.size()) {
|
||||||
const QPersistentModelIndex &next = rowLengths.at(i).first;
|
const QPersistentModelIndex &next = rowLengths.at(i).first;
|
||||||
if (!next.isValid())
|
if (!next.isValid())
|
||||||
continue;
|
continue;
|
||||||
@ -916,7 +916,7 @@ static QItemSelection mergeIndexes(const QList<QPersistentModelIndex> &indexes)
|
|||||||
QItemSelection colSpans;
|
QItemSelection colSpans;
|
||||||
// merge columns
|
// merge columns
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < indexes.count()) {
|
while (i < indexes.size()) {
|
||||||
const QPersistentModelIndex &tl = indexes.at(i);
|
const QPersistentModelIndex &tl = indexes.at(i);
|
||||||
if (!tl.isValid()) {
|
if (!tl.isValid()) {
|
||||||
++i;
|
++i;
|
||||||
@ -926,7 +926,7 @@ static QItemSelection mergeIndexes(const QList<QPersistentModelIndex> &indexes)
|
|||||||
QModelIndex brParent = br.parent();
|
QModelIndex brParent = br.parent();
|
||||||
int brRow = br.row();
|
int brRow = br.row();
|
||||||
int brColumn = br.column();
|
int brColumn = br.column();
|
||||||
while (++i < indexes.count()) {
|
while (++i < indexes.size()) {
|
||||||
const QPersistentModelIndex &next = indexes.at(i);
|
const QPersistentModelIndex &next = indexes.at(i);
|
||||||
if (!next.isValid())
|
if (!next.isValid())
|
||||||
continue;
|
continue;
|
||||||
|
@ -959,12 +959,12 @@ void QSortFilterProxyModelPrivate::source_items_inserted(
|
|||||||
it = create_mapping(source_parent);
|
it = create_mapping(source_parent);
|
||||||
Mapping *m = it.value();
|
Mapping *m = it.value();
|
||||||
QModelIndex proxy_parent = q->mapFromSource(source_parent);
|
QModelIndex proxy_parent = q->mapFromSource(source_parent);
|
||||||
if (m->source_rows.count() > 0) {
|
if (m->source_rows.size() > 0) {
|
||||||
q->beginInsertRows(proxy_parent, 0, m->source_rows.count() - 1);
|
q->beginInsertRows(proxy_parent, 0, m->source_rows.size() - 1);
|
||||||
q->endInsertRows();
|
q->endInsertRows();
|
||||||
}
|
}
|
||||||
if (m->source_columns.count() > 0) {
|
if (m->source_columns.size() > 0) {
|
||||||
q->beginInsertColumns(proxy_parent, 0, m->source_columns.count() - 1);
|
q->beginInsertColumns(proxy_parent, 0, m->source_columns.size() - 1);
|
||||||
q->endInsertColumns();
|
q->endInsertColumns();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -1190,7 +1190,7 @@ void QSortFilterProxyModelPrivate::proxy_item_range(
|
|||||||
{
|
{
|
||||||
proxy_low = INT_MAX;
|
proxy_low = INT_MAX;
|
||||||
proxy_high = INT_MIN;
|
proxy_high = INT_MIN;
|
||||||
for (int i = 0; i < source_items.count(); ++i) {
|
for (int i = 0; i < source_items.size(); ++i) {
|
||||||
int proxy_item = source_to_proxy.at(source_items.at(i));
|
int proxy_item = source_to_proxy.at(source_items.at(i));
|
||||||
Q_ASSERT(proxy_item != -1);
|
Q_ASSERT(proxy_item != -1);
|
||||||
if (proxy_item < proxy_low)
|
if (proxy_item < proxy_low)
|
||||||
@ -1223,7 +1223,7 @@ QModelIndexPairList QSortFilterProxyModelPrivate::store_persistent_indexes() con
|
|||||||
{
|
{
|
||||||
Q_Q(const QSortFilterProxyModel);
|
Q_Q(const QSortFilterProxyModel);
|
||||||
QModelIndexPairList source_indexes;
|
QModelIndexPairList source_indexes;
|
||||||
source_indexes.reserve(persistent.indexes.count());
|
source_indexes.reserve(persistent.indexes.size());
|
||||||
for (const QPersistentModelIndexData *data : qAsConst(persistent.indexes)) {
|
for (const QPersistentModelIndexData *data : qAsConst(persistent.indexes)) {
|
||||||
const QModelIndex &proxy_index = data->index;
|
const QModelIndex &proxy_index = data->index;
|
||||||
QModelIndex source_index = q->mapToSource(proxy_index);
|
QModelIndex source_index = q->mapToSource(proxy_index);
|
||||||
@ -1327,7 +1327,7 @@ QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(
|
|||||||
Q_Q(QSortFilterProxyModel);
|
Q_Q(QSortFilterProxyModel);
|
||||||
// Figure out which mapped items to remove
|
// Figure out which mapped items to remove
|
||||||
QList<int> source_items_remove;
|
QList<int> source_items_remove;
|
||||||
for (int i = 0; i < proxy_to_source.count(); ++i) {
|
for (int i = 0; i < proxy_to_source.size(); ++i) {
|
||||||
const int source_item = proxy_to_source.at(i);
|
const int source_item = proxy_to_source.at(i);
|
||||||
if ((orient == Qt::Vertical)
|
if ((orient == Qt::Vertical)
|
||||||
? !filterAcceptsRowInternal(source_item, source_parent)
|
? !filterAcceptsRowInternal(source_item, source_parent)
|
||||||
@ -1435,7 +1435,7 @@ void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &sourc
|
|||||||
QList<int> source_rows_insert;
|
QList<int> source_rows_insert;
|
||||||
QList<int> source_rows_change;
|
QList<int> source_rows_change;
|
||||||
QList<int> source_rows_resort;
|
QList<int> source_rows_resort;
|
||||||
int end = qMin(source_bottom_right.row(), m->proxy_rows.count() - 1);
|
int end = qMin(source_bottom_right.row(), m->proxy_rows.size() - 1);
|
||||||
for (int source_row = source_top_left.row(); source_row <= end; ++source_row) {
|
for (int source_row = source_top_left.row(); source_row <= end; ++source_row) {
|
||||||
if (dynamic_sortfilter && !change_in_unmapped_parent) {
|
if (dynamic_sortfilter && !change_in_unmapped_parent) {
|
||||||
if (m->proxy_rows.at(source_row) != -1) {
|
if (m->proxy_rows.at(source_row) != -1) {
|
||||||
@ -2155,7 +2155,7 @@ QModelIndex QSortFilterProxyModel::index(int row, int column, const QModelIndex
|
|||||||
|
|
||||||
QModelIndex source_parent = mapToSource(parent); // parent is already mapped at this point
|
QModelIndex source_parent = mapToSource(parent); // parent is already mapped at this point
|
||||||
IndexMap::const_iterator it = d->create_mapping(source_parent); // but make sure that the children are mapped
|
IndexMap::const_iterator it = d->create_mapping(source_parent); // but make sure that the children are mapped
|
||||||
if (it.value()->source_rows.count() <= row || it.value()->source_columns.count() <= column)
|
if (it.value()->source_rows.size() <= row || it.value()->source_columns.size() <= column)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
return d->create_index(row, column, it);
|
return d->create_index(row, column, it);
|
||||||
@ -2186,7 +2186,7 @@ QModelIndex QSortFilterProxyModel::sibling(int row, int column, const QModelInde
|
|||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
const IndexMap::const_iterator it = d->index_to_iterator(idx);
|
const IndexMap::const_iterator it = d->index_to_iterator(idx);
|
||||||
if (it.value()->source_rows.count() <= row || it.value()->source_columns.count() <= column)
|
if (it.value()->source_rows.size() <= row || it.value()->source_columns.size() <= column)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
return d->create_index(row, column, it);
|
return d->create_index(row, column, it);
|
||||||
@ -2202,7 +2202,7 @@ int QSortFilterProxyModel::rowCount(const QModelIndex &parent) const
|
|||||||
if (parent.isValid() && !source_parent.isValid())
|
if (parent.isValid() && !source_parent.isValid())
|
||||||
return 0;
|
return 0;
|
||||||
IndexMap::const_iterator it = d->create_mapping(source_parent);
|
IndexMap::const_iterator it = d->create_mapping(source_parent);
|
||||||
return it.value()->source_rows.count();
|
return it.value()->source_rows.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2215,7 +2215,7 @@ int QSortFilterProxyModel::columnCount(const QModelIndex &parent) const
|
|||||||
if (parent.isValid() && !source_parent.isValid())
|
if (parent.isValid() && !source_parent.isValid())
|
||||||
return 0;
|
return 0;
|
||||||
IndexMap::const_iterator it = d->create_mapping(source_parent);
|
IndexMap::const_iterator it = d->create_mapping(source_parent);
|
||||||
return it.value()->source_columns.count();
|
return it.value()->source_columns.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2234,7 +2234,7 @@ bool QSortFilterProxyModel::hasChildren(const QModelIndex &parent) const
|
|||||||
return true; //we assume we might have children that can be fetched
|
return true; //we assume we might have children that can be fetched
|
||||||
|
|
||||||
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
||||||
return m->source_rows.count() != 0 && m->source_columns.count() != 0;
|
return m->source_rows.size() != 0 && m->source_columns.size() != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -2268,15 +2268,15 @@ QVariant QSortFilterProxyModel::headerData(int section, Qt::Orientation orientat
|
|||||||
{
|
{
|
||||||
Q_D(const QSortFilterProxyModel);
|
Q_D(const QSortFilterProxyModel);
|
||||||
IndexMap::const_iterator it = d->create_mapping(QModelIndex());
|
IndexMap::const_iterator it = d->create_mapping(QModelIndex());
|
||||||
if (it.value()->source_rows.count() * it.value()->source_columns.count() > 0)
|
if (it.value()->source_rows.size() * it.value()->source_columns.size() > 0)
|
||||||
return QAbstractProxyModel::headerData(section, orientation, role);
|
return QAbstractProxyModel::headerData(section, orientation, role);
|
||||||
int source_section;
|
int source_section;
|
||||||
if (orientation == Qt::Vertical) {
|
if (orientation == Qt::Vertical) {
|
||||||
if (section < 0 || section >= it.value()->source_rows.count())
|
if (section < 0 || section >= it.value()->source_rows.size())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
source_section = it.value()->source_rows.at(section);
|
source_section = it.value()->source_rows.at(section);
|
||||||
} else {
|
} else {
|
||||||
if (section < 0 || section >= it.value()->source_columns.count())
|
if (section < 0 || section >= it.value()->source_columns.size())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
source_section = it.value()->source_columns.at(section);
|
source_section = it.value()->source_columns.at(section);
|
||||||
}
|
}
|
||||||
@ -2291,15 +2291,15 @@ bool QSortFilterProxyModel::setHeaderData(int section, Qt::Orientation orientati
|
|||||||
{
|
{
|
||||||
Q_D(QSortFilterProxyModel);
|
Q_D(QSortFilterProxyModel);
|
||||||
IndexMap::const_iterator it = d->create_mapping(QModelIndex());
|
IndexMap::const_iterator it = d->create_mapping(QModelIndex());
|
||||||
if (it.value()->source_rows.count() * it.value()->source_columns.count() > 0)
|
if (it.value()->source_rows.size() * it.value()->source_columns.size() > 0)
|
||||||
return QAbstractProxyModel::setHeaderData(section, orientation, value, role);
|
return QAbstractProxyModel::setHeaderData(section, orientation, value, role);
|
||||||
int source_section;
|
int source_section;
|
||||||
if (orientation == Qt::Vertical) {
|
if (orientation == Qt::Vertical) {
|
||||||
if (section < 0 || section >= it.value()->source_rows.count())
|
if (section < 0 || section >= it.value()->source_rows.size())
|
||||||
return false;
|
return false;
|
||||||
source_section = it.value()->source_rows.at(section);
|
source_section = it.value()->source_rows.at(section);
|
||||||
} else {
|
} else {
|
||||||
if (section < 0 || section >= it.value()->source_columns.count())
|
if (section < 0 || section >= it.value()->source_columns.size())
|
||||||
return false;
|
return false;
|
||||||
source_section = it.value()->source_columns.at(section);
|
source_section = it.value()->source_columns.at(section);
|
||||||
}
|
}
|
||||||
@ -2359,10 +2359,10 @@ bool QSortFilterProxyModel::insertRows(int row, int count, const QModelIndex &pa
|
|||||||
if (parent.isValid() && !source_parent.isValid())
|
if (parent.isValid() && !source_parent.isValid())
|
||||||
return false;
|
return false;
|
||||||
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
||||||
if (row > m->source_rows.count())
|
if (row > m->source_rows.size())
|
||||||
return false;
|
return false;
|
||||||
int source_row = (row >= m->source_rows.count()
|
int source_row = (row >= m->source_rows.size()
|
||||||
? m->proxy_rows.count()
|
? m->proxy_rows.size()
|
||||||
: m->source_rows.at(row));
|
: m->source_rows.at(row));
|
||||||
return d->model->insertRows(source_row, count, source_parent);
|
return d->model->insertRows(source_row, count, source_parent);
|
||||||
}
|
}
|
||||||
@ -2379,10 +2379,10 @@ bool QSortFilterProxyModel::insertColumns(int column, int count, const QModelInd
|
|||||||
if (parent.isValid() && !source_parent.isValid())
|
if (parent.isValid() && !source_parent.isValid())
|
||||||
return false;
|
return false;
|
||||||
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
||||||
if (column > m->source_columns.count())
|
if (column > m->source_columns.size())
|
||||||
return false;
|
return false;
|
||||||
int source_column = (column >= m->source_columns.count()
|
int source_column = (column >= m->source_columns.size()
|
||||||
? m->proxy_columns.count()
|
? m->proxy_columns.size()
|
||||||
: m->source_columns.at(column));
|
: m->source_columns.at(column));
|
||||||
return d->model->insertColumns(source_column, count, source_parent);
|
return d->model->insertColumns(source_column, count, source_parent);
|
||||||
}
|
}
|
||||||
@ -2399,10 +2399,10 @@ bool QSortFilterProxyModel::removeRows(int row, int count, const QModelIndex &pa
|
|||||||
if (parent.isValid() && !source_parent.isValid())
|
if (parent.isValid() && !source_parent.isValid())
|
||||||
return false;
|
return false;
|
||||||
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
||||||
if (row + count > m->source_rows.count())
|
if (row + count > m->source_rows.size())
|
||||||
return false;
|
return false;
|
||||||
if ((count == 1)
|
if ((count == 1)
|
||||||
|| ((d->source_sort_column < 0) && (m->proxy_rows.count() == m->source_rows.count()))) {
|
|| ((d->source_sort_column < 0) && (m->proxy_rows.size() == m->source_rows.size()))) {
|
||||||
int source_row = m->source_rows.at(row);
|
int source_row = m->source_rows.at(row);
|
||||||
return d->model->removeRows(source_row, count, source_parent);
|
return d->model->removeRows(source_row, count, source_parent);
|
||||||
}
|
}
|
||||||
@ -2414,7 +2414,7 @@ bool QSortFilterProxyModel::removeRows(int row, int count, const QModelIndex &pa
|
|||||||
rows.append(m->source_rows.at(i));
|
rows.append(m->source_rows.at(i));
|
||||||
std::sort(rows.begin(), rows.end());
|
std::sort(rows.begin(), rows.end());
|
||||||
|
|
||||||
int pos = rows.count() - 1;
|
int pos = rows.size() - 1;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
while (pos >= 0) {
|
while (pos >= 0) {
|
||||||
const int source_end = rows.at(pos--);
|
const int source_end = rows.at(pos--);
|
||||||
@ -2441,9 +2441,9 @@ bool QSortFilterProxyModel::removeColumns(int column, int count, const QModelInd
|
|||||||
if (parent.isValid() && !source_parent.isValid())
|
if (parent.isValid() && !source_parent.isValid())
|
||||||
return false;
|
return false;
|
||||||
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();
|
||||||
if (column + count > m->source_columns.count())
|
if (column + count > m->source_columns.size())
|
||||||
return false;
|
return false;
|
||||||
if ((count == 1) || (m->proxy_columns.count() == m->source_columns.count())) {
|
if ((count == 1) || (m->proxy_columns.size() == m->source_columns.size())) {
|
||||||
int source_column = m->source_columns.at(column);
|
int source_column = m->source_columns.at(column);
|
||||||
return d->model->removeColumns(source_column, count, source_parent);
|
return d->model->removeColumns(source_column, count, source_parent);
|
||||||
}
|
}
|
||||||
@ -2453,7 +2453,7 @@ bool QSortFilterProxyModel::removeColumns(int column, int count, const QModelInd
|
|||||||
for (int i = column; i < column + count; ++i)
|
for (int i = column; i < column + count; ++i)
|
||||||
columns.append(m->source_columns.at(i));
|
columns.append(m->source_columns.at(i));
|
||||||
|
|
||||||
int pos = columns.count() - 1;
|
int pos = columns.size() - 1;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
while (pos >= 0) {
|
while (pos >= 0) {
|
||||||
const int source_end = columns.at(pos--);
|
const int source_end = columns.at(pos--);
|
||||||
|
@ -382,7 +382,7 @@ void QAbstractEventDispatcher::installNativeEventFilter(QAbstractNativeEventFilt
|
|||||||
void QAbstractEventDispatcher::removeNativeEventFilter(QAbstractNativeEventFilter *filter)
|
void QAbstractEventDispatcher::removeNativeEventFilter(QAbstractNativeEventFilter *filter)
|
||||||
{
|
{
|
||||||
Q_D(QAbstractEventDispatcher);
|
Q_D(QAbstractEventDispatcher);
|
||||||
for (int i = 0; i < d->eventFilters.count(); ++i) {
|
for (int i = 0; i < d->eventFilters.size(); ++i) {
|
||||||
if (d->eventFilters.at(i) == filter) {
|
if (d->eventFilters.at(i) == filter) {
|
||||||
d->eventFilters[i] = nullptr;
|
d->eventFilters[i] = nullptr;
|
||||||
break;
|
break;
|
||||||
|
@ -2153,7 +2153,7 @@ static void replacePercentN(QString *result, int n)
|
|||||||
fmt = fmt.arg(n);
|
fmt = fmt.arg(n);
|
||||||
++len;
|
++len;
|
||||||
result->replace(percentPos, len, fmt);
|
result->replace(percentPos, len, fmt);
|
||||||
len = fmt.length();
|
len = fmt.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ static gboolean socketNotifierSourceCheck(GSource *source)
|
|||||||
GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source);
|
GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source);
|
||||||
|
|
||||||
bool pending = false;
|
bool pending = false;
|
||||||
for (int i = 0; !pending && i < src->pollfds.count(); ++i) {
|
for (int i = 0; !pending && i < src->pollfds.size(); ++i) {
|
||||||
GPollFDWithQSocketNotifier *p = src->pollfds.at(i);
|
GPollFDWithQSocketNotifier *p = src->pollfds.at(i);
|
||||||
|
|
||||||
if (p->pollfd.revents & G_IO_NVAL) {
|
if (p->pollfd.revents & G_IO_NVAL) {
|
||||||
@ -65,7 +65,7 @@ static gboolean socketNotifierSourceDispatch(GSource *source, GSourceFunc, gpoin
|
|||||||
QEvent event(QEvent::SockAct);
|
QEvent event(QEvent::SockAct);
|
||||||
|
|
||||||
GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source);
|
GSocketNotifierSource *src = reinterpret_cast<GSocketNotifierSource *>(source);
|
||||||
for (src->activeNotifierPos = 0; src->activeNotifierPos < src->pollfds.count();
|
for (src->activeNotifierPos = 0; src->activeNotifierPos < src->pollfds.size();
|
||||||
++src->activeNotifierPos) {
|
++src->activeNotifierPos) {
|
||||||
GPollFDWithQSocketNotifier *p = src->pollfds.at(src->activeNotifierPos);
|
GPollFDWithQSocketNotifier *p = src->pollfds.at(src->activeNotifierPos);
|
||||||
|
|
||||||
@ -348,7 +348,7 @@ QEventDispatcherGlib::~QEventDispatcherGlib()
|
|||||||
d->idleTimerSource = nullptr;
|
d->idleTimerSource = nullptr;
|
||||||
|
|
||||||
// destroy socket notifier source
|
// destroy socket notifier source
|
||||||
for (int i = 0; i < d->socketNotifierSource->pollfds.count(); ++i) {
|
for (int i = 0; i < d->socketNotifierSource->pollfds.size(); ++i) {
|
||||||
GPollFDWithQSocketNotifier *p = d->socketNotifierSource->pollfds[i];
|
GPollFDWithQSocketNotifier *p = d->socketNotifierSource->pollfds[i];
|
||||||
g_source_remove_poll(&d->socketNotifierSource->source, &p->pollfd);
|
g_source_remove_poll(&d->socketNotifierSource->source, &p->pollfd);
|
||||||
delete p;
|
delete p;
|
||||||
@ -458,7 +458,7 @@ void QEventDispatcherGlib::unregisterSocketNotifier(QSocketNotifier *notifier)
|
|||||||
|
|
||||||
Q_D(QEventDispatcherGlib);
|
Q_D(QEventDispatcherGlib);
|
||||||
|
|
||||||
for (int i = 0; i < d->socketNotifierSource->pollfds.count(); ++i) {
|
for (int i = 0; i < d->socketNotifierSource->pollfds.size(); ++i) {
|
||||||
GPollFDWithQSocketNotifier *p = d->socketNotifierSource->pollfds.at(i);
|
GPollFDWithQSocketNotifier *p = d->socketNotifierSource->pollfds.at(i);
|
||||||
if (p->socketNotifier == notifier) {
|
if (p->socketNotifier == notifier) {
|
||||||
// found it
|
// found it
|
||||||
|
@ -2303,7 +2303,7 @@ void QObject::removeEventFilter(QObject *obj)
|
|||||||
{
|
{
|
||||||
Q_D(QObject);
|
Q_D(QObject);
|
||||||
if (d->extraData) {
|
if (d->extraData) {
|
||||||
for (int i = 0; i < d->extraData->eventFilters.count(); ++i) {
|
for (int i = 0; i < d->extraData->eventFilters.size(); ++i) {
|
||||||
if (d->extraData->eventFilters.at(i) == obj)
|
if (d->extraData->eventFilters.at(i) == obj)
|
||||||
d->extraData->eventFilters[i] = nullptr;
|
d->extraData->eventFilters[i] = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,7 @@ bool QTranslator::load(const QString & filename, const QString & directory,
|
|||||||
QString prefix;
|
QString prefix;
|
||||||
if (QFileInfo(filename).isRelative()) {
|
if (QFileInfo(filename).isRelative()) {
|
||||||
prefix = directory;
|
prefix = directory;
|
||||||
if (prefix.length() && !prefix.endsWith(u'/'))
|
if (prefix.size() && !prefix.endsWith(u'/'))
|
||||||
prefix += u'/';
|
prefix += u'/';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,7 +472,7 @@ bool QTranslator::load(const QString & filename, const QString & directory,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
int rightmost = 0;
|
int rightmost = 0;
|
||||||
for (int i = 0; i < (int)delims.length(); i++) {
|
for (int i = 0; i < (int)delims.size(); i++) {
|
||||||
int k = fname.lastIndexOf(delims[i]);
|
int k = fname.lastIndexOf(delims[i]);
|
||||||
if (k > rightmost)
|
if (k > rightmost)
|
||||||
rightmost = k;
|
rightmost = k;
|
||||||
@ -914,7 +914,7 @@ end:
|
|||||||
if (!tn)
|
if (!tn)
|
||||||
return QString();
|
return QString();
|
||||||
QString str(tn_length / 2, Qt::Uninitialized);
|
QString str(tn_length / 2, Qt::Uninitialized);
|
||||||
qFromBigEndian<ushort>(tn, str.length(), str.data());
|
qFromBigEndian<ushort>(tn, str.size(), str.data());
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,9 +34,9 @@ void QMimeGlobMatchResult::addMatch(const QString &mimeType, int weight, const Q
|
|||||||
bool replace = weight > m_weight;
|
bool replace = weight > m_weight;
|
||||||
if (!replace) {
|
if (!replace) {
|
||||||
// Compare the length of the match
|
// Compare the length of the match
|
||||||
if (pattern.length() < m_matchingPatternLength)
|
if (pattern.size() < m_matchingPatternLength)
|
||||||
return; // too short, ignore
|
return; // too short, ignore
|
||||||
else if (pattern.length() > m_matchingPatternLength) {
|
else if (pattern.size() > m_matchingPatternLength) {
|
||||||
// longer: clear any previous match (like *.bz2, when pattern is *.tar.bz2)
|
// longer: clear any previous match (like *.bz2, when pattern is *.tar.bz2)
|
||||||
replace = true;
|
replace = true;
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ void QMimeGlobMatchResult::addMatch(const QString &mimeType, int weight, const Q
|
|||||||
if (replace) {
|
if (replace) {
|
||||||
m_matchingMimeTypes.clear();
|
m_matchingMimeTypes.clear();
|
||||||
// remember the new "longer" length
|
// remember the new "longer" length
|
||||||
m_matchingPatternLength = pattern.length();
|
m_matchingPatternLength = pattern.size();
|
||||||
m_weight = weight;
|
m_weight = weight;
|
||||||
}
|
}
|
||||||
if (!m_matchingMimeTypes.contains(mimeType)) {
|
if (!m_matchingMimeTypes.contains(mimeType)) {
|
||||||
@ -59,7 +59,7 @@ void QMimeGlobMatchResult::addMatch(const QString &mimeType, int weight, const Q
|
|||||||
|
|
||||||
QMimeGlobPattern::PatternType QMimeGlobPattern::detectPatternType(const QString &pattern) const
|
QMimeGlobPattern::PatternType QMimeGlobPattern::detectPatternType(const QString &pattern) const
|
||||||
{
|
{
|
||||||
const int patternLength = pattern.length();
|
const int patternLength = pattern.size();
|
||||||
if (!patternLength)
|
if (!patternLength)
|
||||||
return OtherPattern;
|
return OtherPattern;
|
||||||
|
|
||||||
@ -108,10 +108,10 @@ bool QMimeGlobPattern::matchFileName(const QString &inputFileName) const
|
|||||||
const QString fileName = m_caseSensitivity == Qt::CaseInsensitive
|
const QString fileName = m_caseSensitivity == Qt::CaseInsensitive
|
||||||
? inputFileName.toLower() : inputFileName;
|
? inputFileName.toLower() : inputFileName;
|
||||||
|
|
||||||
const int patternLength = m_pattern.length();
|
const int patternLength = m_pattern.size();
|
||||||
if (!patternLength)
|
if (!patternLength)
|
||||||
return false;
|
return false;
|
||||||
const int fileNameLength = fileName.length();
|
const int fileNameLength = fileName.size();
|
||||||
|
|
||||||
switch (m_patternType) {
|
switch (m_patternType) {
|
||||||
case SuffixPattern: {
|
case SuffixPattern: {
|
||||||
@ -166,7 +166,7 @@ static bool isSimplePattern(const QString &pattern)
|
|||||||
{
|
{
|
||||||
// starts with "*.", has no other '*'
|
// starts with "*.", has no other '*'
|
||||||
return pattern.lastIndexOf(u'*') == 0
|
return pattern.lastIndexOf(u'*') == 0
|
||||||
&& pattern.length() > 1
|
&& pattern.size() > 1
|
||||||
&& pattern.at(1) == u'.' // (other dots are OK, like *.tar.bz2)
|
&& pattern.at(1) == u'.' // (other dots are OK, like *.tar.bz2)
|
||||||
// and contains no other special character
|
// and contains no other special character
|
||||||
&& !pattern.contains(u'?')
|
&& !pattern.contains(u'?')
|
||||||
@ -229,7 +229,7 @@ void QMimeGlobPatternList::match(QMimeGlobMatchResult &result,
|
|||||||
const QMimeGlobPattern &glob = *it;
|
const QMimeGlobPattern &glob = *it;
|
||||||
if (glob.matchFileName(fileName)) {
|
if (glob.matchFileName(fileName)) {
|
||||||
const QString pattern = glob.pattern();
|
const QString pattern = glob.pattern();
|
||||||
const int suffixLen = isSimplePattern(pattern) ? pattern.length() - 2 : 0;
|
const int suffixLen = isSimplePattern(pattern) ? pattern.size() - 2 : 0;
|
||||||
result.addMatch(glob.mimeType(), glob.weight(), pattern, suffixLen);
|
result.addMatch(glob.mimeType(), glob.weight(), pattern, suffixLen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -244,7 +244,7 @@ void QMimeAllGlobPatterns::matchingGlobs(const QString &fileName, QMimeGlobMatch
|
|||||||
// (which is most of them, so this optimization is definitely worth it)
|
// (which is most of them, so this optimization is definitely worth it)
|
||||||
const int lastDot = fileName.lastIndexOf(u'.');
|
const int lastDot = fileName.lastIndexOf(u'.');
|
||||||
if (lastDot != -1) { // if no '.', skip the extension lookup
|
if (lastDot != -1) { // if no '.', skip the extension lookup
|
||||||
const int ext_len = fileName.length() - lastDot - 1;
|
const int ext_len = fileName.size() - lastDot - 1;
|
||||||
const QString simpleExtension = fileName.right(ext_len).toLower();
|
const QString simpleExtension = fileName.right(ext_len).toLower();
|
||||||
// (toLower because fast patterns are always case-insensitive and saved as lowercase)
|
// (toLower because fast patterns are always case-insensitive and saved as lowercase)
|
||||||
|
|
||||||
|
@ -219,9 +219,9 @@ void QMimeBinaryProvider::addFileNameMatches(const QString &fileName, QMimeGlobM
|
|||||||
const int reverseSuffixTreeOffset = m_cacheFile->getUint32(PosReverseSuffixTreeOffset);
|
const int reverseSuffixTreeOffset = m_cacheFile->getUint32(PosReverseSuffixTreeOffset);
|
||||||
const int numRoots = m_cacheFile->getUint32(reverseSuffixTreeOffset);
|
const int numRoots = m_cacheFile->getUint32(reverseSuffixTreeOffset);
|
||||||
const int firstRootOffset = m_cacheFile->getUint32(reverseSuffixTreeOffset + 4);
|
const int firstRootOffset = m_cacheFile->getUint32(reverseSuffixTreeOffset + 4);
|
||||||
matchSuffixTree(result, m_cacheFile, numRoots, firstRootOffset, lowerFileName, lowerFileName.length() - 1, false);
|
matchSuffixTree(result, m_cacheFile, numRoots, firstRootOffset, lowerFileName, lowerFileName.size() - 1, false);
|
||||||
if (result.m_matchingMimeTypes.isEmpty())
|
if (result.m_matchingMimeTypes.isEmpty())
|
||||||
matchSuffixTree(result, m_cacheFile, numRoots, firstRootOffset, fileName, fileName.length() - 1, true);
|
matchSuffixTree(result, m_cacheFile, numRoots, firstRootOffset, fileName, fileName.size() - 1, true);
|
||||||
}
|
}
|
||||||
// Check complex globs (e.g. "callgrind.out[0-9]*" or "README*")
|
// Check complex globs (e.g. "callgrind.out[0-9]*" or "README*")
|
||||||
if (result.m_matchingMimeTypes.isEmpty())
|
if (result.m_matchingMimeTypes.isEmpty())
|
||||||
@ -448,7 +448,7 @@ void QMimeBinaryProvider::addAllMimeTypes(QList<QMimeType> &result)
|
|||||||
{
|
{
|
||||||
loadMimeTypeList();
|
loadMimeTypeList();
|
||||||
if (result.isEmpty()) {
|
if (result.isEmpty()) {
|
||||||
result.reserve(m_mimetypeNames.count());
|
result.reserve(m_mimetypeNames.size());
|
||||||
for (const QString &name : qAsConst(m_mimetypeNames))
|
for (const QString &name : qAsConst(m_mimetypeNames))
|
||||||
result.append(mimeTypeForNameUnchecked(name));
|
result.append(mimeTypeForNameUnchecked(name));
|
||||||
} else {
|
} else {
|
||||||
|
@ -413,7 +413,7 @@ QStringList QMimeType::suffixes() const
|
|||||||
for (const QString &pattern : qAsConst(d->globPatterns)) {
|
for (const QString &pattern : qAsConst(d->globPatterns)) {
|
||||||
// Not a simple suffix if it looks like: README or *. or *.* or *.JP*G or *.JP?
|
// Not a simple suffix if it looks like: README or *. or *.* or *.JP*G or *.JP?
|
||||||
if (pattern.startsWith("*."_L1) &&
|
if (pattern.startsWith("*."_L1) &&
|
||||||
pattern.length() > 2 &&
|
pattern.size() > 2 &&
|
||||||
pattern.indexOf(u'*', 2) < 0 && pattern.indexOf(u'?', 2) < 0) {
|
pattern.indexOf(u'*', 2) < 0 && pattern.indexOf(u'?', 2) < 0) {
|
||||||
const QString suffix = pattern.mid(2);
|
const QString suffix = pattern.mid(2);
|
||||||
result.append(suffix);
|
result.append(suffix);
|
||||||
|
@ -1309,7 +1309,7 @@ QCborStreamReader::StringResult<QString> QCborStreamReader::_readString_helper()
|
|||||||
if (r.status == Error) {
|
if (r.status == Error) {
|
||||||
result.data.clear();
|
result.data.clear();
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT(r.data == result.data.length());
|
Q_ASSERT(r.data == result.data.size());
|
||||||
if (r.status == EndOfString && lastError() == QCborError::NoError)
|
if (r.status == EndOfString && lastError() == QCborError::NoError)
|
||||||
preparse();
|
preparse();
|
||||||
}
|
}
|
||||||
@ -1341,7 +1341,7 @@ QCborStreamReader::StringResult<QByteArray> QCborStreamReader::_readByteArray_he
|
|||||||
if (r.status == Error) {
|
if (r.status == Error) {
|
||||||
result.data.clear();
|
result.data.clear();
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT(r.data == result.data.length());
|
Q_ASSERT(r.data == result.data.size());
|
||||||
if (r.status == EndOfString && lastError() == QCborError::NoError)
|
if (r.status == EndOfString && lastError() == QCborError::NoError)
|
||||||
preparse();
|
preparse();
|
||||||
}
|
}
|
||||||
|
@ -330,7 +330,7 @@ void QJsonArray::append(const QJsonValue &value)
|
|||||||
*/
|
*/
|
||||||
void QJsonArray::removeAt(qsizetype i)
|
void QJsonArray::removeAt(qsizetype i)
|
||||||
{
|
{
|
||||||
if (!a || i < 0 || i >= a->elements.length())
|
if (!a || i < 0 || i >= a->elements.size())
|
||||||
return;
|
return;
|
||||||
detach();
|
detach();
|
||||||
a->removeAt(i);
|
a->removeAt(i);
|
||||||
@ -366,7 +366,7 @@ void QJsonArray::removeAt(qsizetype i)
|
|||||||
*/
|
*/
|
||||||
QJsonValue QJsonArray::takeAt(qsizetype i)
|
QJsonValue QJsonArray::takeAt(qsizetype i)
|
||||||
{
|
{
|
||||||
if (!a || i < 0 || i >= a->elements.length())
|
if (!a || i < 0 || i >= a->elements.size())
|
||||||
return QJsonValue(QJsonValue::Undefined);
|
return QJsonValue(QJsonValue::Undefined);
|
||||||
|
|
||||||
detach();
|
detach();
|
||||||
@ -385,11 +385,11 @@ QJsonValue QJsonArray::takeAt(qsizetype i)
|
|||||||
void QJsonArray::insert(qsizetype i, const QJsonValue &value)
|
void QJsonArray::insert(qsizetype i, const QJsonValue &value)
|
||||||
{
|
{
|
||||||
if (a)
|
if (a)
|
||||||
detach(a->elements.length() + 1);
|
detach(a->elements.size() + 1);
|
||||||
else
|
else
|
||||||
a = new QCborContainerPrivate;
|
a = new QCborContainerPrivate;
|
||||||
|
|
||||||
Q_ASSERT (i >= 0 && i <= a->elements.length());
|
Q_ASSERT (i >= 0 && i <= a->elements.size());
|
||||||
a->insertAt(i, value.type() == QJsonValue::Undefined ? QCborValue(nullptr)
|
a->insertAt(i, value.type() == QJsonValue::Undefined ? QCborValue(nullptr)
|
||||||
: QCborValue::fromJsonValue(value));
|
: QCborValue::fromJsonValue(value));
|
||||||
}
|
}
|
||||||
@ -420,7 +420,7 @@ void QJsonArray::insert(qsizetype i, const QJsonValue &value)
|
|||||||
*/
|
*/
|
||||||
void QJsonArray::replace(qsizetype i, const QJsonValue &value)
|
void QJsonArray::replace(qsizetype i, const QJsonValue &value)
|
||||||
{
|
{
|
||||||
Q_ASSERT (a && i >= 0 && i < a->elements.length());
|
Q_ASSERT (a && i >= 0 && i < a->elements.size());
|
||||||
detach();
|
detach();
|
||||||
a->replaceAt(i, QCborValue::fromJsonValue(value));
|
a->replaceAt(i, QCborValue::fromJsonValue(value));
|
||||||
}
|
}
|
||||||
@ -454,7 +454,7 @@ bool QJsonArray::contains(const QJsonValue &value) const
|
|||||||
*/
|
*/
|
||||||
QJsonValueRef QJsonArray::operator [](qsizetype i)
|
QJsonValueRef QJsonArray::operator [](qsizetype i)
|
||||||
{
|
{
|
||||||
Q_ASSERT(a && i >= 0 && i < a->elements.length());
|
Q_ASSERT(a && i >= 0 && i < a->elements.size());
|
||||||
return QJsonValueRef(this, i);
|
return QJsonValueRef(this, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,13 +477,13 @@ bool QJsonArray::operator==(const QJsonArray &other) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!a)
|
if (!a)
|
||||||
return !other.a->elements.length();
|
return !other.a->elements.size();
|
||||||
if (!other.a)
|
if (!other.a)
|
||||||
return !a->elements.length();
|
return !a->elements.size();
|
||||||
if (a->elements.length() != other.a->elements.length())
|
if (a->elements.size() != other.a->elements.size())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (qsizetype i = 0; i < a->elements.length(); ++i) {
|
for (qsizetype i = 0; i < a->elements.size(); ++i) {
|
||||||
if (a->valueAt(i) != other.a->valueAt(i))
|
if (a->valueAt(i) != other.a->valueAt(i))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ QByteArray QJsonDocument::toJson(JsonFormat format) const
|
|||||||
*/
|
*/
|
||||||
QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error)
|
QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error)
|
||||||
{
|
{
|
||||||
QJsonPrivate::Parser parser(json.constData(), json.length());
|
QJsonPrivate::Parser parser(json.constData(), json.size());
|
||||||
QJsonDocument result;
|
QJsonDocument result;
|
||||||
const QCborValue val = parser.parse(error);
|
const QCborValue val = parser.parse(error);
|
||||||
if (val.isArray() || val.isMap()) {
|
if (val.isArray() || val.isMap()) {
|
||||||
|
@ -228,8 +228,8 @@ QStringList QJsonObject::keys() const
|
|||||||
{
|
{
|
||||||
QStringList keys;
|
QStringList keys;
|
||||||
if (o) {
|
if (o) {
|
||||||
keys.reserve(o->elements.length() / 2);
|
keys.reserve(o->elements.size() / 2);
|
||||||
for (qsizetype i = 0, end = o->elements.length(); i < end; i += 2)
|
for (qsizetype i = 0, end = o->elements.size(); i < end; i += 2)
|
||||||
keys.append(o->stringAt(i));
|
keys.append(o->stringAt(i));
|
||||||
}
|
}
|
||||||
return keys;
|
return keys;
|
||||||
@ -240,7 +240,7 @@ QStringList QJsonObject::keys() const
|
|||||||
*/
|
*/
|
||||||
qsizetype QJsonObject::size() const
|
qsizetype QJsonObject::size() const
|
||||||
{
|
{
|
||||||
return o ? o->elements.length() / 2 : 0;
|
return o ? o->elements.size() / 2 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -392,7 +392,7 @@ QJsonValueRef QJsonObject::atImpl(T key)
|
|||||||
bool keyExists = false;
|
bool keyExists = false;
|
||||||
auto index = indexOf(o, key, &keyExists);
|
auto index = indexOf(o, key, &keyExists);
|
||||||
if (!keyExists) {
|
if (!keyExists) {
|
||||||
detach(o->elements.length() / 2 + 1);
|
detach(o->elements.size() / 2 + 1);
|
||||||
o->insertAt(index, key);
|
o->insertAt(index, key);
|
||||||
o->insertAt(index + 1, QCborValue::fromJsonValue(QJsonValue()));
|
o->insertAt(index + 1, QCborValue::fromJsonValue(QJsonValue()));
|
||||||
}
|
}
|
||||||
@ -458,7 +458,7 @@ template <typename T>
|
|||||||
QJsonObject::iterator QJsonObject::insertAt(qsizetype pos, T key, const QJsonValue &value, bool keyExists)
|
QJsonObject::iterator QJsonObject::insertAt(qsizetype pos, T key, const QJsonValue &value, bool keyExists)
|
||||||
{
|
{
|
||||||
if (o)
|
if (o)
|
||||||
detach(o->elements.length() / 2 + (keyExists ? 0 : 1));
|
detach(o->elements.size() / 2 + (keyExists ? 0 : 1));
|
||||||
else
|
else
|
||||||
o = new QCborContainerPrivate;
|
o = new QCborContainerPrivate;
|
||||||
|
|
||||||
@ -619,13 +619,13 @@ bool QJsonObject::operator==(const QJsonObject &other) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!o)
|
if (!o)
|
||||||
return !other.o->elements.length();
|
return !other.o->elements.size();
|
||||||
if (!other.o)
|
if (!other.o)
|
||||||
return !o->elements.length();
|
return !o->elements.size();
|
||||||
if (o->elements.length() != other.o->elements.length())
|
if (o->elements.size() != other.o->elements.size())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (qsizetype i = 0, end = o->elements.length(); i < end; ++i) {
|
for (qsizetype i = 0, end = o->elements.size(); i < end; ++i) {
|
||||||
if (o->valueAt(i) != other.o->valueAt(i))
|
if (o->valueAt(i) != other.o->valueAt(i))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1352,7 +1352,7 @@ bool QJsonObject::detach(qsizetype reserve)
|
|||||||
{
|
{
|
||||||
if (!o)
|
if (!o)
|
||||||
return true;
|
return true;
|
||||||
o = QCborContainerPrivate::detach(o.data(), reserve ? reserve * 2 : o->elements.length());
|
o = QCborContainerPrivate::detach(o.data(), reserve ? reserve * 2 : o->elements.size());
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1362,7 +1362,7 @@ bool QJsonObject::detach(qsizetype reserve)
|
|||||||
*/
|
*/
|
||||||
QString QJsonObject::keyAt(qsizetype i) const
|
QString QJsonObject::keyAt(qsizetype i) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(o && i >= 0 && i * 2 < o->elements.length());
|
Q_ASSERT(o && i >= 0 && i * 2 < o->elements.size());
|
||||||
return o->stringAt(i * 2);
|
return o->stringAt(i * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1371,7 +1371,7 @@ QString QJsonObject::keyAt(qsizetype i) const
|
|||||||
*/
|
*/
|
||||||
QJsonValue QJsonObject::valueAt(qsizetype i) const
|
QJsonValue QJsonObject::valueAt(qsizetype i) const
|
||||||
{
|
{
|
||||||
if (!o || i < 0 || 2 * i + 1 >= o->elements.length())
|
if (!o || i < 0 || 2 * i + 1 >= o->elements.size())
|
||||||
return QJsonValue(QJsonValue::Undefined);
|
return QJsonValue(QJsonValue::Undefined);
|
||||||
return QJsonPrivate::Value::fromTrustedCbor(o->valueAt(2 * i + 1));
|
return QJsonPrivate::Value::fromTrustedCbor(o->valueAt(2 * i + 1));
|
||||||
}
|
}
|
||||||
@ -1381,7 +1381,7 @@ QJsonValue QJsonObject::valueAt(qsizetype i) const
|
|||||||
*/
|
*/
|
||||||
void QJsonObject::setValueAt(qsizetype i, const QJsonValue &val)
|
void QJsonObject::setValueAt(qsizetype i, const QJsonValue &val)
|
||||||
{
|
{
|
||||||
Q_ASSERT(o && i >= 0 && 2 * i + 1 < o->elements.length());
|
Q_ASSERT(o && i >= 0 && 2 * i + 1 < o->elements.size());
|
||||||
detach();
|
detach();
|
||||||
if (val.isUndefined()) {
|
if (val.isUndefined()) {
|
||||||
o->removeAt(2 * i + 1);
|
o->removeAt(2 * i + 1);
|
||||||
|
@ -552,7 +552,7 @@ bool Parser::parseArray()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG << "size =" << (container ? container->elements.length() : 0);
|
DEBUG << "size =" << (container ? container->elements.size() : 0);
|
||||||
END;
|
END;
|
||||||
|
|
||||||
--nestingLevel;
|
--nestingLevel;
|
||||||
|
@ -25,10 +25,10 @@ static inline uchar hexdig(uint u)
|
|||||||
static QByteArray escapedString(const QString &s)
|
static QByteArray escapedString(const QString &s)
|
||||||
{
|
{
|
||||||
// give it a minimum size to ensure the resize() below always adds enough space
|
// give it a minimum size to ensure the resize() below always adds enough space
|
||||||
QByteArray ba(qMax(s.length(), 16), Qt::Uninitialized);
|
QByteArray ba(qMax(s.size(), 16), Qt::Uninitialized);
|
||||||
|
|
||||||
uchar *cursor = reinterpret_cast<uchar *>(const_cast<char *>(ba.constData()));
|
uchar *cursor = reinterpret_cast<uchar *>(const_cast<char *>(ba.constData()));
|
||||||
const uchar *ba_end = cursor + ba.length();
|
const uchar *ba_end = cursor + ba.size();
|
||||||
const char16_t *src = reinterpret_cast<const char16_t *>(s.constBegin());
|
const char16_t *src = reinterpret_cast<const char16_t *>(s.constBegin());
|
||||||
const char16_t *const end = reinterpret_cast<const char16_t *>(s.constEnd());
|
const char16_t *const end = reinterpret_cast<const char16_t *>(s.constEnd());
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ static QByteArray escapedString(const QString &s)
|
|||||||
int pos = cursor - (const uchar *)ba.constData();
|
int pos = cursor - (const uchar *)ba.constData();
|
||||||
ba.resize(ba.size()*2);
|
ba.resize(ba.size()*2);
|
||||||
cursor = (uchar *)ba.data() + pos;
|
cursor = (uchar *)ba.data() + pos;
|
||||||
ba_end = (const uchar *)ba.constData() + ba.length();
|
ba_end = (const uchar *)ba.constData() + ba.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
char16_t u = *src++;
|
char16_t u = *src++;
|
||||||
|
@ -2497,7 +2497,7 @@ QTextStream &QTextStream::operator<<(const QByteArray &array)
|
|||||||
{
|
{
|
||||||
Q_D(QTextStream);
|
Q_D(QTextStream);
|
||||||
CHECK_VALID_STREAM(*this);
|
CHECK_VALID_STREAM(*this);
|
||||||
d->putString(QString::fromUtf8(array.constData(), array.length()));
|
d->putString(QString::fromUtf8(array.constData(), array.size()));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3028,7 +3028,7 @@ void QXmlStreamWriterPrivate::indent(int level)
|
|||||||
{
|
{
|
||||||
write("\n");
|
write("\n");
|
||||||
for (int i = level; i > 0; --i)
|
for (int i = level; i > 0; --i)
|
||||||
write(autoFormattingIndent.constData(), autoFormattingIndent.length());
|
write(autoFormattingIndent.constData(), autoFormattingIndent.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ public:
|
|||||||
// the number of QByteArrays
|
// the number of QByteArrays
|
||||||
qsizetype bufferCount() const
|
qsizetype bufferCount() const
|
||||||
{
|
{
|
||||||
return buffers.length();
|
return buffers.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool isEmpty() const
|
inline bool isEmpty() const
|
||||||
@ -267,12 +267,12 @@ public:
|
|||||||
|
|
||||||
inline bool canReadLine() const {
|
inline bool canReadLine() const {
|
||||||
qsizetype i = 0;
|
qsizetype i = 0;
|
||||||
if (i < buffers.length()) {
|
if (i < buffers.size()) {
|
||||||
if (buffers.at(i).indexOf('\n', firstPos) != -1)
|
if (buffers.at(i).indexOf('\n', firstPos) != -1)
|
||||||
return true;
|
return true;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
for (; i < buffers.length(); i++)
|
for (; i < buffers.size(); i++)
|
||||||
if (buffers.at(i).contains('\n'))
|
if (buffers.at(i).contains('\n'))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1815,7 +1815,7 @@ static void decomposeHelper(QString *str, bool canonical, QChar::UnicodeVersion
|
|||||||
QString &s = *str;
|
QString &s = *str;
|
||||||
|
|
||||||
const unsigned short *utf16 = reinterpret_cast<unsigned short *>(s.data());
|
const unsigned short *utf16 = reinterpret_cast<unsigned short *>(s.data());
|
||||||
const unsigned short *uc = utf16 + s.length();
|
const unsigned short *uc = utf16 + s.size();
|
||||||
while (uc != utf16 + from) {
|
while (uc != utf16 + from) {
|
||||||
char32_t ucs4 = *(--uc);
|
char32_t ucs4 = *(--uc);
|
||||||
if (QChar(ucs4).isLowSurrogate() && uc != utf16) {
|
if (QChar(ucs4).isLowSurrogate() && uc != utf16) {
|
||||||
@ -1910,7 +1910,7 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, qsizetype
|
|||||||
{
|
{
|
||||||
QString &s = *str;
|
QString &s = *str;
|
||||||
|
|
||||||
if (from < 0 || s.length() - from < 2)
|
if (from < 0 || s.size() - from < 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char32_t stcode = 0; // starter code point
|
char32_t stcode = 0; // starter code point
|
||||||
@ -1919,10 +1919,10 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, qsizetype
|
|||||||
int lastCombining = 255; // to prevent combining > lastCombining
|
int lastCombining = 255; // to prevent combining > lastCombining
|
||||||
|
|
||||||
qsizetype pos = from;
|
qsizetype pos = from;
|
||||||
while (pos < s.length()) {
|
while (pos < s.size()) {
|
||||||
qsizetype i = pos;
|
qsizetype i = pos;
|
||||||
char32_t uc = s.at(pos).unicode();
|
char32_t uc = s.at(pos).unicode();
|
||||||
if (QChar(uc).isHighSurrogate() && pos < s.length()-1) {
|
if (QChar(uc).isHighSurrogate() && pos < s.size()-1) {
|
||||||
ushort low = s.at(pos+1).unicode();
|
ushort low = s.at(pos+1).unicode();
|
||||||
if (QChar(low).isLowSurrogate()) {
|
if (QChar(low).isLowSurrogate()) {
|
||||||
uc = QChar::surrogateToUcs4(uc, low);
|
uc = QChar::surrogateToUcs4(uc, low);
|
||||||
@ -1969,7 +1969,7 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, qsizetype
|
|||||||
static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, qsizetype from)
|
static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, qsizetype from)
|
||||||
{
|
{
|
||||||
QString &s = *str;
|
QString &s = *str;
|
||||||
const qsizetype l = s.length()-1;
|
const qsizetype l = s.size()-1;
|
||||||
|
|
||||||
char32_t u1, u2;
|
char32_t u1, u2;
|
||||||
char16_t c1, c2;
|
char16_t c1, c2;
|
||||||
|
@ -3745,11 +3745,11 @@ QString QLocaleData::decimalForm(QString &&digits, int decpt, int precision,
|
|||||||
digits.append(zero);
|
digits.append(zero);
|
||||||
break;
|
break;
|
||||||
case PMChopTrailingZeros:
|
case PMChopTrailingZeros:
|
||||||
Q_ASSERT(digits.length() / digitWidth <= qMax(decpt, 1) || !digits.endsWith(zero));
|
Q_ASSERT(digits.size() / digitWidth <= qMax(decpt, 1) || !digits.endsWith(zero));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mustMarkDecimal || decpt < digits.length() / digitWidth)
|
if (mustMarkDecimal || decpt < digits.size() / digitWidth)
|
||||||
digits.insert(decpt * digitWidth, decimalPoint());
|
digits.insert(decpt * digitWidth, decimalPoint());
|
||||||
|
|
||||||
if (groupDigits) {
|
if (groupDigits) {
|
||||||
@ -3787,11 +3787,11 @@ QString QLocaleData::exponentForm(QString &&digits, int decpt, int precision,
|
|||||||
digits.append(zero);
|
digits.append(zero);
|
||||||
break;
|
break;
|
||||||
case PMChopTrailingZeros:
|
case PMChopTrailingZeros:
|
||||||
Q_ASSERT(digits.length() / digitWidth <= 1 || !digits.endsWith(zero));
|
Q_ASSERT(digits.size() / digitWidth <= 1 || !digits.endsWith(zero));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mustMarkDecimal || digits.length() > digitWidth)
|
if (mustMarkDecimal || digits.size() > digitWidth)
|
||||||
digits.insert(digitWidth, decimalPoint());
|
digits.insert(digitWidth, decimalPoint());
|
||||||
|
|
||||||
digits.append(exponentSeparator());
|
digits.append(exponentSeparator());
|
||||||
@ -3840,7 +3840,7 @@ QString QLocaleData::applyIntegerFormatting(QString &&numStr, bool negative, int
|
|||||||
{
|
{
|
||||||
const QString zero = base == 10 ? zeroDigit() : QStringLiteral("0");
|
const QString zero = base == 10 ? zeroDigit() : QStringLiteral("0");
|
||||||
const auto digitWidth = zero.size();
|
const auto digitWidth = zero.size();
|
||||||
const auto digitCount = numStr.length() / digitWidth;
|
const auto digitCount = numStr.size() / digitWidth;
|
||||||
|
|
||||||
const auto basePrefix = [&] () -> QStringView {
|
const auto basePrefix = [&] () -> QStringView {
|
||||||
if (flags & ShowBase) {
|
if (flags & ShowBase) {
|
||||||
|
@ -687,7 +687,7 @@ static T dtoString(double d, QLocaleData::DoubleForm form, int precision, bool u
|
|||||||
bool negative = false;
|
bool negative = false;
|
||||||
int length = 0;
|
int length = 0;
|
||||||
int decpt = 0;
|
int decpt = 0;
|
||||||
qt_doubleToAscii(d, form, precision, buffer.data(), buffer.length(), negative, length, decpt);
|
qt_doubleToAscii(d, form, precision, buffer.data(), buffer.size(), negative, length, decpt);
|
||||||
QLatin1StringView view(buffer.data(), length);
|
QLatin1StringView view(buffer.data(), length);
|
||||||
const bool succinct = form == QLocaleData::DFSignificantDigits;
|
const bool succinct = form == QLocaleData::DFSignificantDigits;
|
||||||
qsizetype total = (negative ? 1 : 0) + length;
|
qsizetype total = (negative ? 1 : 0) + length;
|
||||||
|
@ -894,7 +894,7 @@ void QRegularExpressionPrivate::compilePattern()
|
|||||||
|
|
||||||
PCRE2_SIZE patternErrorOffset;
|
PCRE2_SIZE patternErrorOffset;
|
||||||
compiledPattern = pcre2_compile_16(reinterpret_cast<PCRE2_SPTR16>(pattern.constData()),
|
compiledPattern = pcre2_compile_16(reinterpret_cast<PCRE2_SPTR16>(pattern.constData()),
|
||||||
pattern.length(),
|
pattern.size(),
|
||||||
options,
|
options,
|
||||||
&errorCode,
|
&errorCode,
|
||||||
&patternErrorOffset,
|
&patternErrorOffset,
|
||||||
@ -1540,10 +1540,10 @@ QString QRegularExpression::errorString() const
|
|||||||
QString errorString;
|
QString errorString;
|
||||||
int errorStringLength;
|
int errorStringLength;
|
||||||
do {
|
do {
|
||||||
errorString.resize(errorString.length() + 64);
|
errorString.resize(errorString.size() + 64);
|
||||||
errorStringLength = pcre2_get_error_message_16(d->errorCode,
|
errorStringLength = pcre2_get_error_message_16(d->errorCode,
|
||||||
reinterpret_cast<ushort *>(errorString.data()),
|
reinterpret_cast<ushort *>(errorString.data()),
|
||||||
errorString.length());
|
errorString.size());
|
||||||
} while (errorStringLength < 0);
|
} while (errorStringLength < 0);
|
||||||
errorString.resize(errorStringLength);
|
errorString.resize(errorStringLength);
|
||||||
|
|
||||||
|
@ -3444,7 +3444,7 @@ QString &QString::remove(QChar ch, Qt::CaseSensitivity cs)
|
|||||||
*/
|
*/
|
||||||
QString &QString::replace(qsizetype pos, qsizetype len, const QString &after)
|
QString &QString::replace(qsizetype pos, qsizetype len, const QString &after)
|
||||||
{
|
{
|
||||||
return replace(pos, len, after.constData(), after.length());
|
return replace(pos, len, after.constData(), after.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -4164,7 +4164,7 @@ QString &QString::replace(QChar c, QLatin1StringView after, Qt::CaseSensitivity
|
|||||||
*/
|
*/
|
||||||
qsizetype QString::indexOf(const QString &str, qsizetype from, Qt::CaseSensitivity cs) const
|
qsizetype QString::indexOf(const QString &str, qsizetype from, Qt::CaseSensitivity cs) const
|
||||||
{
|
{
|
||||||
return QtPrivate::findString(QStringView(unicode(), length()), from, QStringView(str.unicode(), str.length()), cs);
|
return QtPrivate::findString(QStringView(unicode(), length()), from, QStringView(str.unicode(), str.size()), cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -4418,7 +4418,7 @@ QString &QString::replace(const QRegularExpression &re, const QString &after)
|
|||||||
// 1. build the backreferences list, holding where the backreferences
|
// 1. build the backreferences list, holding where the backreferences
|
||||||
// are in the replacement string
|
// are in the replacement string
|
||||||
QList<QStringCapture> backReferences;
|
QList<QStringCapture> backReferences;
|
||||||
const qsizetype al = after.length();
|
const qsizetype al = after.size();
|
||||||
const QChar *ac = after.unicode();
|
const QChar *ac = after.unicode();
|
||||||
|
|
||||||
for (qsizetype i = 0; i < al - 1; i++) {
|
for (qsizetype i = 0; i < al - 1; i++) {
|
||||||
@ -6422,7 +6422,7 @@ int QLatin1StringView::compare_helper(const QChar *data1, qsizetype length1, QLa
|
|||||||
*/
|
*/
|
||||||
int QString::localeAwareCompare(const QString &other) const
|
int QString::localeAwareCompare(const QString &other) const
|
||||||
{
|
{
|
||||||
return localeAwareCompare_helper(constData(), length(), other.constData(), other.length());
|
return localeAwareCompare_helper(constData(), length(), other.constData(), other.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -7078,27 +7078,27 @@ QString QString::vasprintf(const char *cformat, va_list ap)
|
|||||||
switch (length_mod) {
|
switch (length_mod) {
|
||||||
case lm_hh: {
|
case lm_hh: {
|
||||||
signed char *n = va_arg(ap, signed char*);
|
signed char *n = va_arg(ap, signed char*);
|
||||||
*n = result.length();
|
*n = result.size();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case lm_h: {
|
case lm_h: {
|
||||||
short int *n = va_arg(ap, short int*);
|
short int *n = va_arg(ap, short int*);
|
||||||
*n = result.length();
|
*n = result.size();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case lm_l: {
|
case lm_l: {
|
||||||
long int *n = va_arg(ap, long int*);
|
long int *n = va_arg(ap, long int*);
|
||||||
*n = result.length();
|
*n = result.size();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case lm_ll: {
|
case lm_ll: {
|
||||||
qint64 *n = va_arg(ap, qint64*);
|
qint64 *n = va_arg(ap, qint64*);
|
||||||
*n = result.length();
|
*n = result.size();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
int *n = va_arg(ap, int*);
|
int *n = va_arg(ap, int*);
|
||||||
*n = result.length();
|
*n = result.size();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -7928,7 +7928,7 @@ void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar::
|
|||||||
char16_t ucs4Low = QChar::lowSurrogate(n.ucs4);
|
char16_t ucs4Low = QChar::lowSurrogate(n.ucs4);
|
||||||
char16_t oldHigh = QChar::highSurrogate(n.old_mapping);
|
char16_t oldHigh = QChar::highSurrogate(n.old_mapping);
|
||||||
char16_t oldLow = QChar::lowSurrogate(n.old_mapping);
|
char16_t oldLow = QChar::lowSurrogate(n.old_mapping);
|
||||||
while (pos < s.length() - 1) {
|
while (pos < s.size() - 1) {
|
||||||
if (s.at(pos).unicode() == ucs4High && s.at(pos + 1).unicode() == ucs4Low) {
|
if (s.at(pos).unicode() == ucs4High && s.at(pos + 1).unicode() == ucs4Low) {
|
||||||
if (!d)
|
if (!d)
|
||||||
d = data->data();
|
d = data->data();
|
||||||
@ -7938,7 +7938,7 @@ void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar::
|
|||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (pos < s.length()) {
|
while (pos < s.size()) {
|
||||||
if (s.at(pos).unicode() == n.ucs4) {
|
if (s.at(pos).unicode() == n.ucs4) {
|
||||||
if (!d)
|
if (!d)
|
||||||
d = data->data();
|
d = data->data();
|
||||||
@ -8381,7 +8381,7 @@ QString QString::arg(qlonglong a, int fieldWidth, int base, QChar fillChar) cons
|
|||||||
if (d.occurrences > d.locale_occurrences) {
|
if (d.occurrences > d.locale_occurrences) {
|
||||||
arg = QLocaleData::c()->longLongToString(a, -1, base, fieldWidth, flags);
|
arg = QLocaleData::c()->longLongToString(a, -1, base, fieldWidth, flags);
|
||||||
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
||||||
|| fieldWidth <= arg.length());
|
|| fieldWidth <= arg.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString localeArg;
|
QString localeArg;
|
||||||
@ -8391,7 +8391,7 @@ QString QString::arg(qlonglong a, int fieldWidth, int base, QChar fillChar) cons
|
|||||||
flags |= QLocaleData::GroupDigits;
|
flags |= QLocaleData::GroupDigits;
|
||||||
localeArg = locale.d->m_data->longLongToString(a, -1, base, fieldWidth, flags);
|
localeArg = locale.d->m_data->longLongToString(a, -1, base, fieldWidth, flags);
|
||||||
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
||||||
|| fieldWidth <= localeArg.length());
|
|| fieldWidth <= localeArg.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
return replaceArgEscapes(*this, d, fieldWidth, arg, localeArg, fillChar);
|
return replaceArgEscapes(*this, d, fieldWidth, arg, localeArg, fillChar);
|
||||||
@ -8429,7 +8429,7 @@ QString QString::arg(qulonglong a, int fieldWidth, int base, QChar fillChar) con
|
|||||||
if (d.occurrences > d.locale_occurrences) {
|
if (d.occurrences > d.locale_occurrences) {
|
||||||
arg = QLocaleData::c()->unsLongLongToString(a, -1, base, fieldWidth, flags);
|
arg = QLocaleData::c()->unsLongLongToString(a, -1, base, fieldWidth, flags);
|
||||||
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
||||||
|| fieldWidth <= arg.length());
|
|| fieldWidth <= arg.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString localeArg;
|
QString localeArg;
|
||||||
@ -8439,7 +8439,7 @@ QString QString::arg(qulonglong a, int fieldWidth, int base, QChar fillChar) con
|
|||||||
flags |= QLocaleData::GroupDigits;
|
flags |= QLocaleData::GroupDigits;
|
||||||
localeArg = locale.d->m_data->unsLongLongToString(a, -1, base, fieldWidth, flags);
|
localeArg = locale.d->m_data->unsLongLongToString(a, -1, base, fieldWidth, flags);
|
||||||
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
||||||
|| fieldWidth <= localeArg.length());
|
|| fieldWidth <= localeArg.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
return replaceArgEscapes(*this, d, fieldWidth, arg, localeArg, fillChar);
|
return replaceArgEscapes(*this, d, fieldWidth, arg, localeArg, fillChar);
|
||||||
@ -8551,7 +8551,7 @@ QString QString::arg(double a, int fieldWidth, char format, int precision, QChar
|
|||||||
arg = QLocaleData::c()->doubleToString(a, precision, form, fieldWidth,
|
arg = QLocaleData::c()->doubleToString(a, precision, form, fieldWidth,
|
||||||
flags | QLocaleData::ZeroPadExponent);
|
flags | QLocaleData::ZeroPadExponent);
|
||||||
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
||||||
|| fieldWidth <= arg.length());
|
|| fieldWidth <= arg.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString localeArg;
|
QString localeArg;
|
||||||
@ -8567,7 +8567,7 @@ QString QString::arg(double a, int fieldWidth, char format, int precision, QChar
|
|||||||
flags |= QLocaleData::AddTrailingZeroes;
|
flags |= QLocaleData::AddTrailingZeroes;
|
||||||
localeArg = locale.d->m_data->doubleToString(a, precision, form, fieldWidth, flags);
|
localeArg = locale.d->m_data->doubleToString(a, precision, form, fieldWidth, flags);
|
||||||
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
Q_ASSERT(fillChar != u'0' || !qIsFinite(a)
|
||||||
|| fieldWidth <= localeArg.length());
|
|| fieldWidth <= localeArg.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
return replaceArgEscapes(*this, d, fieldWidth, arg, localeArg, fillChar);
|
return replaceArgEscapes(*this, d, fieldWidth, arg, localeArg, fillChar);
|
||||||
@ -10320,10 +10320,10 @@ QDataStream &operator<<(QDataStream &out, const QString &str)
|
|||||||
if (!str.isNull() || out.version() < 3) {
|
if (!str.isNull() || out.version() < 3) {
|
||||||
if ((out.byteOrder() == QDataStream::BigEndian) == (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
|
if ((out.byteOrder() == QDataStream::BigEndian) == (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
|
||||||
out.writeBytes(reinterpret_cast<const char *>(str.unicode()),
|
out.writeBytes(reinterpret_cast<const char *>(str.unicode()),
|
||||||
static_cast<uint>(sizeof(QChar) * str.length()));
|
static_cast<uint>(sizeof(QChar) * str.size()));
|
||||||
} else {
|
} else {
|
||||||
QVarLengthArray<char16_t> buffer(str.length());
|
QVarLengthArray<char16_t> buffer(str.size());
|
||||||
qbswap<sizeof(char16_t)>(str.constData(), str.length(), buffer.data());
|
qbswap<sizeof(char16_t)>(str.constData(), str.size(), buffer.data());
|
||||||
out.writeBytes(reinterpret_cast<const char *>(buffer.data()),
|
out.writeBytes(reinterpret_cast<const char *>(buffer.data()),
|
||||||
static_cast<uint>(sizeof(char16_t) * buffer.size()));
|
static_cast<uint>(sizeof(char16_t) * buffer.size()));
|
||||||
}
|
}
|
||||||
|
@ -678,7 +678,7 @@ public:
|
|||||||
|
|
||||||
QString &insert(qsizetype i, QChar c);
|
QString &insert(qsizetype i, QChar c);
|
||||||
QString &insert(qsizetype i, const QChar *uc, qsizetype len);
|
QString &insert(qsizetype i, const QChar *uc, qsizetype len);
|
||||||
inline QString &insert(qsizetype i, const QString &s) { return insert(i, s.constData(), s.length()); }
|
inline QString &insert(qsizetype i, const QString &s) { return insert(i, s.constData(), s.size()); }
|
||||||
inline QString &insert(qsizetype i, QStringView v) { return insert(i, v.data(), v.length()); }
|
inline QString &insert(qsizetype i, QStringView v) { return insert(i, v.data(), v.length()); }
|
||||||
QString &insert(qsizetype i, QLatin1StringView s);
|
QString &insert(qsizetype i, QLatin1StringView s);
|
||||||
|
|
||||||
|
@ -877,7 +877,7 @@ QByteArray QUtf16::convertFromUnicode(QStringView in, QStringConverter::State *s
|
|||||||
|
|
||||||
QByteArray d(length, Qt::Uninitialized);
|
QByteArray d(length, Qt::Uninitialized);
|
||||||
char *end = convertFromUnicode(d.data(), in, state, endian);
|
char *end = convertFromUnicode(d.data(), in, state, endian);
|
||||||
Q_ASSERT(end - d.constData() == d.length());
|
Q_ASSERT(end - d.constData() == d.size());
|
||||||
Q_UNUSED(end);
|
Q_UNUSED(end);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@ -1491,15 +1491,15 @@ static char *toLatin1(char *out, QStringView in, QStringConverter::State *state)
|
|||||||
static QChar *fromLocal8Bit(QChar *out, QByteArrayView in, QStringConverter::State *state)
|
static QChar *fromLocal8Bit(QChar *out, QByteArrayView in, QStringConverter::State *state)
|
||||||
{
|
{
|
||||||
QString s = QLocal8Bit::convertToUnicode(in, state);
|
QString s = QLocal8Bit::convertToUnicode(in, state);
|
||||||
memcpy(out, s.constData(), s.length()*sizeof(QChar));
|
memcpy(out, s.constData(), s.size()*sizeof(QChar));
|
||||||
return out + s.length();
|
return out + s.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *toLocal8Bit(char *out, QStringView in, QStringConverter::State *state)
|
static char *toLocal8Bit(char *out, QStringView in, QStringConverter::State *state)
|
||||||
{
|
{
|
||||||
QByteArray s = QLocal8Bit::convertFromUnicode(in, state);
|
QByteArray s = QLocal8Bit::convertFromUnicode(in, state);
|
||||||
memcpy(out, s.constData(), s.length());
|
memcpy(out, s.constData(), s.size());
|
||||||
return out + s.length();
|
return out + s.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline QString join(const QString &sep) const
|
inline QString join(const QString &sep) const
|
||||||
{ return QtPrivate::QStringList_join(self(), sep.constData(), sep.length()); }
|
{ return QtPrivate::QStringList_join(self(), sep.constData(), sep.size()); }
|
||||||
inline QStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
|
inline QStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
|
||||||
{ return QtPrivate::QStringList_filter(self(), str, cs); }
|
{ return QtPrivate::QStringList_filter(self(), str, cs); }
|
||||||
inline QStringList &replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive)
|
inline QStringList &replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive)
|
||||||
|
@ -726,7 +726,7 @@ void QFutureInterfaceBasePrivate::sendCallOut(const QFutureCallOutEvent &callOut
|
|||||||
if (outputConnections.isEmpty())
|
if (outputConnections.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < outputConnections.count(); ++i)
|
for (int i = 0; i < outputConnections.size(); ++i)
|
||||||
outputConnections.at(i)->postCallOutEvent(callOutEvent);
|
outputConnections.at(i)->postCallOutEvent(callOutEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -736,7 +736,7 @@ void QFutureInterfaceBasePrivate::sendCallOuts(const QFutureCallOutEvent &callOu
|
|||||||
if (outputConnections.isEmpty())
|
if (outputConnections.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < outputConnections.count(); ++i) {
|
for (int i = 0; i < outputConnections.size(); ++i) {
|
||||||
QFutureCallOutInterface *interface = outputConnections.at(i);
|
QFutureCallOutInterface *interface = outputConnections.at(i);
|
||||||
interface->postCallOutEvent(callOutEvent1);
|
interface->postCallOutEvent(callOutEvent1);
|
||||||
interface->postCallOutEvent(callOutEvent2);
|
interface->postCallOutEvent(callOutEvent2);
|
||||||
|
@ -347,7 +347,7 @@ inline bool QFutureInterface<T>::reportResults(const QList<T> &_results, int beg
|
|||||||
if (store.filterMode()) {
|
if (store.filterMode()) {
|
||||||
this->reportResultsReady(resultCountBefore, store.count());
|
this->reportResultsReady(resultCountBefore, store.count());
|
||||||
} else {
|
} else {
|
||||||
this->reportResultsReady(insertIndex, insertIndex + _results.count());
|
this->reportResultsReady(insertIndex, insertIndex + _results.size());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -38,12 +38,12 @@ public:
|
|||||||
void waitForFinished()
|
void waitForFinished()
|
||||||
{
|
{
|
||||||
if (m_cancelOnWait) {
|
if (m_cancelOnWait) {
|
||||||
for (int i = 0; i < m_futures.count(); ++i) {
|
for (int i = 0; i < m_futures.size(); ++i) {
|
||||||
m_futures[i].cancel();
|
m_futures[i].cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < m_futures.count(); ++i) {
|
for (int i = 0; i < m_futures.size(); ++i) {
|
||||||
m_futures[i].waitForFinished();
|
m_futures[i].waitForFinished();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,9 +200,9 @@ void QThreadPoolPrivate::enqueueTask(QRunnable *runnable, int priority)
|
|||||||
|
|
||||||
int QThreadPoolPrivate::activeThreadCount() const
|
int QThreadPoolPrivate::activeThreadCount() const
|
||||||
{
|
{
|
||||||
return (allThreads.count()
|
return (allThreads.size()
|
||||||
- expiredThreads.count()
|
- expiredThreads.size()
|
||||||
- waitingThreads.count()
|
- waitingThreads.size()
|
||||||
+ reservedThreads);
|
+ reservedThreads);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ QThreadStorageData::QThreadStorageData(void (*func)(void *))
|
|||||||
no where to store it, and no way to actually call it.
|
no where to store it, and no way to actually call it.
|
||||||
*/
|
*/
|
||||||
QThreadData *data = QThreadData::current();
|
QThreadData *data = QThreadData::current();
|
||||||
id = data->tls.count();
|
id = data->tls.size();
|
||||||
DEBUG_MSG("QThreadStorageData: Allocated id %d, destructor %p cannot be stored", id, func);
|
DEBUG_MSG("QThreadStorageData: Allocated id %d, destructor %p cannot be stored", id, func);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4998,7 +4998,7 @@ QDateTime QDateTime::fromString(QStringView string, Qt::DateFormat format)
|
|||||||
|
|
||||||
// Documented as "ddd MMM d HH:mm:ss yyyy" with optional offset-suffix;
|
// Documented as "ddd MMM d HH:mm:ss yyyy" with optional offset-suffix;
|
||||||
// and allow time either before or after year.
|
// and allow time either before or after year.
|
||||||
if (parts.count() < 5 || it != tokens.end())
|
if (parts.size() < 5 || it != tokens.end())
|
||||||
return QDateTime();
|
return QDateTime();
|
||||||
|
|
||||||
// Year and time can be in either order.
|
// Year and time can be in either order.
|
||||||
@ -5027,7 +5027,7 @@ QDateTime QDateTime::fromString(QStringView string, Qt::DateFormat format)
|
|||||||
if (!time.isValid())
|
if (!time.isValid())
|
||||||
return QDateTime();
|
return QDateTime();
|
||||||
|
|
||||||
if (parts.count() == 5)
|
if (parts.size() == 5)
|
||||||
return QDateTime(date, time, Qt::LocalTime);
|
return QDateTime(date, time, Qt::LocalTime);
|
||||||
|
|
||||||
QStringView tz = parts.at(5);
|
QStringView tz = parts.at(5);
|
||||||
|
@ -662,7 +662,7 @@ QByteArray QTimeZonePrivate::windowsIdToDefaultIanaId(const QByteArray &windowsI
|
|||||||
QLocale::Territory territory)
|
QLocale::Territory territory)
|
||||||
{
|
{
|
||||||
const QList<QByteArray> list = windowsIdToIanaIds(windowsId, territory);
|
const QList<QByteArray> list = windowsIdToIanaIds(windowsId, territory);
|
||||||
return list.count() > 0 ? list.first() : QByteArray();
|
return list.size() > 0 ? list.first() : QByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QByteArray> QTimeZonePrivate::windowsIdToIanaIds(const QByteArray &windowsId)
|
QList<QByteArray> QTimeZonePrivate::windowsIdToIanaIds(const QByteArray &windowsId)
|
||||||
|
@ -357,7 +357,7 @@ static QDate calculatePosixDate(const QByteArray &dateRule, int year)
|
|||||||
if (dateRule.at(0) == 'M') {
|
if (dateRule.at(0) == 'M') {
|
||||||
// nth week in month format "Mmonth.week.dow"
|
// nth week in month format "Mmonth.week.dow"
|
||||||
QList<QByteArray> dateParts = dateRule.split('.');
|
QList<QByteArray> dateParts = dateRule.split('.');
|
||||||
if (dateParts.count() > 2) {
|
if (dateParts.size() > 2) {
|
||||||
int month = dateParts.at(0).mid(1).toInt(&ok);
|
int month = dateParts.at(0).mid(1).toInt(&ok);
|
||||||
int week = ok ? dateParts.at(1).toInt(&ok) : 0;
|
int week = ok ? dateParts.at(1).toInt(&ok) : 0;
|
||||||
int dow = ok ? dateParts.at(2).toInt(&ok) : 0;
|
int dow = ok ? dateParts.at(2).toInt(&ok) : 0;
|
||||||
@ -526,7 +526,7 @@ static auto validatePosixRule(const QByteArray &posixRule)
|
|||||||
// http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
|
// http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
|
||||||
// See also calculatePosixTransition()'s reference.
|
// See also calculatePosixTransition()'s reference.
|
||||||
const auto parts = posixRule.split(',');
|
const auto parts = posixRule.split(',');
|
||||||
const struct { bool isValid, hasDst; } fail{false, false}, good{true, parts.count() > 1};
|
const struct { bool isValid, hasDst; } fail{false, false}, good{true, parts.size() > 1};
|
||||||
const QByteArray &zoneinfo = parts.at(0);
|
const QByteArray &zoneinfo = parts.at(0);
|
||||||
if (zoneinfo.isEmpty())
|
if (zoneinfo.isEmpty())
|
||||||
return fail;
|
return fail;
|
||||||
@ -548,13 +548,13 @@ static auto validatePosixRule(const QByteArray &posixRule)
|
|||||||
return fail;
|
return fail;
|
||||||
|
|
||||||
if (good.hasDst) {
|
if (good.hasDst) {
|
||||||
if (parts.count() != 3 || parts.at(1).isEmpty() || parts.at(2).isEmpty())
|
if (parts.size() != 3 || parts.at(1).isEmpty() || parts.at(2).isEmpty())
|
||||||
return fail;
|
return fail;
|
||||||
for (int i = 1; i < 3; ++i) {
|
for (int i = 1; i < 3; ++i) {
|
||||||
const auto tran = parts.at(i).split('/');
|
const auto tran = parts.at(i).split('/');
|
||||||
if (!calculatePosixDate(tran.at(0), 1972).isValid())
|
if (!calculatePosixDate(tran.at(0), 1972).isValid())
|
||||||
return fail;
|
return fail;
|
||||||
if (tran.count() > 1) {
|
if (tran.size() > 1) {
|
||||||
const auto time = tran.at(1);
|
const auto time = tran.at(1);
|
||||||
if (parsePosixTime(time.begin(), time.end()) == INT_MIN)
|
if (parsePosixTime(time.begin(), time.end()) == INT_MIN)
|
||||||
return fail;
|
return fail;
|
||||||
@ -595,7 +595,7 @@ static QList<QTimeZonePrivate::Data> calculatePosixTransitions(const QByteArray
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If only the name part, or no DST specified, then no transitions
|
// If only the name part, or no DST specified, then no transitions
|
||||||
if (parts.count() == 1 || !dstZone.hasValidOffset()) {
|
if (parts.size() == 1 || !dstZone.hasValidOffset()) {
|
||||||
QTimeZonePrivate::Data data;
|
QTimeZonePrivate::Data data;
|
||||||
data.atMSecsSinceEpoch = lastTranMSecs;
|
data.atMSecsSinceEpoch = lastTranMSecs;
|
||||||
data.offsetFromUtc = stdZone.offset;
|
data.offsetFromUtc = stdZone.offset;
|
||||||
@ -605,19 +605,19 @@ static QList<QTimeZonePrivate::Data> calculatePosixTransitions(const QByteArray
|
|||||||
result << data;
|
result << data;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (parts.count() < 3 || parts.at(1).isEmpty() || parts.at(2).isEmpty())
|
if (parts.size() < 3 || parts.at(1).isEmpty() || parts.at(2).isEmpty())
|
||||||
return result; // Malformed.
|
return result; // Malformed.
|
||||||
|
|
||||||
// Get the std to dst transition details
|
// Get the std to dst transition details
|
||||||
const int twoOClock = 7200; // Default transition time, when none specified
|
const int twoOClock = 7200; // Default transition time, when none specified
|
||||||
const auto dstParts = parts.at(1).split('/');
|
const auto dstParts = parts.at(1).split('/');
|
||||||
const QByteArray dstDateRule = dstParts.at(0);
|
const QByteArray dstDateRule = dstParts.at(0);
|
||||||
const int dstTime = dstParts.count() < 2 ? twoOClock : parsePosixTransitionTime(dstParts.at(1));
|
const int dstTime = dstParts.size() < 2 ? twoOClock : parsePosixTransitionTime(dstParts.at(1));
|
||||||
|
|
||||||
// Get the dst to std transition details
|
// Get the dst to std transition details
|
||||||
const auto stdParts = parts.at(2).split('/');
|
const auto stdParts = parts.at(2).split('/');
|
||||||
const QByteArray stdDateRule = stdParts.at(0);
|
const QByteArray stdDateRule = stdParts.at(0);
|
||||||
const int stdTime = stdParts.count() < 2 ? twoOClock : parsePosixTransitionTime(stdParts.at(1));
|
const int stdTime = stdParts.size() < 2 ? twoOClock : parsePosixTransitionTime(stdParts.at(1));
|
||||||
|
|
||||||
if (dstDateRule.isEmpty() || stdDateRule.isEmpty() || dstTime == INT_MIN || stdTime == INT_MIN)
|
if (dstDateRule.isEmpty() || stdDateRule.isEmpty() || dstTime == INT_MIN || stdTime == INT_MIN)
|
||||||
return result; // Malformed.
|
return result; // Malformed.
|
||||||
@ -834,7 +834,7 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now for each transition time calculate and store our rule:
|
// Now for each transition time calculate and store our rule:
|
||||||
const int tranCount = tranList.count();;
|
const int tranCount = tranList.size();;
|
||||||
ret.m_tranTimes.reserve(tranCount);
|
ret.m_tranTimes.reserve(tranCount);
|
||||||
// The DST offset when in effect: usually stable, usually an hour:
|
// The DST offset when in effect: usually stable, usually an hour:
|
||||||
int lastDstOff = 3600;
|
int lastDstOff = 3600;
|
||||||
|
@ -691,7 +691,7 @@ bool QCommandLineParserPrivate::parse(const QStringList &args)
|
|||||||
if (forcePositional) {
|
if (forcePositional) {
|
||||||
positionalArgumentList.append(argument);
|
positionalArgumentList.append(argument);
|
||||||
} else if (argument.startsWith(doubleDashString)) {
|
} else if (argument.startsWith(doubleDashString)) {
|
||||||
if (argument.length() > 2) {
|
if (argument.size() > 2) {
|
||||||
QString optionName = argument.mid(2).section(assignChar, 0, 0);
|
QString optionName = argument.mid(2).section(assignChar, 0, 0);
|
||||||
if (registerFoundOption(optionName)) {
|
if (registerFoundOption(optionName)) {
|
||||||
if (!parseOptionValue(optionName, argument, &argumentIterator, args.end()))
|
if (!parseOptionValue(optionName, argument, &argumentIterator, args.end()))
|
||||||
@ -1042,7 +1042,7 @@ static QString wrapText(const QString &names, int optionNameMaxWidth, const QStr
|
|||||||
int lastBreakable = -1;
|
int lastBreakable = -1;
|
||||||
const int max = 79 - (indentation.size() + optionNameMaxWidth + 1);
|
const int max = 79 - (indentation.size() + optionNameMaxWidth + 1);
|
||||||
int x = 0;
|
int x = 0;
|
||||||
const int len = description.length();
|
const int len = description.size();
|
||||||
|
|
||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; ++i) {
|
||||||
++x;
|
++x;
|
||||||
@ -1116,7 +1116,7 @@ QString QCommandLineParserPrivate::helpText(bool includeQtOptions) const
|
|||||||
const QStringList optionNames = option.names();
|
const QStringList optionNames = option.names();
|
||||||
QString optionNamesString;
|
QString optionNamesString;
|
||||||
for (const QString &optionName : optionNames) {
|
for (const QString &optionName : optionNames) {
|
||||||
const int numDashes = optionName.length() == 1 ? 1 : 2;
|
const int numDashes = optionName.size() == 1 ? 1 : 2;
|
||||||
optionNamesString += QLatin1StringView("--", numDashes) + optionName + ", "_L1;
|
optionNamesString += QLatin1StringView("--", numDashes) + optionName + ", "_L1;
|
||||||
}
|
}
|
||||||
if (!optionNames.isEmpty())
|
if (!optionNames.isEmpty())
|
||||||
@ -1125,7 +1125,7 @@ QString QCommandLineParserPrivate::helpText(bool includeQtOptions) const
|
|||||||
if (!valueName.isEmpty())
|
if (!valueName.isEmpty())
|
||||||
optionNamesString += " <"_L1 + valueName + u'>';
|
optionNamesString += " <"_L1 + valueName + u'>';
|
||||||
optionNameList.append(optionNamesString);
|
optionNameList.append(optionNamesString);
|
||||||
longestOptionNameString = qMax(longestOptionNameString, optionNamesString.length());
|
longestOptionNameString = qMax(longestOptionNameString, optionNamesString.size());
|
||||||
}
|
}
|
||||||
++longestOptionNameString;
|
++longestOptionNameString;
|
||||||
const int optionNameMaxWidth = qMin(50, longestOptionNameString);
|
const int optionNameMaxWidth = qMin(50, longestOptionNameString);
|
||||||
|
@ -447,7 +447,7 @@ struct BezierEase : public QEasingCurveFunction
|
|||||||
{
|
{
|
||||||
if (_bezierCurves.constLast() == QPointF(1.0, 1.0)) {
|
if (_bezierCurves.constLast() == QPointF(1.0, 1.0)) {
|
||||||
_init = true;
|
_init = true;
|
||||||
_curveCount = _bezierCurves.count() / 3;
|
_curveCount = _bezierCurves.size() / 3;
|
||||||
|
|
||||||
for (int i=0; i < _curveCount; i++) {
|
for (int i=0; i < _curveCount; i++) {
|
||||||
_intervals[i] = _bezierCurves.at(i * 3 + 2).x();
|
_intervals[i] = _bezierCurves.at(i * 3 + 2).x();
|
||||||
@ -466,17 +466,17 @@ struct BezierEase : public QEasingCurveFunction
|
|||||||
_curves[0].p3y = _bezierCurves.at(2).y();
|
_curves[0].p3y = _bezierCurves.at(2).y();
|
||||||
|
|
||||||
} else if (i == (_curveCount - 1)) {
|
} else if (i == (_curveCount - 1)) {
|
||||||
_curves[i].p0x = _bezierCurves.at(_bezierCurves.count() - 4).x();
|
_curves[i].p0x = _bezierCurves.at(_bezierCurves.size() - 4).x();
|
||||||
_curves[i].p0y = _bezierCurves.at(_bezierCurves.count() - 4).y();
|
_curves[i].p0y = _bezierCurves.at(_bezierCurves.size() - 4).y();
|
||||||
|
|
||||||
_curves[i].p1x = _bezierCurves.at(_bezierCurves.count() - 3).x();
|
_curves[i].p1x = _bezierCurves.at(_bezierCurves.size() - 3).x();
|
||||||
_curves[i].p1y = _bezierCurves.at(_bezierCurves.count() - 3).y();
|
_curves[i].p1y = _bezierCurves.at(_bezierCurves.size() - 3).y();
|
||||||
|
|
||||||
_curves[i].p2x = _bezierCurves.at(_bezierCurves.count() - 2).x();
|
_curves[i].p2x = _bezierCurves.at(_bezierCurves.size() - 2).x();
|
||||||
_curves[i].p2y = _bezierCurves.at(_bezierCurves.count() - 2).y();
|
_curves[i].p2y = _bezierCurves.at(_bezierCurves.size() - 2).y();
|
||||||
|
|
||||||
_curves[i].p3x = _bezierCurves.at(_bezierCurves.count() - 1).x();
|
_curves[i].p3x = _bezierCurves.at(_bezierCurves.size() - 1).x();
|
||||||
_curves[i].p3y = _bezierCurves.at(_bezierCurves.count() - 1).y();
|
_curves[i].p3y = _bezierCurves.at(_bezierCurves.size() - 1).y();
|
||||||
} else {
|
} else {
|
||||||
_curves[i].p0x = _bezierCurves.at(i * 3 - 1).x();
|
_curves[i].p0x = _bezierCurves.at(i * 3 - 1).x();
|
||||||
_curves[i].p0y = _bezierCurves.at(i * 3 - 1).y();
|
_curves[i].p0y = _bezierCurves.at(i * 3 - 1).y();
|
||||||
@ -535,7 +535,7 @@ struct BezierEase : public QEasingCurveFunction
|
|||||||
|
|
||||||
qreal value(qreal x) override
|
qreal value(qreal x) override
|
||||||
{
|
{
|
||||||
Q_ASSERT(_bezierCurves.count() % 3 == 0);
|
Q_ASSERT(_bezierCurves.size() % 3 == 0);
|
||||||
|
|
||||||
if (_bezierCurves.isEmpty()) {
|
if (_bezierCurves.isEmpty()) {
|
||||||
return x;
|
return x;
|
||||||
@ -869,7 +869,7 @@ struct TCBEase : public BezierEase
|
|||||||
|
|
||||||
qreal value(qreal x) override
|
qreal value(qreal x) override
|
||||||
{
|
{
|
||||||
Q_ASSERT(_bezierCurves.count() % 3 == 0);
|
Q_ASSERT(_bezierCurves.size() % 3 == 0);
|
||||||
|
|
||||||
if (_bezierCurves.isEmpty()) {
|
if (_bezierCurves.isEmpty()) {
|
||||||
qWarning("QEasingCurve: Invalid tcb curve");
|
qWarning("QEasingCurve: Invalid tcb curve");
|
||||||
|
@ -279,7 +279,7 @@ void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void **
|
|||||||
qPrintable(errorMsg));
|
qPrintable(errorMsg));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (inputCount + 1 != types.count() ||
|
if (inputCount + 1 != types.size() ||
|
||||||
types.at(inputCount) == QDBusMetaTypeId::message()) {
|
types.at(inputCount) == QDBusMetaTypeId::message()) {
|
||||||
// invalid signal signature
|
// invalid signal signature
|
||||||
qWarning("QDBusAbstractAdaptor: Cannot relay signal %s::%s",
|
qWarning("QDBusAbstractAdaptor: Cannot relay signal %s::%s",
|
||||||
@ -288,7 +288,7 @@ void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void **
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVariantList args;
|
QVariantList args;
|
||||||
const int numTypes = types.count();
|
const int numTypes = types.size();
|
||||||
args.reserve(numTypes - 1);
|
args.reserve(numTypes - 1);
|
||||||
for (int i = 1; i < numTypes; ++i)
|
for (int i = 1; i < numTypes; ++i)
|
||||||
args << QVariant(QMetaType(types.at(i)), argv[i]);
|
args << QVariant(QMetaType(types.at(i)), argv[i]);
|
||||||
|
@ -862,7 +862,7 @@ bool QDBusConnection::registerObject(const QString &path, const QString &interfa
|
|||||||
QDBusConnectionPrivate::ObjectTreeNode *node = &d->rootNode;
|
QDBusConnectionPrivate::ObjectTreeNode *node = &d->rootNode;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
while (node) {
|
while (node) {
|
||||||
if (pathComponents.count() == i) {
|
if (pathComponents.size() == i) {
|
||||||
// this node exists
|
// this node exists
|
||||||
// consider it free if there's no object here and the user is not trying to
|
// consider it free if there's no object here and the user is not trying to
|
||||||
// replace the object sub-tree
|
// replace the object sub-tree
|
||||||
@ -972,7 +972,7 @@ QObject *QDBusConnection::objectRegisteredAt(const QString &path) const
|
|||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
while (node) {
|
while (node) {
|
||||||
if (pathComponents.count() == i)
|
if (pathComponents.size() == i)
|
||||||
return node->obj;
|
return node->obj;
|
||||||
if ((node->flags & QDBusConnectionPrivate::VirtualObject) && (node->flags & QDBusConnection::SubPath))
|
if ((node->flags & QDBusConnectionPrivate::VirtualObject) && (node->flags & QDBusConnection::SubPath))
|
||||||
return node->obj;
|
return node->obj;
|
||||||
|
@ -349,7 +349,7 @@ static bool findObject(const QDBusConnectionPrivate::ObjectTreeNode *root,
|
|||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
int start = 0;
|
int start = 0;
|
||||||
int length = fullpath.length();
|
int length = fullpath.size();
|
||||||
if (fullpath.at(0) == u'/')
|
if (fullpath.at(0) == u'/')
|
||||||
start = 1;
|
start = 1;
|
||||||
|
|
||||||
@ -391,7 +391,7 @@ static bool findObject(const QDBusConnectionPrivate::ObjectTreeNode *root,
|
|||||||
static QObject *findChildObject(const QDBusConnectionPrivate::ObjectTreeNode *root,
|
static QObject *findChildObject(const QDBusConnectionPrivate::ObjectTreeNode *root,
|
||||||
const QString &fullpath, int start)
|
const QString &fullpath, int start)
|
||||||
{
|
{
|
||||||
int length = fullpath.length();
|
int length = fullpath.size();
|
||||||
|
|
||||||
// any object in the tree can tell us to switch to its own object tree:
|
// any object in the tree can tell us to switch to its own object tree:
|
||||||
const QDBusConnectionPrivate::ObjectTreeNode *node = root;
|
const QDBusConnectionPrivate::ObjectTreeNode *node = root;
|
||||||
@ -575,7 +575,7 @@ static void huntAndUnregister(const QList<QStringView> &pathComponents, int i,
|
|||||||
QDBusConnection::UnregisterMode mode,
|
QDBusConnection::UnregisterMode mode,
|
||||||
QDBusConnectionPrivate::ObjectTreeNode *node)
|
QDBusConnectionPrivate::ObjectTreeNode *node)
|
||||||
{
|
{
|
||||||
if (pathComponents.count() == i) {
|
if (pathComponents.size() == i) {
|
||||||
// found it
|
// found it
|
||||||
node->obj = nullptr;
|
node->obj = nullptr;
|
||||||
node->flags = 0;
|
node->flags = 0;
|
||||||
@ -699,14 +699,14 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
for (int j = i; ok && j < metaTypes.count(); ++j)
|
for (int j = i; ok && j < metaTypes.size(); ++j)
|
||||||
if (QDBusMetaType::typeToSignature(metaTypes.at(i)) == nullptr)
|
if (QDBusMetaType::typeToSignature(metaTypes.at(i)) == nullptr)
|
||||||
ok = false;
|
ok = false;
|
||||||
if (!ok)
|
if (!ok)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// consistency check:
|
// consistency check:
|
||||||
if (isAsync && metaTypes.count() > i + 1)
|
if (isAsync && metaTypes.size() > i + 1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mm.methodType() == QMetaMethod::Slot) {
|
if (mm.methodType() == QMetaMethod::Slot) {
|
||||||
@ -753,11 +753,11 @@ QDBusCallDeliveryEvent *QDBusConnectionPrivate::prepareReply(QDBusConnectionPriv
|
|||||||
Q_ASSERT(object);
|
Q_ASSERT(object);
|
||||||
Q_UNUSED(object);
|
Q_UNUSED(object);
|
||||||
|
|
||||||
int n = metaTypes.count() - 1;
|
int n = metaTypes.size() - 1;
|
||||||
if (metaTypes[n] == QDBusMetaTypeId::message())
|
if (metaTypes[n] == QDBusMetaTypeId::message())
|
||||||
--n;
|
--n;
|
||||||
|
|
||||||
if (msg.arguments().count() < n)
|
if (msg.arguments().size() < n)
|
||||||
return nullptr; // too few arguments
|
return nullptr; // too few arguments
|
||||||
|
|
||||||
// check that types match
|
// check that types match
|
||||||
@ -829,7 +829,7 @@ bool QDBusConnectionPrivate::activateCall(QObject* object, int flags, const QDBu
|
|||||||
qvariant_cast<QDBusSlotCache>(object->property(cachePropertyName));
|
qvariant_cast<QDBusSlotCache>(object->property(cachePropertyName));
|
||||||
QString cacheKey = msg.member(), signature = msg.signature();
|
QString cacheKey = msg.member(), signature = msg.signature();
|
||||||
if (!signature.isEmpty()) {
|
if (!signature.isEmpty()) {
|
||||||
cacheKey.reserve(cacheKey.length() + 1 + signature.length());
|
cacheKey.reserve(cacheKey.size() + 1 + signature.size());
|
||||||
cacheKey += u'.';
|
cacheKey += u'.';
|
||||||
cacheKey += signature;
|
cacheKey += signature;
|
||||||
}
|
}
|
||||||
@ -852,7 +852,7 @@ bool QDBusConnectionPrivate::activateCall(QObject* object, int flags, const QDBu
|
|||||||
// ### this is where we want to add the connection as an arg too
|
// ### this is where we want to add the connection as an arg too
|
||||||
// try with no parameters, but with a QDBusMessage
|
// try with no parameters, but with a QDBusMessage
|
||||||
slotData.slotIdx = ::findSlot(mo, memberName, flags, QString(), slotData.metaTypes);
|
slotData.slotIdx = ::findSlot(mo, memberName, flags, QString(), slotData.metaTypes);
|
||||||
if (slotData.metaTypes.count() != 2 ||
|
if (slotData.metaTypes.size() != 2 ||
|
||||||
slotData.metaTypes.at(1) != QDBusMetaTypeId::message()) {
|
slotData.metaTypes.at(1) != QDBusMetaTypeId::message()) {
|
||||||
// not found
|
// not found
|
||||||
// save the negative lookup
|
// save the negative lookup
|
||||||
@ -890,10 +890,10 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const Q
|
|||||||
"function called for an object that is in another thread!!");
|
"function called for an object that is in another thread!!");
|
||||||
|
|
||||||
QVarLengthArray<void *, 10> params;
|
QVarLengthArray<void *, 10> params;
|
||||||
params.reserve(metaTypes.count());
|
params.reserve(metaTypes.size());
|
||||||
|
|
||||||
QVarLengthArray<QVariant, 10> auxParameters; // we cannot allow reallocation here, since we
|
QVarLengthArray<QVariant, 10> auxParameters; // we cannot allow reallocation here, since we
|
||||||
auxParameters.reserve(metaTypes.count()); // keep references to the entries
|
auxParameters.reserve(metaTypes.size()); // keep references to the entries
|
||||||
|
|
||||||
// let's create the parameter list
|
// let's create the parameter list
|
||||||
|
|
||||||
@ -902,7 +902,7 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const Q
|
|||||||
|
|
||||||
// add the input parameters
|
// add the input parameters
|
||||||
int i;
|
int i;
|
||||||
int pCount = qMin(msg.arguments().count(), metaTypes.count() - 1);
|
int pCount = qMin(msg.arguments().size(), metaTypes.size() - 1);
|
||||||
for (i = 1; i <= pCount; ++i) {
|
for (i = 1; i <= pCount; ++i) {
|
||||||
auto id = metaTypes[i];
|
auto id = metaTypes[i];
|
||||||
if (id == QDBusMetaTypeId::message())
|
if (id == QDBusMetaTypeId::message())
|
||||||
@ -918,7 +918,7 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const Q
|
|||||||
|
|
||||||
const QDBusArgument &in =
|
const QDBusArgument &in =
|
||||||
*reinterpret_cast<const QDBusArgument *>(arg.constData());
|
*reinterpret_cast<const QDBusArgument *>(arg.constData());
|
||||||
QVariant &out = auxParameters[auxParameters.count() - 1];
|
QVariant &out = auxParameters[auxParameters.size() - 1];
|
||||||
|
|
||||||
if (Q_UNLIKELY(!QDBusMetaType::demarshall(in, out.metaType(), out.data())))
|
if (Q_UNLIKELY(!QDBusMetaType::demarshall(in, out.metaType(), out.data())))
|
||||||
qFatal("Internal error: demarshalling function for type '%s' (%d) failed!",
|
qFatal("Internal error: demarshalling function for type '%s' (%d) failed!",
|
||||||
@ -933,13 +933,13 @@ void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const Q
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (metaTypes.count() > i && metaTypes[i] == QDBusMetaTypeId::message()) {
|
if (metaTypes.size() > i && metaTypes[i] == QDBusMetaTypeId::message()) {
|
||||||
params.append(const_cast<void*>(static_cast<const void*>(&msg)));
|
params.append(const_cast<void*>(static_cast<const void*>(&msg)));
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
// output arguments
|
// output arguments
|
||||||
const int numMetaTypes = metaTypes.count();
|
const int numMetaTypes = metaTypes.size();
|
||||||
QVariantList outputArgs;
|
QVariantList outputArgs;
|
||||||
if (metaTypes[0].id() != QMetaType::Void && metaTypes[0].isValid()) {
|
if (metaTypes[0].id() != QMetaType::Void && metaTypes[0].isValid()) {
|
||||||
outputArgs.reserve(numMetaTypes - i + 1);
|
outputArgs.reserve(numMetaTypes - i + 1);
|
||||||
@ -1296,7 +1296,7 @@ int QDBusConnectionPrivate::findSlot(QObject *obj, const QByteArray &normalizedN
|
|||||||
|
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
int inputCount = qDBusParametersForMethod(obj->metaObject()->method(midx), params, errorMsg);
|
int inputCount = qDBusParametersForMethod(obj->metaObject()->method(midx), params, errorMsg);
|
||||||
if ( inputCount == -1 || inputCount + 1 != params.count() )
|
if ( inputCount == -1 || inputCount + 1 != params.size() )
|
||||||
return -1; // failed to parse or invalid arguments or output arguments
|
return -1; // failed to parse or invalid arguments or output arguments
|
||||||
|
|
||||||
return midx;
|
return midx;
|
||||||
@ -1333,13 +1333,13 @@ bool QDBusConnectionPrivate::prepareHook(QDBusConnectionPrivate::SignalHook &hoo
|
|||||||
mname = QString::fromUtf8(normalizedName);
|
mname = QString::fromUtf8(normalizedName);
|
||||||
}
|
}
|
||||||
key = mname;
|
key = mname;
|
||||||
key.reserve(interface.length() + 1 + mname.length());
|
key.reserve(interface.size() + 1 + mname.size());
|
||||||
key += u':';
|
key += u':';
|
||||||
key += interface;
|
key += interface;
|
||||||
|
|
||||||
if (buildSignature) {
|
if (buildSignature) {
|
||||||
hook.signature.clear();
|
hook.signature.clear();
|
||||||
for (int i = 1; i < hook.params.count(); ++i)
|
for (int i = 1; i < hook.params.size(); ++i)
|
||||||
if (hook.params.at(i) != QDBusMetaTypeId::message())
|
if (hook.params.at(i) != QDBusMetaTypeId::message())
|
||||||
hook.signature += QLatin1StringView(QDBusMetaType::typeToSignature(hook.params.at(i)));
|
hook.signature += QLatin1StringView(QDBusMetaType::typeToSignature(hook.params.at(i)));
|
||||||
}
|
}
|
||||||
@ -1435,7 +1435,7 @@ void QDBusConnectionPrivate::activateObject(ObjectTreeNode &node, const QDBusMes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathStartPos != msg.path().length()) {
|
if (pathStartPos != msg.path().size()) {
|
||||||
node.flags &= ~QDBusConnection::ExportAllSignals;
|
node.flags &= ~QDBusConnection::ExportAllSignals;
|
||||||
node.obj = findChildObject(&node, msg.path(), pathStartPos);
|
node.obj = findChildObject(&node, msg.path(), pathStartPos);
|
||||||
if (!node.obj) {
|
if (!node.obj) {
|
||||||
@ -1653,14 +1653,14 @@ void QDBusConnectionPrivate::handleSignal(const QDBusMessage& msg)
|
|||||||
// (but not both)
|
// (but not both)
|
||||||
|
|
||||||
QString key = msg.member();
|
QString key = msg.member();
|
||||||
key.reserve(key.length() + 1 + msg.interface().length());
|
key.reserve(key.size() + 1 + msg.interface().size());
|
||||||
key += u':';
|
key += u':';
|
||||||
key += msg.interface();
|
key += msg.interface();
|
||||||
|
|
||||||
QDBusReadLocker locker(HandleSignalAction, this);
|
QDBusReadLocker locker(HandleSignalAction, this);
|
||||||
handleSignal(key, msg); // one try
|
handleSignal(key, msg); // one try
|
||||||
|
|
||||||
key.truncate(msg.member().length() + 1); // keep the ':'
|
key.truncate(msg.member().size() + 1); // keep the ':'
|
||||||
handleSignal(key, msg); // second try
|
handleSignal(key, msg); // second try
|
||||||
|
|
||||||
key = u':';
|
key = u':';
|
||||||
|
@ -187,7 +187,7 @@ propertyNotFoundError(const QDBusMessage &msg, const QString &interface_name, co
|
|||||||
QDBusMessage qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode &node,
|
QDBusMessage qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode &node,
|
||||||
const QDBusMessage &msg)
|
const QDBusMessage &msg)
|
||||||
{
|
{
|
||||||
Q_ASSERT(msg.arguments().count() == 2);
|
Q_ASSERT(msg.arguments().size() == 2);
|
||||||
Q_ASSERT_X(!node.obj || QThread::currentThread() == node.obj->thread(),
|
Q_ASSERT_X(!node.obj || QThread::currentThread() == node.obj->thread(),
|
||||||
"QDBusConnection: internal threading error",
|
"QDBusConnection: internal threading error",
|
||||||
"function called for an object that is in another thread!!");
|
"function called for an object that is in another thread!!");
|
||||||
@ -345,7 +345,7 @@ static int writeProperty(QObject *obj, const QByteArray &property_name, QVariant
|
|||||||
QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node,
|
QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node,
|
||||||
const QDBusMessage &msg)
|
const QDBusMessage &msg)
|
||||||
{
|
{
|
||||||
Q_ASSERT(msg.arguments().count() == 3);
|
Q_ASSERT(msg.arguments().size() == 3);
|
||||||
Q_ASSERT_X(!node.obj || QThread::currentThread() == node.obj->thread(),
|
Q_ASSERT_X(!node.obj || QThread::currentThread() == node.obj->thread(),
|
||||||
"QDBusConnection: internal threading error",
|
"QDBusConnection: internal threading error",
|
||||||
"function called for an object that is in another thread!!");
|
"function called for an object that is in another thread!!");
|
||||||
@ -445,7 +445,7 @@ static QVariantMap readAllProperties(QObject *object, int flags)
|
|||||||
QDBusMessage qDBusPropertyGetAll(const QDBusConnectionPrivate::ObjectTreeNode &node,
|
QDBusMessage qDBusPropertyGetAll(const QDBusConnectionPrivate::ObjectTreeNode &node,
|
||||||
const QDBusMessage &msg)
|
const QDBusMessage &msg)
|
||||||
{
|
{
|
||||||
Q_ASSERT(msg.arguments().count() == 1);
|
Q_ASSERT(msg.arguments().size() == 1);
|
||||||
Q_ASSERT_X(!node.obj || QThread::currentThread() == node.obj->thread(),
|
Q_ASSERT_X(!node.obj || QThread::currentThread() == node.obj->thread(),
|
||||||
"QDBusConnection: internal threading error",
|
"QDBusConnection: internal threading error",
|
||||||
"function called for an object that is in another thread!!");
|
"function called for an object that is in another thread!!");
|
||||||
|
@ -152,7 +152,7 @@ inline void QDBusMarshaller::append(const QByteArray &arg)
|
|||||||
DBusMessageIter subiterator;
|
DBusMessageIter subiterator;
|
||||||
q_dbus_message_iter_open_container(&iterator, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING,
|
q_dbus_message_iter_open_container(&iterator, DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE_AS_STRING,
|
||||||
&subiterator);
|
&subiterator);
|
||||||
q_dbus_message_iter_append_fixed_array(&subiterator, DBUS_TYPE_BYTE, &cdata, arg.length());
|
q_dbus_message_iter_append_fixed_array(&subiterator, DBUS_TYPE_BYTE, &cdata, arg.size());
|
||||||
q_dbus_message_iter_close_container(&iterator, &subiterator);
|
q_dbus_message_iter_close_container(&iterator, &subiterator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ void QDBusMetaObjectGenerator::parseMethods()
|
|||||||
|
|
||||||
// convert the last commas:
|
// convert the last commas:
|
||||||
if (!mm.parameterNames.isEmpty())
|
if (!mm.parameterNames.isEmpty())
|
||||||
prototype[prototype.length() - 1] = ')';
|
prototype[prototype.size() - 1] = ')';
|
||||||
else
|
else
|
||||||
prototype.append(')');
|
prototype.append(')');
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ void QDBusMetaObjectGenerator::parseSignals()
|
|||||||
|
|
||||||
// convert the last commas:
|
// convert the last commas:
|
||||||
if (!mm.parameterNames.isEmpty())
|
if (!mm.parameterNames.isEmpty())
|
||||||
prototype[prototype.length() - 1] = ')';
|
prototype[prototype.size() - 1] = ')';
|
||||||
else
|
else
|
||||||
prototype.append(')');
|
prototype.append(')');
|
||||||
|
|
||||||
@ -387,8 +387,8 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
|||||||
qsizetype methodParametersDataSize =
|
qsizetype methodParametersDataSize =
|
||||||
((aggregateParameterCount(signals_)
|
((aggregateParameterCount(signals_)
|
||||||
+ aggregateParameterCount(methods)) * 2) // types and parameter names
|
+ aggregateParameterCount(methods)) * 2) // types and parameter names
|
||||||
- signals_.count() // return "parameters" don't have names
|
- signals_.size() // return "parameters" don't have names
|
||||||
- methods.count(); // ditto
|
- methods.size(); // ditto
|
||||||
|
|
||||||
QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data());
|
QDBusMetaObjectPrivate *header = reinterpret_cast<QDBusMetaObjectPrivate *>(idata.data());
|
||||||
static_assert(QMetaObjectPrivate::OutputRevision == 11, "QtDBus meta-object generator should generate the same version as moc");
|
static_assert(QMetaObjectPrivate::OutputRevision == 11, "QtDBus meta-object generator should generate the same version as moc");
|
||||||
@ -396,9 +396,9 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
|||||||
header->className = 0;
|
header->className = 0;
|
||||||
header->classInfoCount = 0;
|
header->classInfoCount = 0;
|
||||||
header->classInfoData = 0;
|
header->classInfoData = 0;
|
||||||
header->methodCount = int(signals_.count() + methods.count());
|
header->methodCount = int(signals_.size() + methods.size());
|
||||||
header->methodData = int(idata.size());
|
header->methodData = int(idata.size());
|
||||||
header->propertyCount = int(properties.count());
|
header->propertyCount = int(properties.size());
|
||||||
header->propertyData = int(header->methodData + header->methodCount *
|
header->propertyData = int(header->methodData + header->methodCount *
|
||||||
QMetaObjectPrivate::IntsPerMethod + methodParametersDataSize);
|
QMetaObjectPrivate::IntsPerMethod + methodParametersDataSize);
|
||||||
header->enumeratorCount = 0;
|
header->enumeratorCount = 0;
|
||||||
@ -406,7 +406,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
|||||||
header->constructorCount = 0;
|
header->constructorCount = 0;
|
||||||
header->constructorData = 0;
|
header->constructorData = 0;
|
||||||
header->flags = RequiresVariantMetaObject;
|
header->flags = RequiresVariantMetaObject;
|
||||||
header->signalCount = signals_.count();
|
header->signalCount = signals_.size();
|
||||||
// These are specific to QDBusMetaObject:
|
// These are specific to QDBusMetaObject:
|
||||||
header->propertyDBusData = int(header->propertyData + header->propertyCount
|
header->propertyDBusData = int(header->propertyData + header->propertyCount
|
||||||
* QMetaObjectPrivate::IntsPerProperty);
|
* QMetaObjectPrivate::IntsPerProperty);
|
||||||
@ -416,9 +416,9 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
|||||||
(header->methodCount * (QMetaObjectPrivate::IntsPerMethod+intsPerMethod)) + methodParametersDataSize +
|
(header->methodCount * (QMetaObjectPrivate::IntsPerMethod+intsPerMethod)) + methodParametersDataSize +
|
||||||
(header->propertyCount * (QMetaObjectPrivate::IntsPerProperty+intsPerProperty));
|
(header->propertyCount * (QMetaObjectPrivate::IntsPerProperty+intsPerProperty));
|
||||||
for (const Method &mm : qAsConst(signals_))
|
for (const Method &mm : qAsConst(signals_))
|
||||||
data_size += 2 + mm.inputTypes.count() + mm.outputTypes.count();
|
data_size += 2 + mm.inputTypes.size() + mm.outputTypes.size();
|
||||||
for (const Method &mm : qAsConst(methods))
|
for (const Method &mm : qAsConst(methods))
|
||||||
data_size += 2 + mm.inputTypes.count() + mm.outputTypes.count();
|
data_size += 2 + mm.inputTypes.size() + mm.outputTypes.size();
|
||||||
idata.resize(data_size + 1);
|
idata.resize(data_size + 1);
|
||||||
|
|
||||||
QMetaStringTable strings(className.toLatin1());
|
QMetaStringTable strings(className.toLatin1());
|
||||||
@ -429,7 +429,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
|||||||
qsizetype typeidOffset = header->methodDBusData + header->methodCount * intsPerMethod;
|
qsizetype typeidOffset = header->methodDBusData + header->methodCount * intsPerMethod;
|
||||||
idata[typeidOffset++] = 0; // eod
|
idata[typeidOffset++] = 0; // eod
|
||||||
|
|
||||||
qsizetype totalMetaTypeCount = properties.count();
|
qsizetype totalMetaTypeCount = properties.size();
|
||||||
++totalMetaTypeCount; // + 1 for metatype of dynamic metaobject
|
++totalMetaTypeCount; // + 1 for metatype of dynamic metaobject
|
||||||
for (const auto& methodContainer: {signals_, methods}) {
|
for (const auto& methodContainer: {signals_, methods}) {
|
||||||
for (const auto& method: methodContainer) {
|
for (const auto& method: methodContainer) {
|
||||||
@ -441,7 +441,7 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
|||||||
int propertyId = 0;
|
int propertyId = 0;
|
||||||
|
|
||||||
// add each method:
|
// add each method:
|
||||||
qsizetype currentMethodMetaTypeOffset = properties.count() + 1;
|
qsizetype currentMethodMetaTypeOffset = properties.size() + 1;
|
||||||
for (int x = 0; x < 2; ++x) {
|
for (int x = 0; x < 2; ++x) {
|
||||||
// Signals must be added before other methods, to match moc.
|
// Signals must be added before other methods, to match moc.
|
||||||
QMap<QByteArray, Method> &map = (x == 0) ? signals_ : methods;
|
QMap<QByteArray, Method> &map = (x == 0) ? signals_ : methods;
|
||||||
@ -494,14 +494,14 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
|||||||
idata[parametersOffset++] = strings.enter(mm.parameterNames.at(i));
|
idata[parametersOffset++] = strings.enter(mm.parameterNames.at(i));
|
||||||
|
|
||||||
idata[signatureOffset++] = typeidOffset;
|
idata[signatureOffset++] = typeidOffset;
|
||||||
idata[typeidOffset++] = mm.inputTypes.count();
|
idata[typeidOffset++] = mm.inputTypes.size();
|
||||||
memcpy(idata.data() + typeidOffset, mm.inputTypes.data(), mm.inputTypes.count() * sizeof(uint));
|
memcpy(idata.data() + typeidOffset, mm.inputTypes.data(), mm.inputTypes.size() * sizeof(uint));
|
||||||
typeidOffset += mm.inputTypes.count();
|
typeidOffset += mm.inputTypes.size();
|
||||||
|
|
||||||
idata[signatureOffset++] = typeidOffset;
|
idata[signatureOffset++] = typeidOffset;
|
||||||
idata[typeidOffset++] = mm.outputTypes.count();
|
idata[typeidOffset++] = mm.outputTypes.size();
|
||||||
memcpy(idata.data() + typeidOffset, mm.outputTypes.data(), mm.outputTypes.count() * sizeof(uint));
|
memcpy(idata.data() + typeidOffset, mm.outputTypes.data(), mm.outputTypes.size() * sizeof(uint));
|
||||||
typeidOffset += mm.outputTypes.count();
|
typeidOffset += mm.outputTypes.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ QString qDBusInterfaceFromMetaObject(const QMetaObject *mo)
|
|||||||
if (interface.startsWith("QDBus"_L1)) {
|
if (interface.startsWith("QDBus"_L1)) {
|
||||||
interface.prepend("org.qtproject.QtDBus."_L1);
|
interface.prepend("org.qtproject.QtDBus."_L1);
|
||||||
} else if (interface.startsWith(u'Q') &&
|
} else if (interface.startsWith(u'Q') &&
|
||||||
interface.length() >= 2 && interface.at(1).isUpper()) {
|
interface.size() >= 2 && interface.at(1).isUpper()) {
|
||||||
// assume it's Qt
|
// assume it's Qt
|
||||||
interface.prepend("org.qtproject.Qt."_L1);
|
interface.prepend("org.qtproject.Qt."_L1);
|
||||||
} else if (!QCoreApplication::instance()||
|
} else if (!QCoreApplication::instance()||
|
||||||
@ -128,7 +128,7 @@ int qDBusParametersForMethod(const QList<QByteArray> ¶meterTypes, QList<QMet
|
|||||||
|
|
||||||
if (type.endsWith('&')) {
|
if (type.endsWith('&')) {
|
||||||
QByteArray basictype = type;
|
QByteArray basictype = type;
|
||||||
basictype.truncate(type.length() - 1);
|
basictype.truncate(type.size() - 1);
|
||||||
|
|
||||||
QMetaType id = QMetaType::fromName(basictype);
|
QMetaType id = QMetaType::fromName(basictype);
|
||||||
if (!id.isValid()) {
|
if (!id.isValid()) {
|
||||||
|
@ -138,7 +138,7 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb
|
|||||||
|
|
||||||
// success
|
// success
|
||||||
// construct the expected signature
|
// construct the expected signature
|
||||||
int count = metaTypes.count() - 1;
|
int count = metaTypes.size() - 1;
|
||||||
if (count == 1 && metaTypes.at(1) == QDBusMetaTypeId::message()) {
|
if (count == 1 && metaTypes.at(1) == QDBusMetaTypeId::message()) {
|
||||||
// wildcard slot, can receive anything, so don't set the signature
|
// wildcard slot, can receive anything, so don't set the signature
|
||||||
return true;
|
return true;
|
||||||
|
@ -169,7 +169,7 @@ void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reply.arguments().count() >= 1 && reply.arguments().at(0).metaType() == data.metaType()) {
|
if (reply.arguments().size() >= 1 && reply.arguments().at(0).metaType() == data.metaType()) {
|
||||||
data = reply.arguments().at(0);
|
data = reply.arguments().at(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data
|
|||||||
const char *receivedType = nullptr;
|
const char *receivedType = nullptr;
|
||||||
QByteArray receivedSignature;
|
QByteArray receivedSignature;
|
||||||
|
|
||||||
if (reply.arguments().count() >= 1) {
|
if (reply.arguments().size() >= 1) {
|
||||||
if (reply.arguments().at(0).metaType() == QDBusMetaTypeId::argument()) {
|
if (reply.arguments().at(0).metaType() == QDBusMetaTypeId::argument()) {
|
||||||
// compare signatures instead
|
// compare signatures instead
|
||||||
QDBusArgument arg = qvariant_cast<QDBusArgument>(reply.arguments().at(0));
|
QDBusArgument arg = qvariant_cast<QDBusArgument>(reply.arguments().at(0));
|
||||||
|
@ -59,7 +59,7 @@ static bool variantToString(const QVariant &arg, QString &out)
|
|||||||
} else if (argType == QMetaType::QByteArray) {
|
} else if (argType == QMetaType::QByteArray) {
|
||||||
out += u'{';
|
out += u'{';
|
||||||
QByteArray list = arg.toByteArray();
|
QByteArray list = arg.toByteArray();
|
||||||
for (int i = 0; i < list.length(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
out += QString::number(list.at(i));
|
out += QString::number(list.at(i));
|
||||||
out += ", "_L1;
|
out += ", "_L1;
|
||||||
}
|
}
|
||||||
@ -335,11 +335,11 @@ namespace QDBusUtil
|
|||||||
*/
|
*/
|
||||||
bool isValidInterfaceName(const QString& ifaceName)
|
bool isValidInterfaceName(const QString& ifaceName)
|
||||||
{
|
{
|
||||||
if (ifaceName.isEmpty() || ifaceName.length() > DBUS_MAXIMUM_NAME_LENGTH)
|
if (ifaceName.isEmpty() || ifaceName.size() > DBUS_MAXIMUM_NAME_LENGTH)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const auto parts = QStringView{ifaceName}.split(u'.');
|
const auto parts = QStringView{ifaceName}.split(u'.');
|
||||||
if (parts.count() < 2)
|
if (parts.size() < 2)
|
||||||
return false; // at least two parts
|
return false; // at least two parts
|
||||||
|
|
||||||
for (auto part : parts)
|
for (auto part : parts)
|
||||||
@ -363,7 +363,7 @@ namespace QDBusUtil
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const auto parts = connName.mid(1).split(u'.');
|
const auto parts = connName.mid(1).split(u'.');
|
||||||
if (parts.count() < 1)
|
if (parts.size() < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (QStringView part : parts) {
|
for (QStringView part : parts) {
|
||||||
@ -402,14 +402,14 @@ namespace QDBusUtil
|
|||||||
*/
|
*/
|
||||||
bool isValidBusName(const QString &busName)
|
bool isValidBusName(const QString &busName)
|
||||||
{
|
{
|
||||||
if (busName.isEmpty() || busName.length() > DBUS_MAXIMUM_NAME_LENGTH)
|
if (busName.isEmpty() || busName.size() > DBUS_MAXIMUM_NAME_LENGTH)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (busName.startsWith(u':'))
|
if (busName.startsWith(u':'))
|
||||||
return isValidUniqueConnectionName(busName);
|
return isValidUniqueConnectionName(busName);
|
||||||
|
|
||||||
const auto parts = QStringView{busName}.split(u'.');
|
const auto parts = QStringView{busName}.split(u'.');
|
||||||
if (parts.count() < 1)
|
if (parts.size() < 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (QStringView part : parts) {
|
for (QStringView part : parts) {
|
||||||
|
@ -151,7 +151,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
|
|||||||
qWarning() << "Skipped method" << mm.name() << ":" << qPrintable(errorMsg);
|
qWarning() << "Skipped method" << mm.name() << ":" << qPrintable(errorMsg);
|
||||||
continue; // invalid form
|
continue; // invalid form
|
||||||
}
|
}
|
||||||
if (isSignal && inputCount + 1 != types.count())
|
if (isSignal && inputCount + 1 != types.size())
|
||||||
continue; // signal with output arguments?
|
continue; // signal with output arguments?
|
||||||
if (isSignal && types.at(inputCount) == QDBusMetaTypeId::message())
|
if (isSignal && types.at(inputCount) == QDBusMetaTypeId::message())
|
||||||
continue; // signal with QDBusMessage argument?
|
continue; // signal with QDBusMessage argument?
|
||||||
@ -159,7 +159,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
|
|||||||
continue; // cloned signal?
|
continue; // cloned signal?
|
||||||
|
|
||||||
int j;
|
int j;
|
||||||
for (j = 1; j < types.count(); ++j) {
|
for (j = 1; j < types.size(); ++j) {
|
||||||
// input parameter for a slot or output for a signal
|
// input parameter for a slot or output for a signal
|
||||||
if (types.at(j) == QDBusMetaTypeId::message()) {
|
if (types.at(j) == QDBusMetaTypeId::message()) {
|
||||||
isScriptable = true;
|
isScriptable = true;
|
||||||
|
@ -976,14 +976,14 @@ void AtSpiAdaptor::notify(QAccessibleEvent *event)
|
|||||||
|
|
||||||
if (!textRemoved.isEmpty()) {
|
if (!textRemoved.isEmpty()) {
|
||||||
data.setVariant(QVariant::fromValue(textRemoved));
|
data.setVariant(QVariant::fromValue(textRemoved));
|
||||||
QVariantList args = packDBusSignalArguments("delete"_L1, changePosition, textRemoved.length(), QVariant::fromValue(data));
|
QVariantList args = packDBusSignalArguments("delete"_L1, changePosition, textRemoved.size(), QVariant::fromValue(data));
|
||||||
sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
|
sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
|
||||||
"TextChanged"_L1, args);
|
"TextChanged"_L1, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!textInserted.isEmpty()) {
|
if (!textInserted.isEmpty()) {
|
||||||
data.setVariant(QVariant::fromValue(textInserted));
|
data.setVariant(QVariant::fromValue(textInserted));
|
||||||
QVariantList args = packDBusSignalArguments("insert"_L1, changePosition, textInserted.length(), QVariant::fromValue(data));
|
QVariantList args = packDBusSignalArguments("insert"_L1, changePosition, textInserted.size(), QVariant::fromValue(data));
|
||||||
sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
|
sendDBusSignal(path, ATSPI_DBUS_INTERFACE_EVENT_OBJECT ""_L1,
|
||||||
"TextChanged"_L1, args);
|
"TextChanged"_L1, args);
|
||||||
}
|
}
|
||||||
@ -2063,13 +2063,13 @@ namespace
|
|||||||
QString atspiColor(const QString &ia2Color)
|
QString atspiColor(const QString &ia2Color)
|
||||||
{
|
{
|
||||||
// "rgb(%u,%u,%u)" -> "%u,%u,%u"
|
// "rgb(%u,%u,%u)" -> "%u,%u,%u"
|
||||||
return ia2Color.mid(4, ia2Color.length() - (4+1));
|
return ia2Color.mid(4, ia2Color.size() - (4+1));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString atspiSize(const QString &ia2Size)
|
QString atspiSize(const QString &ia2Size)
|
||||||
{
|
{
|
||||||
// "%fpt" -> "%f"
|
// "%fpt" -> "%f"
|
||||||
return ia2Size.left(ia2Size.length() - 2);
|
return ia2Size.left(ia2Size.size() - 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
AtSpiAttribute atspiTextAttribute(const QString &ia2Name, const QString &ia2Value)
|
AtSpiAttribute atspiTextAttribute(const QString &ia2Name, const QString &ia2Value)
|
||||||
@ -2282,7 +2282,7 @@ static QString textForRange(QAccessibleInterface *accessible, int startOffset, i
|
|||||||
}
|
}
|
||||||
QString txt = accessible->text(QAccessible::Value);
|
QString txt = accessible->text(QAccessible::Value);
|
||||||
if (endOffset == -1)
|
if (endOffset == -1)
|
||||||
endOffset = txt.length();
|
endOffset = txt.size();
|
||||||
return txt.mid(startOffset, endOffset - startOffset);
|
return txt.mid(startOffset, endOffset - startOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2290,7 +2290,7 @@ static void replaceTextFallback(QAccessibleInterface *accessible, long startOffs
|
|||||||
{
|
{
|
||||||
QString t = textForRange(accessible, 0, -1);
|
QString t = textForRange(accessible, 0, -1);
|
||||||
if (endOffset == -1)
|
if (endOffset == -1)
|
||||||
endOffset = t.length();
|
endOffset = t.size();
|
||||||
if (endOffset - startOffset == 0)
|
if (endOffset - startOffset == 0)
|
||||||
t.insert(startOffset, txt);
|
t.insert(startOffset, txt);
|
||||||
else
|
else
|
||||||
|
@ -173,11 +173,11 @@ QKeyEvent* QSpiApplicationAdaptor::copyKeyEvent(QKeyEvent* old)
|
|||||||
|
|
||||||
void QSpiApplicationAdaptor::notifyKeyboardListenerCallback(const QDBusMessage& message)
|
void QSpiApplicationAdaptor::notifyKeyboardListenerCallback(const QDBusMessage& message)
|
||||||
{
|
{
|
||||||
if (!keyEvents.length()) {
|
if (!keyEvents.size()) {
|
||||||
qWarning("QSpiApplication::notifyKeyboardListenerCallback with no queued key called");
|
qWarning("QSpiApplication::notifyKeyboardListenerCallback with no queued key called");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Q_ASSERT(message.arguments().length() == 1);
|
Q_ASSERT(message.arguments().size() == 1);
|
||||||
if (message.arguments().at(0).toBool() == true) {
|
if (message.arguments().at(0).toBool() == true) {
|
||||||
QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue();
|
QPair<QPointer<QObject>, QKeyEvent*> event = keyEvents.dequeue();
|
||||||
delete event.second;
|
delete event.second;
|
||||||
|
@ -2008,7 +2008,7 @@ static QString textLineBoundary(int beforeAtAfter, const QString &text, int offs
|
|||||||
{
|
{
|
||||||
Q_ASSERT(beforeAtAfter >= -1 && beforeAtAfter <= 1);
|
Q_ASSERT(beforeAtAfter >= -1 && beforeAtAfter <= 1);
|
||||||
Q_ASSERT(*startOffset == -1 && *endOffset == -1);
|
Q_ASSERT(*startOffset == -1 && *endOffset == -1);
|
||||||
int length = text.length();
|
int length = text.size();
|
||||||
Q_ASSERT(offset >= 0 && offset <= length);
|
Q_ASSERT(offset >= 0 && offset <= length);
|
||||||
|
|
||||||
// move offset into the right range (if asking for line before or after
|
// move offset into the right range (if asking for line before or after
|
||||||
@ -2057,10 +2057,10 @@ QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::Text
|
|||||||
const QString txt = text(0, characterCount());
|
const QString txt = text(0, characterCount());
|
||||||
|
|
||||||
if (offset == -1)
|
if (offset == -1)
|
||||||
offset = txt.length();
|
offset = txt.size();
|
||||||
|
|
||||||
*startOffset = *endOffset = -1;
|
*startOffset = *endOffset = -1;
|
||||||
if (txt.isEmpty() || offset <= 0 || offset > txt.length())
|
if (txt.isEmpty() || offset <= 0 || offset > txt.size())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
|
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
|
||||||
@ -2131,10 +2131,10 @@ QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextB
|
|||||||
const QString txt = text(0, characterCount());
|
const QString txt = text(0, characterCount());
|
||||||
|
|
||||||
if (offset == -1)
|
if (offset == -1)
|
||||||
offset = txt.length();
|
offset = txt.size();
|
||||||
|
|
||||||
*startOffset = *endOffset = -1;
|
*startOffset = *endOffset = -1;
|
||||||
if (txt.isEmpty() || offset < 0 || offset >= txt.length())
|
if (txt.isEmpty() || offset < 0 || offset >= txt.size())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
|
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
|
||||||
@ -2169,20 +2169,20 @@ QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextB
|
|||||||
int toNext = boundary.toNextBoundary();
|
int toNext = boundary.toNextBoundary();
|
||||||
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
|
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
|
||||||
break;
|
break;
|
||||||
if (toNext < 0 || toNext >= txt.length())
|
if (toNext < 0 || toNext >= txt.size())
|
||||||
break; // not found, the boundary might not exist
|
break; // not found, the boundary might not exist
|
||||||
}
|
}
|
||||||
Q_ASSERT(boundary.position() <= txt.length());
|
Q_ASSERT(boundary.position() <= txt.size());
|
||||||
*startOffset = boundary.position();
|
*startOffset = boundary.position();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int toNext = boundary.toNextBoundary();
|
int toNext = boundary.toNextBoundary();
|
||||||
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
|
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
|
||||||
break;
|
break;
|
||||||
if (toNext < 0 || toNext >= txt.length())
|
if (toNext < 0 || toNext >= txt.size())
|
||||||
break; // not found, the boundary might not exist
|
break; // not found, the boundary might not exist
|
||||||
}
|
}
|
||||||
Q_ASSERT(boundary.position() <= txt.length());
|
Q_ASSERT(boundary.position() <= txt.size());
|
||||||
*endOffset = boundary.position();
|
*endOffset = boundary.position();
|
||||||
|
|
||||||
if ((*startOffset == -1) || (*endOffset == -1) || (*startOffset == *endOffset)) {
|
if ((*startOffset == -1) || (*endOffset == -1) || (*startOffset == *endOffset)) {
|
||||||
@ -2216,13 +2216,13 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
|
|||||||
const QString txt = text(0, characterCount());
|
const QString txt = text(0, characterCount());
|
||||||
|
|
||||||
if (offset == -1)
|
if (offset == -1)
|
||||||
offset = txt.length();
|
offset = txt.size();
|
||||||
|
|
||||||
*startOffset = *endOffset = -1;
|
*startOffset = *endOffset = -1;
|
||||||
if (txt.isEmpty() || offset < 0 || offset > txt.length())
|
if (txt.isEmpty() || offset < 0 || offset > txt.size())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
if (offset == txt.length() && boundaryType == QAccessible::CharBoundary)
|
if (offset == txt.size() && boundaryType == QAccessible::CharBoundary)
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
|
// type initialized just to silence a compiler warning [-Werror=maybe-uninitialized]
|
||||||
@ -2243,7 +2243,7 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
|
|||||||
return textLineBoundary(0, txt, offset, startOffset, endOffset);
|
return textLineBoundary(0, txt, offset, startOffset, endOffset);
|
||||||
case QAccessible::NoBoundary:
|
case QAccessible::NoBoundary:
|
||||||
*startOffset = 0;
|
*startOffset = 0;
|
||||||
*endOffset = txt.length();
|
*endOffset = txt.size();
|
||||||
return txt;
|
return txt;
|
||||||
default:
|
default:
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
@ -2261,11 +2261,11 @@ QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoun
|
|||||||
Q_ASSERT(boundary.position() >= 0);
|
Q_ASSERT(boundary.position() >= 0);
|
||||||
*startOffset = boundary.position();
|
*startOffset = boundary.position();
|
||||||
|
|
||||||
while (boundary.toNextBoundary() < txt.length()) {
|
while (boundary.toNextBoundary() < txt.size()) {
|
||||||
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
|
if ((boundary.boundaryReasons() & (QTextBoundaryFinder::StartOfItem | QTextBoundaryFinder::EndOfItem)))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Q_ASSERT(boundary.position() <= txt.length());
|
Q_ASSERT(boundary.position() <= txt.size());
|
||||||
*endOffset = boundary.position();
|
*endOffset = boundary.position();
|
||||||
|
|
||||||
return txt.mid(*startOffset, *endOffset - *startOffset);
|
return txt.mid(*startOffset, *endOffset - *startOffset);
|
||||||
|
@ -409,13 +409,13 @@ class Q_GUI_EXPORT QAccessibleTextInsertEvent : public QAccessibleTextCursorEven
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QAccessibleTextInsertEvent(QObject *obj, int position, const QString &text)
|
inline QAccessibleTextInsertEvent(QObject *obj, int position, const QString &text)
|
||||||
: QAccessibleTextCursorEvent(obj, position + int(text.length()))
|
: QAccessibleTextCursorEvent(obj, position + int(text.size()))
|
||||||
, m_position(position), m_text(text)
|
, m_position(position), m_text(text)
|
||||||
{
|
{
|
||||||
m_type = QAccessible::TextInserted;
|
m_type = QAccessible::TextInserted;
|
||||||
}
|
}
|
||||||
inline QAccessibleTextInsertEvent(QAccessibleInterface *iface, int position, const QString &text)
|
inline QAccessibleTextInsertEvent(QAccessibleInterface *iface, int position, const QString &text)
|
||||||
: QAccessibleTextCursorEvent(iface, position + int(text.length()))
|
: QAccessibleTextCursorEvent(iface, position + int(text.size()))
|
||||||
, m_position(position), m_text(text)
|
, m_position(position), m_text(text)
|
||||||
{
|
{
|
||||||
m_type = QAccessible::TextInserted;
|
m_type = QAccessible::TextInserted;
|
||||||
@ -469,13 +469,13 @@ class Q_GUI_EXPORT QAccessibleTextUpdateEvent : public QAccessibleTextCursorEven
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline QAccessibleTextUpdateEvent(QObject *obj, int position, const QString &oldText, const QString &text)
|
inline QAccessibleTextUpdateEvent(QObject *obj, int position, const QString &oldText, const QString &text)
|
||||||
: QAccessibleTextCursorEvent(obj, position + int(text.length()))
|
: QAccessibleTextCursorEvent(obj, position + int(text.size()))
|
||||||
, m_position(position), m_oldText(oldText), m_text(text)
|
, m_position(position), m_oldText(oldText), m_text(text)
|
||||||
{
|
{
|
||||||
m_type = QAccessible::TextUpdated;
|
m_type = QAccessible::TextUpdated;
|
||||||
}
|
}
|
||||||
inline QAccessibleTextUpdateEvent(QAccessibleInterface *iface, int position, const QString &oldText, const QString &text)
|
inline QAccessibleTextUpdateEvent(QAccessibleInterface *iface, int position, const QString &oldText, const QString &text)
|
||||||
: QAccessibleTextCursorEvent(iface, position + int(text.length()))
|
: QAccessibleTextCursorEvent(iface, position + int(text.size()))
|
||||||
, m_position(position), m_oldText(oldText), m_text(text)
|
, m_position(position), m_oldText(oldText), m_text(text)
|
||||||
{
|
{
|
||||||
m_type = QAccessible::TextUpdated;
|
m_type = QAccessible::TextUpdated;
|
||||||
|
@ -61,7 +61,7 @@ QSize QAbstractFileIconEngine::actualSize(const QSize &size, QIcon::Mode mode,
|
|||||||
QIcon::State state)
|
QIcon::State state)
|
||||||
{
|
{
|
||||||
const QList<QSize> &sizes = availableSizes(mode, state);
|
const QList<QSize> &sizes = availableSizes(mode, state);
|
||||||
const int numberSizes = sizes.length();
|
const int numberSizes = sizes.size();
|
||||||
if (numberSizes == 0)
|
if (numberSizes == 0)
|
||||||
return QSize();
|
return QSize();
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ static QPixmapIconEngineEntry *bestSizeScaleMatch(const QSize &size, qreal scale
|
|||||||
QPixmapIconEngineEntry *QPixmapIconEngine::tryMatch(const QSize &size, qreal scale, QIcon::Mode mode, QIcon::State state)
|
QPixmapIconEngineEntry *QPixmapIconEngine::tryMatch(const QSize &size, qreal scale, QIcon::Mode mode, QIcon::State state)
|
||||||
{
|
{
|
||||||
QPixmapIconEngineEntry *pe = nullptr;
|
QPixmapIconEngineEntry *pe = nullptr;
|
||||||
for (int i = 0; i < pixmaps.count(); ++i)
|
for (int i = 0; i < pixmaps.size(); ++i)
|
||||||
if (pixmaps.at(i).mode == mode && pixmaps.at(i).state == state) {
|
if (pixmaps.at(i).mode == mode && pixmaps.at(i).state == state) {
|
||||||
if (pe)
|
if (pe)
|
||||||
pe = bestSizeScaleMatch(size, scale, &pixmaps[i], pe);
|
pe = bestSizeScaleMatch(size, scale, &pixmaps[i], pe);
|
||||||
@ -269,7 +269,7 @@ QPixmap QPixmapIconEngine::scaledPixmap(const QSize &size, QIcon::Mode mode, QIc
|
|||||||
pm = pe->pixmap;
|
pm = pe->pixmap;
|
||||||
|
|
||||||
if (pm.isNull()) {
|
if (pm.isNull()) {
|
||||||
int idx = pixmaps.count();
|
int idx = pixmaps.size();
|
||||||
while (--idx >= 0) {
|
while (--idx >= 0) {
|
||||||
if (pe == &pixmaps.at(idx)) {
|
if (pe == &pixmaps.at(idx)) {
|
||||||
pixmaps.remove(idx);
|
pixmaps.remove(idx);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user