diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index b567d753250..45b9807958e 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -10,6 +10,17 @@ #include "pluginspec.h" #include "pluginspec_p.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include @@ -23,23 +34,12 @@ #include #include #include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #ifdef WITH_TESTS #include #include @@ -1268,8 +1268,7 @@ void PluginManagerPrivate::startTests() continue; // plugin not loaded const QVector testObjects = plugin->createTestObjects(); - ExecuteOnDestruction deleteTestObjects([&]() { qDeleteAll(testObjects); }); - Q_UNUSED(deleteTestObjects) + const QScopeGuard cleanup([&] { qDeleteAll(testObjects); }); const bool hasDuplicateTestObjects = testObjects.size() != Utils::filteredUnique(testObjects).size(); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index d3a74d5d304..dffa503c456 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -110,6 +110,7 @@ #include #include #include +#include #include #include #include @@ -125,8 +126,6 @@ #include #include -#include - #include #include #include @@ -2338,7 +2337,7 @@ void DebuggerUnitTests::testStateMachine() BuildManager::buildProjectWithDependencies(ProjectManager::startupProject()); loop.exec(); - ExecuteOnDestruction guard([] { EditorManager::closeAllEditors(false); }); + const QScopeGuard cleanup([] { EditorManager::closeAllEditors(false); }); RunConfiguration *rc = ProjectManager::startupRunConfiguration(); QVERIFY(rc); diff --git a/src/plugins/marketplace/productlistmodel.cpp b/src/plugins/marketplace/productlistmodel.cpp index 36b047abc21..1de5a4b833d 100644 --- a/src/plugins/marketplace/productlistmodel.cpp +++ b/src/plugins/marketplace/productlistmodel.cpp @@ -4,7 +4,6 @@ #include "productlistmodel.h" #include -#include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -107,7 +107,7 @@ void SectionedProducts::updateCollections() void SectionedProducts::onFetchCollectionsFinished(QNetworkReply *reply) { QTC_ASSERT(reply, return); - Utils::ExecuteOnDestruction replyDeleter([reply]() { reply->deleteLater(); }); + const QScopeGuard cleanup([reply] { reply->deleteLater(); }); if (reply->error() == QNetworkReply::NoError) { const QJsonDocument doc = QJsonDocument::fromJson(reply->readAll()); @@ -141,7 +141,7 @@ void SectionedProducts::onFetchSingleCollectionFinished(QNetworkReply *reply) emit toggleProgressIndicator(false); QTC_ASSERT(reply, return); - Utils::ExecuteOnDestruction replyDeleter([reply]() { reply->deleteLater(); }); + const QScopeGuard cleanup([reply] { reply->deleteLater(); }); QList productsForCollection; if (reply->error() == QNetworkReply::NoError) { @@ -259,7 +259,7 @@ void SectionedProducts::fetchNextImage() void SectionedProducts::onImageDownloadFinished(QNetworkReply *reply) { QTC_ASSERT(reply, return); - Utils::ExecuteOnDestruction replyDeleter([reply]() { reply->deleteLater(); }); + const QScopeGuard cleanup([reply] { reply->deleteLater(); }); if (reply->error() == QNetworkReply::NoError) { const QByteArray data = reply->readAll(); diff --git a/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp b/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp index 2ab532cd569..30808887803 100644 --- a/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp +++ b/src/plugins/qmakeprojectmanager/profilehoverhandler.cpp @@ -8,8 +8,8 @@ #include #include #include -#include +#include #include #include @@ -28,7 +28,7 @@ void ProFileHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidg int pos, ReportPriority report) { - ExecuteOnDestruction reportPriority([this, report](){ report(priority()); }); + const QScopeGuard cleanup([this, report] { report(priority()); }); m_docFragment.clear(); m_manualKind = UnknownManual; diff --git a/src/plugins/qmljseditor/qmljshoverhandler.cpp b/src/plugins/qmljseditor/qmljshoverhandler.cpp index 72b9c73869d..3f7d3a5c110 100644 --- a/src/plugins/qmljseditor/qmljshoverhandler.cpp +++ b/src/plugins/qmljseditor/qmljshoverhandler.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -31,6 +30,7 @@ #include #include #include +#include using namespace Core; using namespace QmlJS; @@ -175,7 +175,7 @@ bool QmlJSHoverHandler::setQmlTypeHelp(const ScopeChain &scopeChain, const Docum void QmlJSHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos, ReportPriority report) { - Utils::ExecuteOnDestruction reportPriority([this, report](){ report(priority()); }); + const QScopeGuard cleanup([this, report] { report(priority()); }); reset(); diff --git a/src/plugins/squish/squishrunnerprocess.cpp b/src/plugins/squish/squishrunnerprocess.cpp index ca1e330a7c3..fbbf7a57b3a 100644 --- a/src/plugins/squish/squishrunnerprocess.cpp +++ b/src/plugins/squish/squishrunnerprocess.cpp @@ -6,9 +6,9 @@ #include "squishtr.h" #include -#include #include +#include Q_LOGGING_CATEGORY(runnerLOG, "qtc.squish.squishrunner", QtWarningMsg) @@ -153,7 +153,7 @@ void SquishRunnerProcess::onStdOutput(const QString &lineIn) void SquishRunnerProcess::handleMultiLineOutput(OutputMode mode) { - Utils::ExecuteOnDestruction atExit([this]{ + const QScopeGuard cleanup([this] { m_multiLineContent.clear(); m_context.clear(); });