forked from qt-creator/qt-creator
ProjectExplorer: Use functor for ToolChain creation in ToolChainFactory
Change-Id: I935eecab2f16618a2a5b34d31a79672db82c3398 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user