forked from qt-creator/qt-creator
ProjectExplorer: Drop Detection argument from ToolChain constructor
This was used wildly inconsistently. Use a setter instead in circumstances where the context is reasonably clear. The assumption is that this will always be done at some time in all code paths. Use a new 'Uninitialized' value to avoid triggering the first update. Change-Id: I82c38cb9da3ccdbd8fbae8beefcbfa0e559ff794 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -54,12 +54,12 @@ bool NimToolChainFactory::canCreate()
|
||||
|
||||
ToolChain *NimToolChainFactory::create()
|
||||
{
|
||||
return new NimToolChain(ToolChain::ManualDetection);
|
||||
return new NimToolChain;
|
||||
}
|
||||
|
||||
ToolChain *NimToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
auto tc = new NimToolChain(ToolChain::AutoDetection);
|
||||
auto tc = new NimToolChain;
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
delete tc;
|
||||
@@ -83,7 +83,8 @@ QList<ToolChain *> NimToolChainFactory::autoDetect(const QList<ToolChain *> &alr
|
||||
if (!result.empty())
|
||||
return result;
|
||||
|
||||
auto tc = new NimToolChain(ToolChain::AutoDetection);
|
||||
auto tc = new NimToolChain;
|
||||
tc->setDetection(ToolChain::AutoDetection);
|
||||
tc->setCompilerCommand(compilerPath);
|
||||
result.append(tc);
|
||||
return result;
|
||||
@@ -93,7 +94,8 @@ QList<ToolChain *> NimToolChainFactory::autoDetect(const FileName &compilerPath,
|
||||
{
|
||||
QList<ToolChain *> result;
|
||||
if (language == Constants::C_NIMLANGUAGE_ID) {
|
||||
auto tc = new NimToolChain(ToolChain::ManualDetection);
|
||||
auto tc = new NimToolChain;
|
||||
tc->setDetection(ToolChain::ManualDetection); // FIXME: sure?
|
||||
tc->setCompilerCommand(compilerPath);
|
||||
result.append(tc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user