diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-10-24 09:02:03 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-11-15 16:57:54 +0000 |
commit | a0c61e70eeefbf9d6c632a94d29bcc2a7e97b7d7 (patch) | |
tree | 10ae236ef25cc2284377ab7bf29a315ad6a7444c /src/app/qbs/commandlinefrontend.cpp | |
parent | 9d8ad8027a34de6871f753047a160b3b3ec65368 (diff) | |
download | qbs-a0c61e70eeefbf9d6c632a94d29bcc2a7e97b7d7.tar.gz |
STL compatibility: use size() instead of count()
This is a simple find and replace with manual sanity check.
Change-Id: Ia733befe7885dc3c643d5c84e151312bfd86a3c6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/app/qbs/commandlinefrontend.cpp')
-rw-r--r-- | src/app/qbs/commandlinefrontend.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
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()) { |