summaryrefslogtreecommitdiff
path: root/src/libs/extensionsystem
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-12-07 01:01:14 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-12-07 09:28:32 +0000
commit36ffacabe7b6c105f037415b858fc6942624f5e0 (patch)
tree165ff5b83b7153f7879a227cdbf56de90d3a121d /src/libs/extensionsystem
parent0b9711b9c50494dda6627e2de894c42223229c9d (diff)
downloadqt-creator-36ffacabe7b6c105f037415b858fc6942624f5e0.tar.gz
ExtensionSystem: Fix some clazy warnings
Fix use multi-arg. Add a context object to lambda connections. Change-Id: I02711c9ecc55188fb174895f7df59f25effd0834 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/extensionsystem')
-rw-r--r--src/libs/extensionsystem/pluginmanager.cpp9
-rw-r--r--src/libs/extensionsystem/pluginspec.cpp2
-rw-r--r--src/libs/extensionsystem/pluginview.cpp24
3 files changed, 18 insertions, 17 deletions
diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp
index 5937a6d639..7b3da7e991 100644
--- a/src/libs/extensionsystem/pluginmanager.cpp
+++ b/src/libs/extensionsystem/pluginmanager.cpp
@@ -1419,11 +1419,12 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec,
spec->d->errorString += QLatin1Char('\n');
int index = circularityCheckQueue.indexOf(spec);
for (int i = index; i < circularityCheckQueue.size(); ++i) {
+ const PluginSpec *depSpec = circularityCheckQueue.at(i);
spec->d->errorString.append(PluginManager::tr("%1 (%2) depends on")
- .arg(circularityCheckQueue.at(i)->name()).arg(circularityCheckQueue.at(i)->version()));
+ .arg(depSpec->name(), depSpec->version()));
spec->d->errorString += QLatin1Char('\n');
}
- spec->d->errorString.append(PluginManager::tr("%1 (%2)").arg(spec->name()).arg(spec->version()));
+ spec->d->errorString.append(PluginManager::tr("%1 (%2)").arg(spec->name(), spec->version()));
return false;
}
circularityCheckQueue.append(spec);
@@ -1445,7 +1446,7 @@ bool PluginManagerPrivate::loadQueue(PluginSpec *spec,
spec->d->hasError = true;
spec->d->errorString =
PluginManager::tr("Cannot load plugin because dependency failed to load: %1 (%2)\nReason: %3")
- .arg(depSpec->name()).arg(depSpec->version()).arg(depSpec->errorString());
+ .arg(depSpec->name(), depSpec->version(), depSpec->errorString());
return false;
}
}
@@ -1593,7 +1594,7 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt
spec->d->hasError = true;
spec->d->errorString =
PluginManager::tr("Cannot load plugin because dependency failed to load: %1(%2)\nReason: %3")
- .arg(depSpec->name()).arg(depSpec->version()).arg(depSpec->errorString());
+ .arg(depSpec->name(), depSpec->version(), depSpec->errorString());
return;
}
}
diff --git a/src/libs/extensionsystem/pluginspec.cpp b/src/libs/extensionsystem/pluginspec.cpp
index 6287c882dc..9a7f19056d 100644
--- a/src/libs/extensionsystem/pluginspec.cpp
+++ b/src/libs/extensionsystem/pluginspec.cpp
@@ -1008,7 +1008,7 @@ bool PluginSpecPrivate::resolveDependencies(const QVector<PluginSpec *> &specs)
if (!errorString.isEmpty())
errorString.append(QLatin1Char('\n'));
errorString.append(QCoreApplication::translate("PluginSpec", "Could not resolve dependency '%1(%2)'")
- .arg(dependency.name).arg(dependency.version));
+ .arg(dependency.name, dependency.version));
}
continue;
}
diff --git a/src/libs/extensionsystem/pluginview.cpp b/src/libs/extensionsystem/pluginview.cpp
index f75849d359..a77800e766 100644
--- a/src/libs/extensionsystem/pluginview.cpp
+++ b/src/libs/extensionsystem/pluginview.cpp
@@ -303,10 +303,10 @@ PluginView::PluginView(QWidget *parent)
connect(PluginManager::instance(), &PluginManager::pluginsChanged,
this, &PluginView::updatePlugins);
- connect(m_categoryView, &QAbstractItemView::activated,
+ connect(m_categoryView, &QAbstractItemView::activated, this,
[this](const QModelIndex &idx) { emit pluginActivated(pluginForIndex(idx)); });
- connect(m_categoryView->selectionModel(), &QItemSelectionModel::currentChanged,
+ connect(m_categoryView->selectionModel(), &QItemSelectionModel::currentChanged, this,
[this](const QModelIndex &idx) { emit currentPluginChanged(pluginForIndex(idx)); });
updatePlugins();
@@ -385,12 +385,12 @@ bool PluginView::setPluginsEnabled(const QSet<PluginSpec *> &plugins, bool enabl
additionalPlugins.subtract(plugins);
if (!additionalPlugins.isEmpty()) {
if (QMessageBox::question(this, tr("Enabling Plugins"),
- tr("Enabling\n%1\nwill also enable the following plugins:\n\n%2")
- .arg(pluginListString(plugins))
- .arg(pluginListString(additionalPlugins)),
- QMessageBox::Ok | QMessageBox::Cancel,
- QMessageBox::Ok) != QMessageBox::Ok)
+ tr("Enabling\n%1\nwill also enable the following plugins:\n\n%2")
+ .arg(pluginListString(plugins), pluginListString(additionalPlugins)),
+ QMessageBox::Ok | QMessageBox::Cancel,
+ QMessageBox::Ok) != QMessageBox::Ok) {
return false;
+ }
}
} else {
for (PluginSpec *spec : plugins) {
@@ -402,12 +402,12 @@ bool PluginView::setPluginsEnabled(const QSet<PluginSpec *> &plugins, bool enabl
additionalPlugins.subtract(plugins);
if (!additionalPlugins.isEmpty()) {
if (QMessageBox::question(this, tr("Disabling Plugins"),
- tr("Disabling\n%1\nwill also disable the following plugins:\n\n%2")
- .arg(pluginListString(plugins))
- .arg(pluginListString(additionalPlugins)),
- QMessageBox::Ok | QMessageBox::Cancel,
- QMessageBox::Ok) != QMessageBox::Ok)
+ tr("Disabling\n%1\nwill also disable the following plugins:\n\n%2")
+ .arg(pluginListString(plugins), pluginListString(additionalPlugins)),
+ QMessageBox::Ok | QMessageBox::Cancel,
+ QMessageBox::Ok) != QMessageBox::Ok) {
return false;
+ }
}
}