diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config-ui/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/app/config/configcommandlineparser.cpp | 12 | ||||
-rw-r--r-- | src/app/qbs-setup-android/android-setup.cpp | 6 | ||||
-rw-r--r-- | src/app/qbs-setup-android/commandlineparser.cpp | 2 | ||||
-rw-r--r-- | src/app/qbs-setup-qt/commandlineparser.cpp | 2 | ||||
-rw-r--r-- | src/app/qbs-setup-qt/setupqt.cpp | 4 | ||||
-rw-r--r-- | src/app/qbs-setup-toolchains/commandlineparser.cpp | 2 | ||||
-rw-r--r-- | src/app/qbs-setup-toolchains/probe.cpp | 2 | ||||
-rw-r--r-- | src/app/qbs/commandlinefrontend.cpp | 22 | ||||
-rw-r--r-- | src/app/qbs/parser/commandlineparser.cpp | 8 | ||||
-rw-r--r-- | src/app/qbs/parser/parsercommand.cpp | 8 | ||||
-rw-r--r-- | src/app/qbs/qbstool.cpp | 4 |
12 files changed, 37 insertions, 37 deletions
diff --git a/src/app/config-ui/mainwindow.cpp b/src/app/config-ui/mainwindow.cpp index 4de5c85d8..836f2539b 100644 --- a/src/app/config-ui/mainwindow.cpp +++ b/src/app/config-ui/mainwindow.cpp @@ -183,7 +183,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event) QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); if (keyEvent->matches(QKeySequence::Delete)) { const QModelIndexList indexes = ui->treeView->selectionModel()->selectedRows(); - if (indexes.count() == 1) { + if (indexes.size() == 1) { const QModelIndex index = indexes.front(); if (index.isValid()) { m_model->removeKey(index); diff --git a/src/app/config/configcommandlineparser.cpp b/src/app/config/configcommandlineparser.cpp index 45fb79231..dd6262543 100644 --- a/src/app/config/configcommandlineparser.cpp +++ b/src/app/config/configcommandlineparser.cpp @@ -55,8 +55,8 @@ void ConfigCommandLineParser::parse(const QStringList &commandLine) m_commandLine = commandLine; if (m_commandLine.isEmpty()) throw ErrorInfo(Tr::tr("No parameters supplied.")); - if (m_commandLine.count() == 1 && (m_commandLine.front() == QLatin1String("--help") - || m_commandLine.front() == QLatin1String("-h"))) { + if (m_commandLine.size() == 1 && (m_commandLine.front() == QLatin1String("--help") + || m_commandLine.front() == QLatin1String("-h"))) { m_helpRequested = true; return; } @@ -81,10 +81,10 @@ void ConfigCommandLineParser::parse(const QStringList &commandLine) case ConfigCommand::CfgNone: if (m_commandLine.isEmpty()) throw ErrorInfo(Tr::tr("No parameters supplied.")); - if (m_commandLine.count() > 2) + if (m_commandLine.size() > 2) throw ErrorInfo(Tr::tr("Too many arguments.")); m_command.varNames << m_commandLine.front(); - if (m_commandLine.count() == 1) { + if (m_commandLine.size() == 1) { setCommand(ConfigCommand::CfgList); } else { m_command.varValue = m_commandLine.at(1); @@ -97,12 +97,12 @@ void ConfigCommandLineParser::parse(const QStringList &commandLine) m_command.varNames = m_commandLine; break; case ConfigCommand::CfgExport: - if (m_commandLine.count() != 1) + if (m_commandLine.size() != 1) throw ErrorInfo(Tr::tr("Need name of file to which to export.")); m_command.fileName = m_commandLine.front(); break; case ConfigCommand::CfgImport: - if (m_commandLine.count() != 1) + if (m_commandLine.size() != 1) throw ErrorInfo(Tr::tr("Need name of file from which to import.")); m_command.fileName = m_commandLine.front(); break; diff --git a/src/app/qbs-setup-android/android-setup.cpp b/src/app/qbs-setup-android/android-setup.cpp index 99866be9a..e5ad9e845 100644 --- a/src/app/qbs-setup-android/android-setup.cpp +++ b/src/app/qbs-setup-android/android-setup.cpp @@ -129,7 +129,7 @@ static QtAndroidInfo getInfoForQtDir(const QString &qtDir) if (!isArchLine && !isPlatformLine) continue; const QList<QByteArray> elems = line.split('='); - if (elems.count() != 2) + if (elems.size() != 2) continue; const QString rhs = QString::fromLatin1(elems.at(1).trimmed()); if (isArchLine) @@ -166,8 +166,8 @@ static QString maximumPlatform(const QString &platform1, const QString &platform if (platform2.isEmpty()) return platform1; static const QString prefix = qls("android-"); - const QString numberString1 = platform1.mid(prefix.count()); - const QString numberString2 = platform2.mid(prefix.count()); + const QString numberString1 = platform1.mid(prefix.size()); + const QString numberString2 = platform2.mid(prefix.size()); bool ok; const int value1 = numberString1.toInt(&ok); if (!ok) { diff --git a/src/app/qbs-setup-android/commandlineparser.cpp b/src/app/qbs-setup-android/commandlineparser.cpp index d2465f395..174016480 100644 --- a/src/app/qbs-setup-android/commandlineparser.cpp +++ b/src/app/qbs-setup-android/commandlineparser.cpp @@ -94,7 +94,7 @@ void CommandLineParser::parse(const QStringList &commandLine) return; } - switch (m_commandLine.count()) { + switch (m_commandLine.size()) { case 0: throwError(Tr::tr("No profile name supplied.")); case 1: diff --git a/src/app/qbs-setup-qt/commandlineparser.cpp b/src/app/qbs-setup-qt/commandlineparser.cpp index c51af58a0..0f842e7b2 100644 --- a/src/app/qbs-setup-qt/commandlineparser.cpp +++ b/src/app/qbs-setup-qt/commandlineparser.cpp @@ -83,7 +83,7 @@ void CommandLineParser::parse(const QStringList &commandLine) return; } - switch (m_commandLine.count()) { + switch (m_commandLine.size()) { case 0: case 1: throwError(Tr::tr("Not enough command-line arguments provided.")); diff --git a/src/app/qbs-setup-qt/setupqt.cpp b/src/app/qbs-setup-qt/setupqt.cpp index 23a5b2736..5a938bc5e 100644 --- a/src/app/qbs-setup-qt/setupqt.cpp +++ b/src/app/qbs-setup-qt/setupqt.cpp @@ -565,9 +565,9 @@ void SetupQt::saveToQbsSettings(const QString &qtVersionName, const QtEnvironmen compressMsvcProfiles(fullMatches); QString bestMatch; - if (fullMatches.count() == 1) + if (fullMatches.size() == 1) bestMatch = fullMatches.front(); - else if (fullMatches.isEmpty() && partialMatches.count() == 1) + else if (fullMatches.isEmpty() && partialMatches.size() == 1) bestMatch = partialMatches.front(); if (bestMatch.isEmpty()) { QString message = Tr::tr("You need to set up toolchain information before you can " diff --git a/src/app/qbs-setup-toolchains/commandlineparser.cpp b/src/app/qbs-setup-toolchains/commandlineparser.cpp index f67a24ab3..b7466d6b9 100644 --- a/src/app/qbs-setup-toolchains/commandlineparser.cpp +++ b/src/app/qbs-setup-toolchains/commandlineparser.cpp @@ -87,7 +87,7 @@ void CommandLineParser::parse(const QStringList &commandLine) return; } - switch (m_commandLine.count()) { + switch (m_commandLine.size()) { case 0: case 1: throwError(Tr::tr("Not enough command-line arguments provided.")); diff --git a/src/app/qbs-setup-toolchains/probe.cpp b/src/app/qbs-setup-toolchains/probe.cpp index c2bc06c7d..1dd1ad56c 100644 --- a/src/app/qbs-setup-toolchains/probe.cpp +++ b/src/app/qbs-setup-toolchains/probe.cpp @@ -289,7 +289,7 @@ void probe(Settings *settings) if (profiles.isEmpty()) { qStderr << Tr::tr("Could not detect any toolchains. No profile created.") << endl; - } else if (profiles.count() == 1 && settings->defaultProfile().isEmpty()) { + } else if (profiles.size() == 1 && settings->defaultProfile().isEmpty()) { const QString profileName = profiles.front().name(); qStdout << Tr::tr("Making profile '%1' the default.").arg(profileName) << endl; settings->setValue(QLatin1String("defaultProfile"), profileName); diff --git a/src/app/qbs/commandlinefrontend.cpp b/src/app/qbs/commandlinefrontend.cpp index 2c4290c46..00862e071 100644 --- a/src/app/qbs/commandlinefrontend.cpp +++ b/src/app/qbs/commandlinefrontend.cpp @@ -112,7 +112,7 @@ void CommandLineFrontend::start() switch (m_parser.command()) { case RunCommandType: case ShellCommandType: - if (m_parser.products().count() > 1) { + if (m_parser.products().size() > 1) { throw ErrorInfo(Tr::tr("Invalid use of command '%1': Cannot use more than one " "product.\nUsage: %2") .arg(m_parser.commandName(), m_parser.commandDescription())); @@ -122,7 +122,7 @@ void CommandLineFrontend::start() case InstallCommandType: case DumpNodesTreeCommandType: case ListProductsCommandType: - if (m_parser.buildConfigurations().count() > 1) { + if (m_parser.buildConfigurations().size() > 1) { QString error = Tr::tr("Invalid use of command '%1': There can be only one " "build configuration.\n").arg(m_parser.commandName()); error += Tr::tr("Usage: %1").arg(m_parser.commandDescription()); @@ -190,7 +190,7 @@ void CommandLineFrontend::start() * notification to arrive.) */ if (m_parser.showProgress() && resolvingMultipleProjects()) - m_observer->initialize(tr("Setting up projects"), m_resolveJobs.count()); + m_observer->initialize(tr("Setting up projects"), m_resolveJobs.size()); // Check every two seconds whether we received a cancel request. This value has been // experimentally found to be acceptable. @@ -322,7 +322,7 @@ void CommandLineFrontend::handleProcessResultReport(const qbs::ProcessResult &re bool CommandLineFrontend::resolvingMultipleProjects() const { - return isResolving() && m_resolveJobs.count() + m_projects.count() > 1; + return isResolving() && m_resolveJobs.size() + m_projects.size() > 1; } bool CommandLineFrontend::isResolving() const @@ -427,7 +427,7 @@ void CommandLineFrontend::makeClean() int CommandLineFrontend::runShell() { ProductData productToRun; - switch (m_parser.products().count()) { + switch (m_parser.products().size()) { case 0: // No specific product, use project-global environment. break; case 1: @@ -496,7 +496,7 @@ void CommandLineFrontend::build() * the respective total efforts as they come in. Once all jobs have reported their total * efforts, we can start the overall progress report. */ - m_buildEffortsNeeded = m_buildJobs.count(); + m_buildEffortsNeeded = m_buildJobs.size(); m_buildEffortsRetrieved = 0; m_totalBuildEffort = 0; m_currentBuildEffort = 0; @@ -612,16 +612,16 @@ void CommandLineFrontend::connectJob(AbstractJob *job) ProductData CommandLineFrontend::getTheOneRunnableProduct() { - QBS_CHECK(m_projects.count() == 1); // Has been checked earlier. + QBS_CHECK(m_projects.size() == 1); // Has been checked earlier. - if (m_parser.products().count() == 1) { + if (m_parser.products().size() == 1) { foreach (const ProductData &p, m_projects.front().projectData().allProducts()) { if (p.name() == m_parser.products().front()) return p; } QBS_CHECK(false); } - QBS_CHECK(m_parser.products().count() == 0); + QBS_CHECK(m_parser.products().size() == 0); QList<ProductData> runnableProducts; foreach (const ProductData &p, m_projects.front().projectData().allProducts()) { @@ -629,7 +629,7 @@ ProductData CommandLineFrontend::getTheOneRunnableProduct() runnableProducts << p; } - if (runnableProducts.count() == 1) + if (runnableProducts.size() == 1) return runnableProducts.front(); if (runnableProducts.isEmpty()) { @@ -653,7 +653,7 @@ ProductData CommandLineFrontend::getTheOneRunnableProduct() void CommandLineFrontend::install() { - Q_ASSERT(m_projects.count() == 1); + Q_ASSERT(m_projects.size() == 1); const Project project = m_projects.front(); InstallJob *installJob; if (m_parser.products().isEmpty()) { diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp index c223ea735..1ff7a665a 100644 --- a/src/app/qbs/parser/commandlineparser.cpp +++ b/src/app/qbs/parser/commandlineparser.cpp @@ -403,7 +403,7 @@ QString CommandLineParser::CommandLineParserPrivate::generalHelp() const foreach (const Command * command, commandMap) { help.append(QLatin1String(" ")).append(command->representation()); const QString whitespace - = QString(rhsIndentation - 2 - command->representation().count(), QLatin1Char(' ')); + = QString(rhsIndentation - 2 - command->representation().size(), QLatin1Char(' ')); help.append(whitespace).append(command->shortDescription()).append(QLatin1Char('\n')); } @@ -413,7 +413,7 @@ QString CommandLineParser::CommandLineParserPrivate::generalHelp() const help.append(QLatin1Char('\n')).append(Tr::tr("Auxiliary commands:\n")); foreach (const QString &toolName, toolNames) { help.append(QLatin1String(" ")).append(toolName); - const QString whitespace = QString(rhsIndentation - 2 - toolName.count(), + const QString whitespace = QString(rhsIndentation - 2 - toolName.size(), QLatin1Char(' ')); QbsTool tool; tool.runTool(toolName, QStringList(QLatin1String("--help"))); @@ -442,7 +442,7 @@ void CommandLineParser::CommandLineParserPrivate::setupBuildOptions() buildOptions.setDryRun(dryRun()); QStringList changedFiles = optionPool.changedFilesOption()->arguments(); QDir currentDir; - for (int i = 0; i < changedFiles.count(); ++i) { + for (int i = 0; i < changedFiles.size(); ++i) { QString &file = changedFiles[i]; file = QDir::fromNativeSeparators(currentDir.absoluteFilePath(file)); } @@ -484,7 +484,7 @@ void CommandLineParser::CommandLineParserPrivate::setupBuildConfigurations() } propertiesPerConfiguration << std::make_pair(currentConfigurationName, currentProperties); - if (propertiesPerConfiguration.count() == 1) // No configuration name specified on command line. + if (propertiesPerConfiguration.size() == 1) // No configuration name specified on command line. propertiesPerConfiguration << PropertyListItem(QStringLiteral("default"), QVariantMap()); const QVariantMap globalProperties = propertiesPerConfiguration.takeFirst().second; diff --git a/src/app/qbs/parser/parsercommand.cpp b/src/app/qbs/parser/parsercommand.cpp index 7bf147cea..564ecfcf2 100644 --- a/src/app/qbs/parser/parsercommand.cpp +++ b/src/app/qbs/parser/parsercommand.cpp @@ -104,13 +104,13 @@ void Command::parseOption(QStringList &input) const QString optionString = input.front(); QBS_CHECK(optionString.startsWith(QLatin1Char('-'))); input.removeFirst(); - if (optionString.count() == 1) + if (optionString.size() == 1) throwError(Tr::tr("Empty options are not allowed.")); // Split up grouped short options. - if (optionString.at(1) != QLatin1Char('-') && optionString.count() > 2) { + if (optionString.at(1) != QLatin1Char('-') && optionString.size() > 2) { QString parameter; - for (int i = optionString.count(); --i > 0;) { + for (int i = optionString.size(); --i > 0;) { const QChar c = optionString.at(i); if (c.isDigit()) { parameter.prepend(c); @@ -562,7 +562,7 @@ void HelpCommand::parseNext(QStringList &input) { if (input.isEmpty()) return; - if (input.count() > 1) + if (input.size() > 1) throwError(Tr::tr("Cannot describe more than one command.")); m_command = input.takeFirst(); QBS_CHECK(input.empty()); diff --git a/src/app/qbs/qbstool.cpp b/src/app/qbs/qbstool.cpp index d9afda270..d01c39591 100644 --- a/src/app/qbs/qbstool.cpp +++ b/src/app/qbs/qbstool.cpp @@ -95,10 +95,10 @@ QStringList QbsTool::allToolNames() QStringList toolFileNames = QDir(qbsBinDir()).entryList(QStringList(toolPrefix() + QString::fromLatin1("*%1").arg(suffix)), QDir::Files, QDir::Name); QStringList toolNames; - const int prefixLength = toolPrefix().count(); + const int prefixLength = toolPrefix().size(); foreach (const QString &toolFileName, toolFileNames) { toolNames << toolFileName.mid(prefixLength, - toolFileName.count() - prefixLength - suffix.count()); + toolFileName.size() - prefixLength - suffix.size()); } return toolNames; } |