diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-10-24 10:50:33 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-11-16 15:11:15 +0000 |
commit | 4432ba4949647917d0fc3fb2ef73f9737a7c2431 (patch) | |
tree | e36f48e90f7019ad0ecfb7046638cebf3410930e /src/lib/corelib/buildgraph | |
parent | a0c61e70eeefbf9d6c632a94d29bcc2a7e97b7d7 (diff) |
STL compatibility: use empty() instead of isEmpty()
This is a simple find and replace with manual sanity check.
Change-Id: Iab6d46dcc3be246d1650aae2b1730f933b717be8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph')
-rw-r--r-- | src/lib/corelib/buildgraph/buildgraph.cpp | 4 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/buildgraphloader.cpp | 16 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/depscanner.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/emptydirectoriesremover.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/executor.cpp | 36 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/executorjob.cpp | 4 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/inputartifactscanner.cpp | 4 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/productbuilddata.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/projectbuilddata.cpp | 4 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/qtmocscanner.cpp | 4 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/rulenode.cpp | 8 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/rulesapplicator.cpp | 14 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/timestampsupdater.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/buildgraph/transformer.cpp | 6 |
14 files changed, 54 insertions, 54 deletions
diff --git a/src/lib/corelib/buildgraph/buildgraph.cpp b/src/lib/corelib/buildgraph/buildgraph.cpp index 4582bc870..5009a4aff 100644 --- a/src/lib/corelib/buildgraph/buildgraph.cpp +++ b/src/lib/corelib/buildgraph/buildgraph.cpp @@ -187,7 +187,7 @@ private: setupProductScriptValue(static_cast<ScriptEngine *>(engine), obj, dependency.get(), 0); const QVariantMap ¶ms = product->dependencyParameters.value(dependency); - obj.setProperty(m_parametersKey, params.isEmpty() + obj.setProperty(m_parametersKey, params.empty() ? engine->newObject() : toScriptValue(engine, observer, params, dependency->name)); @@ -199,7 +199,7 @@ private: QScriptValue obj = engine->newObject(); setupModuleScriptValue(static_cast<ScriptEngine *>(engine), obj, dependency.get()); const QVariantMap ¶ms = product->moduleParameters.value(dependency); - obj.setProperty(m_parametersKey, params.isEmpty() + obj.setProperty(m_parametersKey, params.empty() ? engine->newObject() : toScriptValue(engine, observer, params, dependency->name)); diff --git a/src/lib/corelib/buildgraph/buildgraphloader.cpp b/src/lib/corelib/buildgraph/buildgraphloader.cpp index e6051abcb..13b0312d3 100644 --- a/src/lib/corelib/buildgraph/buildgraphloader.cpp +++ b/src/lib/corelib/buildgraph/buildgraphloader.cpp @@ -354,7 +354,7 @@ void BuildGraphLoader::trackProjectChanges() std::shared_ptr<ProjectBuildData> oldBuildData; ChildListHash childLists; - if (!changedProducts.isEmpty()) { + if (!changedProducts.empty()) { oldBuildData = std::make_shared<ProjectBuildData>(restoredProject->buildData.get()); for (const ResolvedProductConstPtr &product : qAsConst(allRestoredProducts)) { if (!product->buildData) @@ -419,7 +419,7 @@ void BuildGraphLoader::trackProjectChanges() // Products still left in the list need resolving, either because they are new // or because they are newly enabled. - if (!allNewlyResolvedProducts.isEmpty()) { + if (!allNewlyResolvedProducts.empty()) { BuildDataResolver bpr(m_logger); bpr.resolveProductBuildDataForExistingProject(m_result.newlyResolvedProject, allNewlyResolvedProducts); @@ -448,11 +448,11 @@ bool BuildGraphLoader::probeExecutionForced( if (!m_parameters.forceProbeExecution()) return false; - if (!restoredProject->probes.isEmpty()) + if (!restoredProject->probes.empty()) return true; for (const auto &p : qAsConst(restoredProducts)) { - if (!p->probes.isEmpty()) + if (!p->probes.empty()) return true; } @@ -815,7 +815,7 @@ static QVariantMap propertyMapByKind(const ResolvedProductConstPtr &product, const int sepIndex = property.moduleName.indexOf(QLatin1Char(':')); const QString depName = property.moduleName.left(sepIndex); QVariantMap v = getParameterValue(product->dependencyParameters, depName); - if (!v.isEmpty()) + if (!v.empty()) return v; return getParameterValue(product->moduleParameters, depName); } @@ -948,7 +948,7 @@ bool BuildGraphLoader::checkForPropertyChange(const Property &restoredProperty, QualifiedId moduleName = QualifiedId::fromString(restoredProperty.moduleName.mid(sepIndex + 1)); QVariantMap map = newProperties; - while (!moduleName.isEmpty()) + while (!moduleName.empty()) map = map.value(moduleName.takeFirst()).toMap(); v = map.value(restoredProperty.propertyName); } @@ -988,7 +988,7 @@ bool BuildGraphLoader::checkConfigCompatibility() if (m_parameters.topLevelProfile().isEmpty()) m_parameters.setTopLevelProfile(restoredProject->profile()); if (!m_parameters.overrideBuildGraphData()) { - if (!m_parameters.overriddenValues().isEmpty() + if (!m_parameters.overriddenValues().empty() && m_parameters.overriddenValues() != restoredProject->overriddenValues) { throw ErrorInfo(Tr::tr("Property values set on the command line differ from the " "ones used for the previous build. Use the 'resolve' command if " @@ -1034,7 +1034,7 @@ void BuildGraphLoader::rescueOldBuildData(const ResolvedProductConstPtr &restore qCDebug(lcBuildGraph) << "rescue data of product" << restoredProduct->uniqueName(); QBS_CHECK(newlyResolvedProduct->buildData); - QBS_CHECK(newlyResolvedProduct->buildData->rescuableArtifactData.isEmpty()); + QBS_CHECK(newlyResolvedProduct->buildData->rescuableArtifactData.empty()); newlyResolvedProduct->buildData->rescuableArtifactData = existingRad; // This is needed for artifacts created by rules, which happens later in the executor. diff --git a/src/lib/corelib/buildgraph/depscanner.cpp b/src/lib/corelib/buildgraph/depscanner.cpp index ae892d1f0..cf8280a9f 100644 --- a/src/lib/corelib/buildgraph/depscanner.cpp +++ b/src/lib/corelib/buildgraph/depscanner.cpp @@ -71,7 +71,7 @@ static QStringList collectCppIncludePaths(const QVariantMap &modules) { QStringList result; const QVariantMap cpp = modules.value(QLatin1String("cpp")).toMap(); - if (cpp.isEmpty()) + if (cpp.empty()) return result; result << cpp.value(QLatin1String("includePaths")).toStringList(); diff --git a/src/lib/corelib/buildgraph/emptydirectoriesremover.cpp b/src/lib/corelib/buildgraph/emptydirectoriesremover.cpp index 5a6a1c137..da3be8755 100644 --- a/src/lib/corelib/buildgraph/emptydirectoriesremover.cpp +++ b/src/lib/corelib/buildgraph/emptydirectoriesremover.cpp @@ -60,7 +60,7 @@ void EmptyDirectoriesRemover::removeEmptyParentDirectories(const QStringList &ar m_handledDirs.clear(); for (const QString &filePath : artifactFilePaths) insertSorted(QFileInfo(filePath).absolutePath()); - while (!m_dirsToRemove.isEmpty()) + while (!m_dirsToRemove.empty()) removeDirIfEmpty(); } diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp index 0d5a2660d..d5cb56f24 100644 --- a/src/lib/corelib/buildgraph/executor.cpp +++ b/src/lib/corelib/buildgraph/executor.cpp @@ -132,7 +132,7 @@ void Executor::retrieveSourceFileTimestamp(Artifact *artifact) const { QBS_CHECK(artifact->artifactType == Artifact::SourceFile); - if (m_buildOptions.changedFiles().isEmpty()) + if (m_buildOptions.changedFiles().empty()) artifact->setTimestamp(recursiveFileTime(artifact->filePath())); else if (m_buildOptions.changedFiles().contains(artifact->filePath())) artifact->setTimestamp(FileTime::currentTime()); @@ -224,7 +224,7 @@ void Executor::doBuild() // it is. Remove this from the BuildOptions class and introduce Project::buildSomeFiles() // instead. const QStringList &filesToConsider = m_buildOptions.filesToConsider(); - if (!filesToConsider.isEmpty()) { + if (!filesToConsider.empty()) { for (const QString &fileToConsider : filesToConsider) { const QList<FileResourceBase *> &files = m_project->buildData->lookupFiles(fileToConsider); @@ -240,7 +240,7 @@ void Executor::doBuild() setState(ExecutorRunning); - if (m_productsToBuild.isEmpty()) { + if (m_productsToBuild.empty()) { qCDebug(lcExec) << "No products to build, finishing."; QTimer::singleShot(0, this, &Executor::finish); // Don't call back on the caller. return; @@ -330,7 +330,7 @@ void Executor::updateLeaves(BuildGraphNode *node, NodeSet &seenNodes) bool Executor::scheduleJobs() { QBS_CHECK(m_state == ExecutorRunning); - while (!m_leaves.empty() && !m_availableJobs.isEmpty()) { + while (!m_leaves.empty() && !m_availableJobs.empty()) { BuildGraphNode * const nodeToBuild = m_leaves.top(); m_leaves.pop(); @@ -353,7 +353,7 @@ bool Executor::scheduleJobs() break; } } - return !m_leaves.empty() || !m_processingJobs.isEmpty(); + return !m_leaves.empty() || !m_processingJobs.empty(); } bool Executor::isUpToDate(Artifact *artifact) const @@ -492,7 +492,7 @@ void Executor::executeRuleNode(RuleNode *ruleNode) qCDebug(lcExec) << ruleNode->toString(); const WeakPointer<ResolvedProduct> &product = ruleNode->product; Set<RuleNode *> parentRules; - if (!result.createdNodes.isEmpty()) { + if (!result.createdNodes.empty()) { for (BuildGraphNode *parent : qAsConst(ruleNode->parents)) { if (RuleNode *parentRule = dynamic_cast<RuleNode *>(parent)) parentRules += parentRule; @@ -569,7 +569,7 @@ void Executor::finishJob(ExecutorJob *job, bool success) } if (m_state == ExecutorCanceling) { - if (m_processingJobs.isEmpty()) { + if (m_processingJobs.empty()) { qCDebug(lcExec) << "All pending jobs are done, finishing."; finish(); } @@ -623,7 +623,7 @@ QString Executor::configString() const bool Executor::transformerHasMatchingOutputTags(const TransformerConstPtr &transformer) const { - if (m_activeFileTags.isEmpty()) + if (m_activeFileTags.empty()) return true; // No filtering requested. return std::any_of(transformer->outputs.cbegin(), transformer->outputs.cend(), @@ -638,11 +638,11 @@ bool Executor::artifactHasMatchingOutputTags(const Artifact *artifact) const bool Executor::transformerHasMatchingInputFiles(const TransformerConstPtr &transformer) const { - if (m_buildOptions.filesToConsider().isEmpty()) + if (m_buildOptions.filesToConsider().empty()) return true; // No filtering requested. if (!m_productsOfFilesToConsider.contains(transformer->product())) return false; - if (transformer->inputs.isEmpty()) + if (transformer->inputs.empty()) return true; for (const Artifact * const input : qAsConst(transformer->inputs)) { for (const QString &filePath : m_buildOptions.filesToConsider()) { @@ -682,7 +682,7 @@ void Executor::setupProgressObserver() void Executor::doSanityChecks() { QBS_CHECK(m_project); - QBS_CHECK(!m_productsToBuild.isEmpty()); + QBS_CHECK(!m_productsToBuild.empty()); for (const ResolvedProductConstPtr &product : qAsConst(m_productsToBuild)) { QBS_CHECK(product->buildData); QBS_CHECK(product->topLevelProject() == m_project.get()); @@ -693,7 +693,7 @@ void Executor::handleError(const ErrorInfo &error) { for (const ErrorItem &ei : error.items()) m_error.append(ei); - if (m_processingJobs.isEmpty()) + if (m_processingJobs.empty()) finish(); else cancelJobs(); @@ -813,7 +813,7 @@ void Executor::rescueOldBuildData(Artifact *artifact, bool *childrenAdded = 0) = rad.importedFilesUsedInPrepareScript; artifact->transformer->importedFilesUsedInCommands = rad.importedFilesUsedInCommands; artifact->setTimestamp(rad.timeStamp); - if (childrenAdded && !childrenToConnect.isEmpty()) + if (childrenAdded && !childrenToConnect.empty()) *childrenAdded = true; for (const ChildArtifactData &cad : qAsConst(childrenToConnect)) { safeConnect(artifact, cad.first); @@ -849,7 +849,7 @@ bool Executor::checkForUnbuiltDependencies(Artifact *artifact) break; } } - if (!unbuiltDependencies.isEmpty()) { + if (!unbuiltDependencies.empty()) { artifact->inputsScanned = false; updateLeaves(unbuiltDependencies); return true; @@ -926,7 +926,7 @@ void Executor::runTransformer(const TransformerPtr &transformer) } } - QBS_CHECK(!m_availableJobs.isEmpty()); + QBS_CHECK(!m_availableJobs.empty()); ExecutorJob *job = m_availableJobs.takeFirst(); for (Artifact * const artifact : qAsConst(transformer->outputs)) artifact->buildState = BuildGraphNode::Building; @@ -948,7 +948,7 @@ void Executor::possiblyInstallArtifact(const Artifact *artifact) ? &m_elapsedTimeInstalling : nullptr); if (m_buildOptions.install() && !m_buildOptions.executeRulesOnly() - && (m_activeFileTags.isEmpty() || artifactHasMatchingOutputTags(artifact)) + && (m_activeFileTags.empty() || artifactHasMatchingOutputTags(artifact)) && artifact->properties->qbsPropertyValue(QLatin1String("install")).toBool()) { m_productInstaller->copyFile(artifact); } @@ -1009,7 +1009,7 @@ void Executor::checkForUnbuiltProducts() } } - if (unbuiltProducts.isEmpty()) { + if (unbuiltProducts.empty()) { m_logger.qbsInfo() << Tr::tr("Build done%1.").arg(configString()); } else { m_error.append(Tr::tr("The following products could not be built%1:").arg(configString())); @@ -1134,7 +1134,7 @@ void Executor::setupForBuildingSelectedFiles(const BuildGraphNode *node) { if (node->type() != BuildGraphNode::RuleNodeType) return; - if (m_buildOptions.filesToConsider().isEmpty()) + if (m_buildOptions.filesToConsider().empty()) return; if (!m_productsOfFilesToConsider.contains(node->product.lock())) return; diff --git a/src/lib/corelib/buildgraph/executorjob.cpp b/src/lib/corelib/buildgraph/executorjob.cpp index c2f28dcf4..8fb767d38 100644 --- a/src/lib/corelib/buildgraph/executorjob.cpp +++ b/src/lib/corelib/buildgraph/executorjob.cpp @@ -97,7 +97,7 @@ void ExecutorJob::run(Transformer *t) { QBS_ASSERT(m_currentCommandIdx == -1, return); - if (t->commands.isEmpty()) { + if (t->commands.empty()) { setFinished(); return; } @@ -105,7 +105,7 @@ void ExecutorJob::run(Transformer *t) t->propertiesRequestedInCommands.clear(); t->propertiesRequestedFromArtifactInCommands.clear(); t->importedFilesUsedInCommands.clear(); - QBS_CHECK(!t->outputs.isEmpty()); + QBS_CHECK(!t->outputs.empty()); m_processCommandExecutor->setProcessEnvironment( (*t->outputs.cbegin())->product->buildEnvironment); m_transformer = t; diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp index 89d6bde93..75f7ff15e 100644 --- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp +++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp @@ -151,11 +151,11 @@ void InputArtifactScanner::scanForFileDependencies(Artifact *inputArtifact) QList<FileResourceBase *> filesToScan; filesToScan.append(inputArtifact); const Set<DependencyScanner *> scanners = scannersForArtifact(inputArtifact); - if (scanners.isEmpty()) + if (scanners.empty()) return; m_fileTagsForScanner = inputArtifact->fileTags().toStringList().join(QLatin1Char(',')).toLatin1(); - while (!filesToScan.isEmpty()) { + while (!filesToScan.empty()) { FileResourceBase *fileToBeScanned = filesToScan.takeFirst(); const QString &filePathToBeScanned = fileToBeScanned->filePath(); if (!visitedFilePaths.insert(filePathToBeScanned).second) diff --git a/src/lib/corelib/buildgraph/productbuilddata.cpp b/src/lib/corelib/buildgraph/productbuilddata.cpp index 3ed2bd3fe..580a728fa 100644 --- a/src/lib/corelib/buildgraph/productbuilddata.cpp +++ b/src/lib/corelib/buildgraph/productbuilddata.cpp @@ -91,7 +91,7 @@ void removeArtifactFromSetByFileTag(Artifact *artifact, const FileTag &fileTag, if (it == container.end()) return; it->remove(artifact); - if (it->isEmpty()) + if (it->empty()) container.erase(it); } diff --git a/src/lib/corelib/buildgraph/projectbuilddata.cpp b/src/lib/corelib/buildgraph/projectbuilddata.cpp index b3c7d5ae1..258943051 100644 --- a/src/lib/corelib/buildgraph/projectbuilddata.cpp +++ b/src/lib/corelib/buildgraph/projectbuilddata.cpp @@ -200,12 +200,12 @@ void ProjectBuildData::removeArtifactAndExclusiveDependents(Artifact *artifact, for (Artifact *parent : filterByType<Artifact>(parentsCopy)) { bool removeParent = false; disconnect(parent, artifact); - if (parent->children.isEmpty()) { + if (parent->children.empty()) { removeParent = true; } else if (parent->transformer) { parent->product->registerArtifactWithChangedInputs(parent); parent->transformer->inputs.remove(artifact); - removeParent = parent->transformer->inputs.isEmpty(); + removeParent = parent->transformer->inputs.empty(); } if (removeParent) { removeArtifactAndExclusiveDependents(parent, logger, removeFromProduct, diff --git a/src/lib/corelib/buildgraph/qtmocscanner.cpp b/src/lib/corelib/buildgraph/qtmocscanner.cpp index 906a0e37d..df2bfab00 100644 --- a/src/lib/corelib/buildgraph/qtmocscanner.cpp +++ b/src/lib/corelib/buildgraph/qtmocscanner.cpp @@ -173,7 +173,7 @@ static RawScanResult runScanner(ScannerPlugin *scanner, const Artifact *artifact void QtMocScanner::findIncludedMocCppFiles() { - if (!m_includedMocCppFiles.isEmpty()) + if (!m_includedMocCppFiles.empty()) return; qCDebug(lcMocScan) << "looking for included moc_XXX.cpp files"; @@ -239,7 +239,7 @@ QScriptValue QtMocScanner::apply(QScriptEngine *engine, const Artifact *artifact ScannerPlugin * const scanner = scannerPluginForFileTags(artifact->fileTags()); const RawScanResult scanResult = runScanner(scanner, artifact); - if (!scanResult.additionalFileTags.isEmpty()) { + if (!scanResult.additionalFileTags.empty()) { if (isHeaderFile) { if (scanResult.additionalFileTags.contains(m_tags.moc_hpp)) hasQObjectMacro = true; diff --git a/src/lib/corelib/buildgraph/rulenode.cpp b/src/lib/corelib/buildgraph/rulenode.cpp index 01b054cfd..784e976f3 100644 --- a/src/lib/corelib/buildgraph/rulenode.cpp +++ b/src/lib/corelib/buildgraph/rulenode.cpp @@ -83,7 +83,7 @@ void RuleNode::apply(const Logger &logger, const ArtifactSet &changedInputs, ArtifactSet allCompatibleInputs = currentInputArtifacts(); const ArtifactSet addedInputs = allCompatibleInputs - m_oldInputArtifacts; const ArtifactSet removedInputs = m_oldInputArtifacts - allCompatibleInputs; - result->upToDate = changedInputs.isEmpty() && addedInputs.isEmpty() && removedInputs.isEmpty() + result->upToDate = changedInputs.empty() && addedInputs.empty() && removedInputs.empty() && m_rule->declaresInputs() && m_rule->requiresInputs; qCDebug(lcBuildGraph).noquote().nospace() @@ -110,7 +110,7 @@ void RuleNode::apply(const Logger &logger, const ArtifactSet &changedInputs, if (result->upToDate) return; - if (!removedInputs.isEmpty()) { + if (!removedInputs.empty()) { ArtifactSet outputArtifactsToRemove; for (Artifact * const artifact : removedInputs) { for (Artifact *parent : filterByType<Artifact>(artifact->parents)) { @@ -131,7 +131,7 @@ void RuleNode::apply(const Logger &logger, const ArtifactSet &changedInputs, } RulesApplicator::handleRemovedRuleOutputs(inputs, outputArtifactsToRemove, logger); } - if (!inputs.isEmpty() || !m_rule->declaresInputs() || !m_rule->requiresInputs) { + if (!inputs.empty() || !m_rule->declaresInputs() || !m_rule->requiresInputs) { RulesApplicator applicator(product.lock(), logger); applicator.applyRule(m_rule, inputs); result->createdNodes = applicator.createdArtifacts(); @@ -170,7 +170,7 @@ ArtifactSet RuleNode::currentInputArtifacts() const } } - if (m_rule->inputsFromDependencies.isEmpty()) + if (m_rule->inputsFromDependencies.empty()) return s; for (const FileTag &t : qAsConst(m_rule->inputsFromDependencies)) { for (Artifact *artifact : product->lookupArtifactsByFileTag(t)) { diff --git a/src/lib/corelib/buildgraph/rulesapplicator.cpp b/src/lib/corelib/buildgraph/rulesapplicator.cpp index c550bfec9..bd7e0379c 100644 --- a/src/lib/corelib/buildgraph/rulesapplicator.cpp +++ b/src/lib/corelib/buildgraph/rulesapplicator.cpp @@ -85,7 +85,7 @@ RulesApplicator::~RulesApplicator() void RulesApplicator::applyRule(const RuleConstPtr &rule, const ArtifactSet &inputArtifacts) { - if (inputArtifacts.isEmpty() && rule->declaresInputs() && rule->requiresInputs) + if (inputArtifacts.empty() && rule->declaresInputs() && rule->requiresInputs) return; m_createdArtifacts.clear(); @@ -200,7 +200,7 @@ void RulesApplicator::doApply(const ArtifactSet &inputArtifacts, QScriptValue &p } } - if (outputArtifacts.isEmpty()) + if (outputArtifacts.empty()) return; for (Artifact * const outputArtifact : qAsConst(outputArtifacts)) { @@ -214,7 +214,7 @@ void RulesApplicator::doApply(const ArtifactSet &inputArtifacts, QScriptValue &p // change the transformer outputs according to the bindings in Artifact QScriptValue scriptValue; - if (!ruleArtifactArtifactMap.isEmpty()) + if (!ruleArtifactArtifactMap.empty()) engine()->setGlobalObject(prepareScriptContext); for (int i = ruleArtifactArtifactMap.size(); --i >= 0;) { const RuleArtifact *ra = ruleArtifactArtifactMap.at(i).first; @@ -243,13 +243,13 @@ void RulesApplicator::doApply(const ArtifactSet &inputArtifacts, QScriptValue &p } outputArtifact->properties->setValue(artifactModulesCfg); } - if (!ruleArtifactArtifactMap.isEmpty()) + if (!ruleArtifactArtifactMap.empty()) engine()->setGlobalObject(prepareScriptContext.prototype()); m_transformer->setupOutputs(prepareScriptContext); m_transformer->createCommands(engine(), m_rule->prepareScript, ScriptEngine::argumentList(Rule::argumentNamesForPrepare(), prepareScriptContext)); - if (Q_UNLIKELY(m_transformer->commands.isEmpty())) + if (Q_UNLIKELY(m_transformer->commands.empty())) throw ErrorInfo(Tr::tr("There is a rule without commands: %1.") .arg(m_rule->toString()), m_rule->prepareScript->location); } @@ -364,7 +364,7 @@ Artifact *RulesApplicator::createOutputArtifact(const QString &filePath, const F outputArtifact->alwaysUpdated = alwaysUpdated; outputArtifact->properties = m_product->moduleProperties; - FileTags outputArtifactFileTags = fileTags.isEmpty() + FileTags outputArtifactFileTags = fileTags.empty() ? m_product->fileTagsForFileName(outputArtifact->fileName()) : fileTags; for (int i = 0; i < m_product->artifactProperties.size(); ++i) { const ArtifactPropertiesConstPtr &props = m_product->artifactProperties.at(i); @@ -515,7 +515,7 @@ Artifact *RulesApplicator::createOutputArtifactFromScriptValue(const QScriptValu const QVariant alwaysUpdatedVar = obj.property(QLatin1String("alwaysUpdated")).toVariant(); const bool alwaysUpdated = alwaysUpdatedVar.isValid() ? alwaysUpdatedVar.toBool() : true; Artifact *output = createOutputArtifact(filePath, fileTags, alwaysUpdated, inputArtifacts); - if (output->fileTags().isEmpty()) { + if (output->fileTags().empty()) { // Check the file tags after file taggers were run. throw RuleOutputArtifactsException( Tr::tr("Property fileTags for artifact '%1' must be a non-empty string list. " diff --git a/src/lib/corelib/buildgraph/timestampsupdater.cpp b/src/lib/corelib/buildgraph/timestampsupdater.cpp index 62e395777..3e454ac39 100644 --- a/src/lib/corelib/buildgraph/timestampsupdater.cpp +++ b/src/lib/corelib/buildgraph/timestampsupdater.cpp @@ -88,7 +88,7 @@ void TimestampsUpdater::updateTimestamps(const TopLevelProjectPtr &project, TimestampsUpdateVisitor v; for (const ResolvedProductPtr &product : products) v.visitProduct(product); - project->buildData->isDirty = !products.isEmpty(); + project->buildData->isDirty = !products.empty(); project->store(logger); } diff --git a/src/lib/corelib/buildgraph/transformer.cpp b/src/lib/corelib/buildgraph/transformer.cpp index 29028e8d4..13d84adaa 100644 --- a/src/lib/corelib/buildgraph/transformer.cpp +++ b/src/lib/corelib/buildgraph/transformer.cpp @@ -157,7 +157,7 @@ QScriptValue Transformer::translateInOutputs(ScriptEngine *scriptEngine, ResolvedProductPtr Transformer::product() const { - if (outputs.isEmpty()) + if (outputs.empty()) return ResolvedProductPtr(); return (*outputs.cbegin())->product.lock(); } @@ -172,7 +172,7 @@ void Transformer::setupInputs(QScriptValue targetScriptValue, const ArtifactSet if (inputs.size() == 1) { Artifact *input = *inputs.cbegin(); const FileTags &fileTags = input->fileTags(); - QBS_ASSERT(!fileTags.isEmpty(), return); + QBS_ASSERT(!fileTags.empty(), return); QScriptValue inputsForFileTag = scriptValue.property(fileTags.cbegin()->toString()); inputScriptValue = inputsForFileTag.property(0); } @@ -194,7 +194,7 @@ void Transformer::setupOutputs(QScriptValue targetScriptValue) if (outputs.size() == 1) { Artifact *output = *outputs.cbegin(); const FileTags &fileTags = output->fileTags(); - QBS_ASSERT(!fileTags.isEmpty(), return); + QBS_ASSERT(!fileTags.empty(), return); QScriptValue outputsForFileTag = scriptValue.property(fileTags.cbegin()->toString()); outputScriptValue = outputsForFileTag.property(0); } |