ProjectExplorer: Let toolchains be (de)registered in bulk

When some code adds or removes a bunch of toolchains at once, that
should be made explicit and also be reflected by the respective signal
emissions.
Fix some leaks and typos along the way.

Change-Id: I4a1f12a2378316c5faf70e85a88adc467f076caf
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2024-07-18 11:10:24 +02:00
parent eb6c95b50d
commit 9d0c144892
13 changed files with 198 additions and 169 deletions

View File

@@ -217,7 +217,7 @@ void verifyIarToolchain(const McuToolchainPackagePtr &iarToolchainPackage)
Id iarId{BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID};
Toolchain *iarToolchain{ProjectExplorer::ToolchainFactory::createToolchain(iarId)};
iarToolchain->setLanguage(cxxLanguageId);
ToolchainManager::registerToolchain(iarToolchain);
ToolchainManager::registerToolchains({iarToolchain});
QVERIFY(iarToolchainPackage != nullptr);
QCOMPARE(iarToolchainPackage->cmakeVariableName(), TOOLCHAIN_DIR_CMAKE_VARIABLE);
@@ -241,7 +241,7 @@ void verifyArmGccToolchain(const McuToolchainPackagePtr &armGccPackage, const QS
Toolchain *armToolchain{ProjectExplorer::ToolchainFactory::createToolchain(armGccId)};
armToolchain->setLanguage(cxxLanguageId);
ToolchainManager::registerToolchain(armToolchain);
ToolchainManager::registerToolchains({armToolchain});
QVERIFY(armGccPackage != nullptr);
QCOMPARE(armGccPackage->cmakeVariableName(), TOOLCHAIN_DIR_CMAKE_VARIABLE);