ProjectExplorer: Use functor for ToolChain creation in ToolChainFactory

Change-Id: I935eecab2f16618a2a5b34d31a79672db82c3398
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-05-10 17:35:04 +02:00
parent 175018abe7
commit 728010a705
20 changed files with 37 additions and 195 deletions

View File

@@ -45,6 +45,7 @@ NimToolChainFactory::NimToolChainFactory()
setDisplayName(tr("Nim"));
setSupportedToolChainType(Constants::C_NIMTOOLCHAIN_TYPEID);
setSupportedLanguages({Constants::C_NIMLANGUAGE_ID});
setToolchainConstructor([] { return new NimToolChain; });
}
bool NimToolChainFactory::canCreate()
@@ -52,20 +53,6 @@ bool NimToolChainFactory::canCreate()
return true;
}
ToolChain *NimToolChainFactory::create()
{
return new NimToolChain;
}
ToolChain *NimToolChainFactory::restore(const QVariantMap &data)
{
auto tc = new NimToolChain;
if (tc->fromMap(data))
return tc;
delete tc;
return nullptr;
}
QList<ToolChain *> NimToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
{
QList<ToolChain *> result;