ExtensionSystem: Some modernization

Mostly 'foreach'.

Change-Id: I5390d03bb5cc37c3674b61cea6f5d22bae554ed2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2020-02-14 08:51:08 +01:00
parent 092ee20418
commit d3d294cd81
9 changed files with 59 additions and 59 deletions

View File

@@ -803,8 +803,8 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
if (!value.isUndefined() && !value.isArray())
return reportError(msgValueIsNotAObjectArray(DEPENDENCIES));
if (!value.isUndefined()) {
QJsonArray array = value.toArray();
foreach (const QJsonValue &v, array) {
const QJsonArray array = value.toArray();
for (const QJsonValue &v : array) {
if (!v.isObject())
return reportError(msgValueIsNotAObjectArray(DEPENDENCIES));
QJsonObject dependencyObject = v.toObject();
@@ -850,8 +850,8 @@ bool PluginSpecPrivate::readMetaData(const QJsonObject &pluginMetaData)
if (!value.isUndefined() && !value.isArray())
return reportError(msgValueIsNotAObjectArray(ARGUMENTS));
if (!value.isUndefined()) {
QJsonArray array = value.toArray();
foreach (const QJsonValue &v, array) {
const QJsonArray array = value.toArray();
for (const QJsonValue &v : array) {
if (!v.isObject())
return reportError(msgValueIsNotAObjectArray(ARGUMENTS));
QJsonObject argumentObject = v.toObject();
@@ -946,7 +946,7 @@ bool PluginSpecPrivate::resolveDependencies(const QVector<PluginSpec *> &specs)
return false;
}
QHash<PluginDependency, PluginSpec *> resolvedDependencies;
foreach (const PluginDependency &dependency, dependencies) {
for (const PluginDependency &dependency : qAsConst(dependencies)) {
PluginSpec * const found = Utils::findOrDefault(specs, [&dependency](PluginSpec *spec) {
return spec->provides(dependency.name, dependency.version);
});