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:
@@ -156,6 +156,7 @@ AndroidToolChainFactory::AndroidToolChainFactory()
|
||||
setDisplayName(tr("Android Clang"));
|
||||
setSupportedToolChainType(Constants::ANDROID_TOOLCHAIN_ID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new AndroidToolChain; });
|
||||
}
|
||||
|
||||
ToolChainList AndroidToolChainFactory::autoDetect(CToolChainList &alreadyKnown)
|
||||
@@ -163,16 +164,6 @@ ToolChainList AndroidToolChainFactory::autoDetect(CToolChainList &alreadyKnown)
|
||||
return autodetectToolChainsForNdk(alreadyKnown);
|
||||
}
|
||||
|
||||
ToolChain *AndroidToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
auto tc = new AndroidToolChain();
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
|
||||
delete tc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static FileName clangPlusPlusPath(const FileName &clangPath)
|
||||
{
|
||||
return clangPath.parentDir().appendPath(
|
||||
|
||||
@@ -66,7 +66,6 @@ public:
|
||||
AndroidToolChainFactory();
|
||||
|
||||
ToolChainList autoDetect(CToolChainList &alreadyKnown) override;
|
||||
ProjectExplorer::ToolChain *restore(const QVariantMap &data) override;
|
||||
|
||||
class AndroidToolChainInformation
|
||||
{
|
||||
|
||||
@@ -401,6 +401,7 @@ IarToolChainFactory::IarToolChainFactory()
|
||||
setSupportedToolChainType(Constants::IAREW_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new IarToolChain; });
|
||||
}
|
||||
|
||||
QList<ToolChain *> IarToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
@@ -464,21 +465,6 @@ bool IarToolChainFactory::canCreate()
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain *IarToolChainFactory::create()
|
||||
{
|
||||
return new IarToolChain;
|
||||
}
|
||||
|
||||
ToolChain *IarToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
const auto tc = new IarToolChain;
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
|
||||
delete tc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<ToolChain *> IarToolChainFactory::autoDetectToolchains(
|
||||
const Candidates &candidates, const QList<ToolChain *> &alreadyKnown) const
|
||||
{
|
||||
|
||||
@@ -105,15 +105,12 @@ class IarToolChainFactory final : public ProjectExplorer::ToolChainFactory
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit IarToolChainFactory();
|
||||
IarToolChainFactory();
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> autoDetect(
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown) final;
|
||||
|
||||
bool canCreate() final;
|
||||
ProjectExplorer::ToolChain *create() final;
|
||||
|
||||
ProjectExplorer::ToolChain *restore(const QVariantMap &data) final;
|
||||
|
||||
private:
|
||||
QList<ProjectExplorer::ToolChain *> autoDetectToolchains(const Candidates &candidates,
|
||||
|
||||
@@ -406,6 +406,7 @@ KeilToolchainFactory::KeilToolchainFactory()
|
||||
setSupportedToolChainType(Constants::KEIL_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID,
|
||||
ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new KeilToolchain; });
|
||||
}
|
||||
|
||||
QList<ToolChain *> KeilToolchainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
@@ -463,21 +464,6 @@ bool KeilToolchainFactory::canCreate()
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain *KeilToolchainFactory::create()
|
||||
{
|
||||
return new KeilToolchain;
|
||||
}
|
||||
|
||||
ToolChain *KeilToolchainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
const auto tc = new KeilToolchain;
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
|
||||
delete tc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<ToolChain *> KeilToolchainFactory::autoDetectToolchains(
|
||||
const Candidates &candidates, const QList<ToolChain *> &alreadyKnown) const
|
||||
{
|
||||
|
||||
@@ -105,15 +105,12 @@ class KeilToolchainFactory final : public ProjectExplorer::ToolChainFactory
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit KeilToolchainFactory();
|
||||
KeilToolchainFactory();
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> autoDetect(
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown) final;
|
||||
|
||||
bool canCreate() final;
|
||||
ProjectExplorer::ToolChain *create() final;
|
||||
|
||||
ProjectExplorer::ToolChain *restore(const QVariantMap &data) final;
|
||||
|
||||
private:
|
||||
QList<ProjectExplorer::ToolChain *> autoDetectToolchains(const Candidates &candidates,
|
||||
|
||||
@@ -390,6 +390,7 @@ SdccToolChainFactory::SdccToolChainFactory()
|
||||
setDisplayName(tr("SDCC"));
|
||||
setSupportedToolChainType(Constants::SDCC_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::C_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new SdccToolChain; });
|
||||
}
|
||||
|
||||
QList<ToolChain *> SdccToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
@@ -440,21 +441,6 @@ bool SdccToolChainFactory::canCreate()
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain *SdccToolChainFactory::create()
|
||||
{
|
||||
return new SdccToolChain;
|
||||
}
|
||||
|
||||
ToolChain *SdccToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
const auto tc = new SdccToolChain;
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
|
||||
delete tc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QList<ToolChain *> SdccToolChainFactory::autoDetectToolchains(
|
||||
const Candidates &candidates, const QList<ToolChain *> &alreadyKnown) const
|
||||
{
|
||||
|
||||
@@ -111,9 +111,6 @@ public:
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown) final;
|
||||
|
||||
bool canCreate() final;
|
||||
ProjectExplorer::ToolChain *create() final;
|
||||
|
||||
ProjectExplorer::ToolChain *restore(const QVariantMap &data) final;
|
||||
|
||||
private:
|
||||
QList<ProjectExplorer::ToolChain *> autoDetectToolchains(const Candidates &candidates,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -42,8 +42,7 @@ public:
|
||||
NimToolChainFactory();
|
||||
|
||||
bool canCreate() final;
|
||||
ProjectExplorer::ToolChain *create() final;
|
||||
ProjectExplorer::ToolChain *restore(const QVariantMap &data) final;
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> autoDetect(const QList<ProjectExplorer::ToolChain *> &alreadyKnown) final;
|
||||
QList<ProjectExplorer::ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) final;
|
||||
};
|
||||
|
||||
@@ -421,6 +421,7 @@ CustomToolChainFactory::CustomToolChainFactory()
|
||||
setDisplayName(tr("Custom"));
|
||||
setSupportedToolChainType(Constants::CUSTOM_TOOLCHAIN_TYPEID);
|
||||
setSupportsAllLanguages(true);
|
||||
setToolchainConstructor([] { return new CustomToolChain; });
|
||||
}
|
||||
|
||||
bool CustomToolChainFactory::canCreate()
|
||||
@@ -428,21 +429,6 @@ bool CustomToolChainFactory::canCreate()
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain *CustomToolChainFactory::create()
|
||||
{
|
||||
return new CustomToolChain;
|
||||
}
|
||||
|
||||
ToolChain *CustomToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
auto tc = new CustomToolChain;
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
|
||||
delete tc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Helper for ConfigWidget
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@@ -145,9 +145,6 @@ public:
|
||||
CustomToolChainFactory();
|
||||
|
||||
bool canCreate() override;
|
||||
ToolChain *create() override;
|
||||
|
||||
ToolChain *restore(const QVariantMap &data) override;
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
@@ -877,6 +877,7 @@ GccToolChainFactory::GccToolChainFactory()
|
||||
setDisplayName(tr("GCC"));
|
||||
setSupportedToolChainType(Constants::GCC_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new GccToolChain; });
|
||||
}
|
||||
|
||||
bool GccToolChainFactory::canCreate()
|
||||
@@ -884,11 +885,6 @@ bool GccToolChainFactory::canCreate()
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain *GccToolChainFactory::create()
|
||||
{
|
||||
return createToolChain();
|
||||
}
|
||||
|
||||
QList<ToolChain *> GccToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
{
|
||||
QList<ToolChain *> tcs;
|
||||
@@ -918,21 +914,6 @@ QList<ToolChain *> GccToolChainFactory::autoDetect(const FileName &compilerPath,
|
||||
return QList<ToolChain *>();
|
||||
}
|
||||
|
||||
ToolChain *GccToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
GccToolChain *tc = createToolChain();
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
|
||||
delete tc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GccToolChain *GccToolChainFactory::createToolChain()
|
||||
{
|
||||
return new GccToolChain;
|
||||
}
|
||||
|
||||
Utils::FileName GccToolChainFactory::compilerPathFromEnvironment(const QString &compilerName)
|
||||
{
|
||||
Environment systemEnvironment = Environment::systemEnvironment();
|
||||
@@ -1039,7 +1020,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolChain(const FileName &comp
|
||||
systemEnvironment.toStringList(),
|
||||
macros);
|
||||
for (const Abi &abi : detectedAbis.supportedAbis) {
|
||||
std::unique_ptr<GccToolChain> tc(createToolChain());
|
||||
std::unique_ptr<GccToolChain> tc(dynamic_cast<GccToolChain *>(create()));
|
||||
if (!tc)
|
||||
return result;
|
||||
|
||||
@@ -1491,6 +1472,7 @@ ClangToolChainFactory::ClangToolChainFactory()
|
||||
setDisplayName(tr("Clang"));
|
||||
setSupportedToolChainType(Constants::CLANG_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new ClangToolChain; });
|
||||
}
|
||||
|
||||
QList<ToolChain *> ClangToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
@@ -1525,11 +1507,6 @@ QList<ToolChain *> ClangToolChainFactory::autoDetect(const FileName &compilerPat
|
||||
return QList<ToolChain *>();
|
||||
}
|
||||
|
||||
GccToolChain *ClangToolChainFactory::createToolChain()
|
||||
{
|
||||
return new ClangToolChain;
|
||||
}
|
||||
|
||||
ClangToolChainConfigWidget::ClangToolChainConfigWidget(ClangToolChain *tc) :
|
||||
GccToolChainConfigWidget(tc)
|
||||
{
|
||||
@@ -1700,6 +1677,7 @@ MingwToolChainFactory::MingwToolChainFactory()
|
||||
setDisplayName(tr("MinGW"));
|
||||
setSupportedToolChainType(Constants::MINGW_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new MingwToolChain; });
|
||||
}
|
||||
|
||||
QList<ToolChain *> MingwToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
@@ -1730,11 +1708,6 @@ QList<ToolChain *> MingwToolChainFactory::autoDetect(const FileName &compilerPat
|
||||
return QList<ToolChain *>();
|
||||
}
|
||||
|
||||
GccToolChain *MingwToolChainFactory::createToolChain()
|
||||
{
|
||||
return new MingwToolChain;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// LinuxIccToolChain
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -1795,6 +1768,7 @@ LinuxIccToolChainFactory::LinuxIccToolChainFactory()
|
||||
setDisplayName(tr("Linux ICC"));
|
||||
setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new LinuxIccToolChain; });
|
||||
}
|
||||
|
||||
QList<ToolChain *> LinuxIccToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||
@@ -1816,11 +1790,6 @@ QList<ToolChain *> LinuxIccToolChainFactory::autoDetect(const FileName &compiler
|
||||
return {};
|
||||
}
|
||||
|
||||
GccToolChain *LinuxIccToolChainFactory::createToolChain()
|
||||
{
|
||||
return new LinuxIccToolChain;
|
||||
}
|
||||
|
||||
GccToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, WarningFlags &flags) :
|
||||
m_flags(flags)
|
||||
{
|
||||
|
||||
@@ -58,13 +58,8 @@ public:
|
||||
QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) override;
|
||||
|
||||
bool canCreate() override;
|
||||
ToolChain *create() override;
|
||||
|
||||
ToolChain *restore(const QVariantMap &data) override;
|
||||
|
||||
protected:
|
||||
virtual GccToolChain *createToolChain();
|
||||
|
||||
Utils::FileName compilerPathFromEnvironment(const QString &compilerName);
|
||||
|
||||
enum class DetectVariants { Yes, No };
|
||||
@@ -148,9 +143,6 @@ public:
|
||||
|
||||
QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override;
|
||||
QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) final;
|
||||
|
||||
protected:
|
||||
GccToolChain *createToolChain() override;
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -166,9 +158,6 @@ public:
|
||||
|
||||
QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override;
|
||||
QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) final;
|
||||
|
||||
protected:
|
||||
GccToolChain *createToolChain() override;
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
@@ -184,9 +173,6 @@ public:
|
||||
|
||||
QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override;
|
||||
QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) final;
|
||||
|
||||
protected:
|
||||
GccToolChain *createToolChain() override;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -1695,6 +1695,7 @@ MsvcToolChainFactory::MsvcToolChainFactory()
|
||||
setDisplayName(tr("MSVC"));
|
||||
setSupportedToolChainType(Constants::MSVC_TOOLCHAIN_TYPEID);
|
||||
setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new MsvcToolChain; });
|
||||
}
|
||||
|
||||
QString MsvcToolChainFactory::vcVarsBatFor(const QString &basePath,
|
||||
@@ -1874,6 +1875,7 @@ ClangClToolChainFactory::ClangClToolChainFactory()
|
||||
setDisplayName(tr("clang-cl"));
|
||||
setSupportedLanguages({Constants::C_LANGUAGE_ID, Constants::CXX_LANGUAGE_ID});
|
||||
setSupportedToolChainType(Constants::CLANG_CL_TOOLCHAIN_TYPEID);
|
||||
setToolchainConstructor([] { return new ClangClToolChain; });
|
||||
}
|
||||
|
||||
bool ClangClToolChainFactory::canCreate()
|
||||
@@ -2038,26 +2040,6 @@ Utils::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils:
|
||||
return Utils::nullopt;
|
||||
}
|
||||
|
||||
template<class ToolChainType>
|
||||
ToolChainType *readFromMap(const QVariantMap &data)
|
||||
{
|
||||
auto result = new ToolChainType;
|
||||
if (result->fromMap(data))
|
||||
return result;
|
||||
delete result;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ToolChain *MsvcToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
return readFromMap<MsvcToolChain>(data);
|
||||
}
|
||||
|
||||
ToolChain *ClangClToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
return readFromMap<ClangClToolChain>(data);
|
||||
}
|
||||
|
||||
MsvcToolChain::WarningFlagAdder::WarningFlagAdder(const QString &flag, WarningFlags &flags)
|
||||
: m_flags(flags)
|
||||
{
|
||||
|
||||
@@ -225,8 +225,6 @@ public:
|
||||
|
||||
QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override;
|
||||
|
||||
ToolChain *restore(const QVariantMap &data) override;
|
||||
|
||||
static QString vcVarsBatFor(const QString &basePath,
|
||||
MsvcToolChain::Platform platform,
|
||||
const QVersionNumber &v);
|
||||
@@ -241,8 +239,6 @@ public:
|
||||
|
||||
QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override;
|
||||
|
||||
ToolChain *restore(const QVariantMap &data) override;
|
||||
|
||||
bool canCreate() override;
|
||||
ToolChain *create() override;
|
||||
};
|
||||
|
||||
@@ -445,11 +445,21 @@ bool ToolChainFactory::canCreate()
|
||||
|
||||
ToolChain *ToolChainFactory::create()
|
||||
{
|
||||
return nullptr;
|
||||
return m_toolchainConstructor ? m_toolchainConstructor() : nullptr;
|
||||
}
|
||||
|
||||
ToolChain *ToolChainFactory::restore(const QVariantMap &)
|
||||
ToolChain *ToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
if (!m_toolchainConstructor)
|
||||
return nullptr;
|
||||
|
||||
ToolChain *tc = m_toolchainConstructor();
|
||||
QTC_ASSERT(tc, return nullptr);
|
||||
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
|
||||
delete tc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -501,4 +511,10 @@ void ToolChainFactory::setSupportsAllLanguages(bool supportsAllLanguages)
|
||||
m_supportsAllLanguages = supportsAllLanguages;
|
||||
}
|
||||
|
||||
void ToolChainFactory::setToolchainConstructor
|
||||
(const std::function<ToolChain *()> &toolchainContructor)
|
||||
{
|
||||
m_toolchainConstructor = toolchainContructor;
|
||||
}
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -212,6 +212,7 @@ protected:
|
||||
void setSupportedToolChainType(const Core::Id &supportedToolChainType);
|
||||
void setSupportedLanguages(const QSet<Core::Id> &supportedLanguages);
|
||||
void setSupportsAllLanguages(bool supportsAllLanguages);
|
||||
void setToolchainConstructor(const std::function<ToolChain *()> &constructor);
|
||||
|
||||
class Candidate {
|
||||
public:
|
||||
@@ -231,6 +232,7 @@ private:
|
||||
Core::Id m_supportedToolChainType;
|
||||
QSet<Core::Id> m_supportedLanguages;
|
||||
bool m_supportsAllLanguages = false;
|
||||
std::function<ToolChain *()> m_toolchainConstructor;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -208,6 +208,7 @@ QnxToolChainFactory::QnxToolChainFactory()
|
||||
setDisplayName(tr("QCC"));
|
||||
setSupportedToolChainType(Constants::QNX_TOOLCHAIN_ID);
|
||||
setSupportedLanguages({ProjectExplorer::Constants::CXX_LANGUAGE_ID});
|
||||
setToolchainConstructor([] { return new QnxToolChain; });
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> QnxToolChainFactory::autoDetect(
|
||||
@@ -221,26 +222,11 @@ QList<ProjectExplorer::ToolChain *> QnxToolChainFactory::autoDetect(
|
||||
return tcs;
|
||||
}
|
||||
|
||||
ToolChain *QnxToolChainFactory::restore(const QVariantMap &data)
|
||||
{
|
||||
auto tc = new QnxToolChain;
|
||||
if (tc->fromMap(data))
|
||||
return tc;
|
||||
|
||||
delete tc;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool QnxToolChainFactory::canCreate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ToolChain *QnxToolChainFactory::create()
|
||||
{
|
||||
return new QnxToolChain;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// QnxToolChainConfigWidget
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
@@ -75,10 +75,7 @@ public:
|
||||
QList<ProjectExplorer::ToolChain *> autoDetect(
|
||||
const QList<ProjectExplorer::ToolChain *> &alreadyKnown) override;
|
||||
|
||||
ProjectExplorer::ToolChain *restore(const QVariantMap &data) override;
|
||||
|
||||
bool canCreate() override;
|
||||
ProjectExplorer::ToolChain *create() override;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user