aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-12-18 16:26:23 +0100
committerhjk <hjk@qt.io>2024-01-17 15:18:41 +0000
commitf5d4d331c402519877279b753f705014c11824c5 (patch)
tree4d4109ca814ee10a47f4af78e83dd60d0cd1da7d
parent164a6e7447bd94a3dbe89dd90d005964db61e29d (diff)
Make some more capturelists friendlier for C++20
Change-Id: Ic00f75e1f59f5eb0430d24e4448a3bb7f8bfbd8d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp2
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp2
-rw-r--r--src/libs/qmljs/qmljsplugindumper.cpp15
3 files changed, 11 insertions, 8 deletions
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp
index e1f0465573..c1335789dc 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/definitiondownloader.cpp
@@ -174,7 +174,7 @@ void DefinitionDownloader::start()
auto req = QNetworkRequest(QUrl(url));
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, QNetworkRequest::NoLessSafeRedirectPolicy);
auto reply = d->nam->get(req);
- QObject::connect(reply, &QNetworkReply::finished, this, [=]() {
+ QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]() {
d->definitionListDownloadFinished(reply);
});
}
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
index ded52610b4..7c160a796a 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -1420,7 +1420,7 @@ void ModelManagerInterface::maybeQueueCppQmlTypeUpdate(const CPlusPlus::Document
QMutexLocker locker(&g_instanceMutex);
if (g_instance) // delegate actual queuing to the gui thread
- QMetaObject::invokeMethod(g_instance, [=] { queueCppQmlTypeUpdate(doc, scan); });
+ QMetaObject::invokeMethod(g_instance, [this, doc, scan] { queueCppQmlTypeUpdate(doc, scan); });
}
void ModelManagerInterface::queueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc, bool scan)
diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp
index 04913de3dd..d2407bb113 100644
--- a/src/libs/qmljs/qmljsplugindumper.cpp
+++ b/src/libs/qmljs/qmljsplugindumper.cpp
@@ -46,7 +46,7 @@ Utils::FileSystemWatcher *PluginDumper::pluginWatcher()
void PluginDumper::loadBuiltinTypes(const QmlJS::ModelManagerInterface::ProjectInfo &info)
{
// move to the owning thread
- metaObject()->invokeMethod(this, [=] { onLoadBuiltinTypes(info); });
+ metaObject()->invokeMethod(this, [this, info] { onLoadBuiltinTypes(info); });
}
void PluginDumper::loadPluginTypes(const Utils::FilePath &libraryPath,
@@ -55,8 +55,9 @@ void PluginDumper::loadPluginTypes(const Utils::FilePath &libraryPath,
const QString &importVersion)
{
// move to the owning thread
- metaObject()->invokeMethod(this, [=] { onLoadPluginTypes(libraryPath, importPath,
- importUri, importVersion); });
+ metaObject()->invokeMethod(this, [this, libraryPath, importPath, importUri, importVersion] {
+ onLoadPluginTypes(libraryPath, importPath, importUri, importVersion);
+ });
}
void PluginDumper::scheduleRedumpPlugins()
@@ -424,7 +425,8 @@ QFuture<PluginDumper::DependencyInfo> PluginDumper::loadDependencies(const FileP
visited->insert(name);
}
- Utils::onFinished(loadQmlTypeDescription(dependenciesPaths), const_cast<PluginDumper*>(this), [=] (const QFuture<PluginDumper::QmlTypeDescription> &typesFuture) {
+ Utils::onFinished(loadQmlTypeDescription(dependenciesPaths), const_cast<PluginDumper*>(this),
+ [this, iface, visited](const QFuture<PluginDumper::QmlTypeDescription> &typesFuture) {
PluginDumper::QmlTypeDescription typesResult = typesFuture.result();
FilePaths newDependencies = FileUtils::toFilePathList(typesResult.dependencies);
@@ -560,8 +562,9 @@ void PluginDumper::loadQmltypesFile(const FilePaths &qmltypesFilePaths,
const FilePath &libraryPath,
QmlJS::LibraryInfo libraryInfo)
{
- Utils::onFinished(loadQmlTypeDescription(qmltypesFilePaths), this, [=](const QFuture<PluginDumper::QmlTypeDescription> &typesFuture)
- {
+ Utils::onFinished(loadQmlTypeDescription(qmltypesFilePaths), this,
+ [this, qmltypesFilePaths, libraryPath, libraryInfo]
+ (const QFuture<PluginDumper::QmlTypeDescription> &typesFuture) {
PluginDumper::QmlTypeDescription typesResult = typesFuture.result();
if (!typesResult.dependencies.isEmpty())
{