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

@@ -343,7 +343,7 @@ private:
void onKitsLoaded() override;
void toolChainUpdated(Toolchain *tc);
void toolChainRemoved(Toolchain *tc);
void toolChainsDeregistered();
};
ToolchainKitAspectFactory::ToolchainKitAspectFactory()
@@ -695,8 +695,8 @@ void ToolchainKitAspectFactory::onKitsLoaded()
for (Kit *k : KitManager::kits())
fix(k);
connect(ToolchainManager::instance(), &ToolchainManager::toolchainRemoved,
this, &ToolchainKitAspectFactory::toolChainRemoved);
connect(ToolchainManager::instance(), &ToolchainManager::toolchainsDeregistered,
this, &ToolchainKitAspectFactory::toolChainsDeregistered);
connect(ToolchainManager::instance(), &ToolchainManager::toolchainUpdated,
this, &ToolchainKitAspectFactory::toolChainUpdated);
}
@@ -709,9 +709,8 @@ void ToolchainKitAspectFactory::toolChainUpdated(Toolchain *tc)
}
}
void ToolchainKitAspectFactory::toolChainRemoved(Toolchain *tc)
void ToolchainKitAspectFactory::toolChainsDeregistered()
{
Q_UNUSED(tc)
for (Kit *k : KitManager::kits())
fix(k);
}