Commit c275dac0 authored by Tobias Hunger's avatar Tobias Hunger

Rename toolchain type constants in ProjectExplorer

Change-Id: I56f5b7373846bb091456c050eb1ff3495ca2dd72
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent e6d1141e
......@@ -711,7 +711,7 @@ bool CompilerOptionsBuilder::excludeDefineLine(const QByteArray &defineLine) con
// The right-hand sides are gcc built-ins that clang does not understand, and they'd
// override clang's own (non-macro, it seems) definitions of the symbols on the left-hand
// side.
const bool isGccToolchain = m_projectPart->toolchainType == ProjectExplorer::Constants::GCC_TOOLCHAIN_ID;
const bool isGccToolchain = m_projectPart->toolchainType == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID;
if (isGccToolchain && defineLine.contains("has_include"))
return true;
......
......@@ -201,8 +201,8 @@ QStringList IosBuildStep::defaultArguments() const
qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
<< target()->activeBuildConfiguration()->buildType();
}
if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_ID
|| tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_ID) {
if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID
|| tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) {
GccToolChain *gtc = static_cast<GccToolChain *>(tc);
res << gtc->platformCodeGenFlags();
}
......
......@@ -100,8 +100,8 @@ void IosConfigurations::updateAutomaticKitList()
foreach (ToolChain *tc, ToolChainManager::toolChains()) {
if (!tc->isAutoDetected()) // use also user toolchains?
continue;
if (tc->typeId() != ProjectExplorer::Constants::CLANG_TOOLCHAIN_ID
&& tc->typeId() != ProjectExplorer::Constants::GCC_TOOLCHAIN_ID)
if (tc->typeId() != ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID
&& tc->typeId() != ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID)
continue;
GccToolChain *toolchain = static_cast<GccToolChain *>(tc);
QMapIterator<QString, Platform> iter(platforms);
......@@ -158,7 +158,7 @@ void IosConfigurations::updateAutomaticKitList()
if (p.compilerPath.toFileInfo().baseName().startsWith(QLatin1String("clang")))
toolchain = new ClangToolChain(ToolChain::AutoDetection);
else
toolchain = new GccToolChain(ProjectExplorer::Constants::GCC_TOOLCHAIN_ID,
toolchain = new GccToolChain(ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID,
ToolChain::AutoDetection);
QString baseDisplayName = p.name;
QString displayName = baseDisplayName;
......
......@@ -78,7 +78,7 @@ static const char messageCapKeyC[] = "ProjectExplorer.CustomToolChain.MessageCap
// --------------------------------------------------------------------------
CustomToolChain::CustomToolChain(Detection d) :
ToolChain(Constants::CUSTOM_TOOLCHAIN_ID, d),
ToolChain(Constants::CUSTOM_TOOLCHAIN_TYPEID, d),
m_outputParser(Gcc)
{ }
......@@ -372,7 +372,7 @@ namespace Internal {
CustomToolChainFactory::CustomToolChainFactory()
{
setTypeId(Constants::CUSTOM_TOOLCHAIN_ID);
setTypeId(Constants::CUSTOM_TOOLCHAIN_TYPEID);
setDisplayName(tr("Custom"));
}
......@@ -389,7 +389,7 @@ ToolChain *CustomToolChainFactory::create()
// Used by the ToolChainManager to restore user-generated tool chains
bool CustomToolChainFactory::canRestore(const QVariantMap &data)
{
return typeIdFromMap(data) == Constants::CUSTOM_TOOLCHAIN_ID;
return typeIdFromMap(data) == Constants::CUSTOM_TOOLCHAIN_TYPEID;
}
ToolChain *CustomToolChainFactory::restore(const QVariantMap &data)
......
......@@ -245,7 +245,7 @@ static QString gccVersion(const FileName &path, const QStringList &env)
// --------------------------------------------------------------------------
GccToolChain::GccToolChain(Detection d) :
ToolChain(Constants::GCC_TOOLCHAIN_ID, d)
ToolChain(Constants::GCC_TOOLCHAIN_TYPEID, d)
{ }
GccToolChain::GccToolChain(Core::Id typeId, Detection d) :
......@@ -760,7 +760,7 @@ QString GccToolChain::detectVersion() const
GccToolChainFactory::GccToolChainFactory()
{
setTypeId(Constants::GCC_TOOLCHAIN_ID);
setTypeId(Constants::GCC_TOOLCHAIN_TYPEID);
setDisplayName(tr("GCC"));
}
......@@ -790,7 +790,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetect()
// Used by the ToolChainManager to restore user-generated tool chains
bool GccToolChainFactory::canRestore(const QVariantMap &data)
{
return typeIdFromMap(data) == Constants::GCC_TOOLCHAIN_ID;
return typeIdFromMap(data) == Constants::GCC_TOOLCHAIN_TYPEID;
}
ToolChain *GccToolChainFactory::restore(const QVariantMap &data)
......@@ -1008,7 +1008,7 @@ void GccToolChainConfigWidget::handlePlatformLinkerFlagsChange()
// --------------------------------------------------------------------------
ClangToolChain::ClangToolChain(Detection d) :
GccToolChain(Constants::CLANG_TOOLCHAIN_ID, d)
GccToolChain(Constants::CLANG_TOOLCHAIN_TYPEID, d)
{ }
QString ClangToolChain::typeDisplayName() const
......@@ -1107,7 +1107,7 @@ ToolChain *ClangToolChain::clone() const
ClangToolChainFactory::ClangToolChainFactory()
{
setDisplayName(tr("Clang"));
setTypeId(Constants::CLANG_TOOLCHAIN_ID);
setTypeId(Constants::CLANG_TOOLCHAIN_TYPEID);
}
QList<ToolChain *> ClangToolChainFactory::autoDetect()
......@@ -1128,7 +1128,7 @@ ToolChain *ClangToolChainFactory::create()
bool ClangToolChainFactory::canRestore(const QVariantMap &data)
{
return typeIdFromMap(data) == Constants::CLANG_TOOLCHAIN_ID;
return typeIdFromMap(data) == Constants::CLANG_TOOLCHAIN_TYPEID;
}
ToolChain *ClangToolChainFactory::restore(const QVariantMap &data)
......@@ -1151,7 +1151,7 @@ GccToolChain *ClangToolChainFactory::createToolChain(bool autoDetect)
// --------------------------------------------------------------------------
MingwToolChain::MingwToolChain(Detection d) :
GccToolChain(Constants::MINGW_TOOLCHAIN_ID, d)
GccToolChain(Constants::MINGW_TOOLCHAIN_TYPEID, d)
{ }
QString MingwToolChain::typeDisplayName() const
......@@ -1206,7 +1206,7 @@ ToolChain *MingwToolChain::clone() const
MingwToolChainFactory::MingwToolChainFactory()
{
setTypeId(Constants::MINGW_TOOLCHAIN_ID);
setTypeId(Constants::MINGW_TOOLCHAIN_TYPEID);
setDisplayName(tr("MinGW"));
}
......@@ -1229,7 +1229,7 @@ ToolChain *MingwToolChainFactory::create()
bool MingwToolChainFactory::canRestore(const QVariantMap &data)
{
return typeIdFromMap(data) == Constants::MINGW_TOOLCHAIN_ID;
return typeIdFromMap(data) == Constants::MINGW_TOOLCHAIN_TYPEID;
}
ToolChain *MingwToolChainFactory::restore(const QVariantMap &data)
......@@ -1252,7 +1252,7 @@ GccToolChain *MingwToolChainFactory::createToolChain(bool autoDetect)
// --------------------------------------------------------------------------
LinuxIccToolChain::LinuxIccToolChain(Detection d) :
GccToolChain(Constants::LINUXICC_TOOLCHAIN_ID, d)
GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID, d)
{ }
QString LinuxIccToolChain::typeDisplayName() const
......@@ -1305,7 +1305,7 @@ ToolChain *LinuxIccToolChain::clone() const
LinuxIccToolChainFactory::LinuxIccToolChainFactory()
{
setDisplayName(tr("Linux ICC"));
setTypeId(Constants::LINUXICC_TOOLCHAIN_ID);
setTypeId(Constants::LINUXICC_TOOLCHAIN_TYPEID);
}
QList<ToolChain *> LinuxIccToolChainFactory::autoDetect()
......@@ -1320,7 +1320,7 @@ ToolChain *LinuxIccToolChainFactory::create()
bool LinuxIccToolChainFactory::canRestore(const QVariantMap &data)
{
return typeIdFromMap(data) == Constants::LINUXICC_TOOLCHAIN_ID;
return typeIdFromMap(data) == Constants::LINUXICC_TOOLCHAIN_TYPEID;
}
ToolChain *LinuxIccToolChainFactory::restore(const QVariantMap &data)
......
......@@ -343,7 +343,7 @@ Utils::Environment MsvcToolChain::readEnvironmentSetting(Utils::Environment& env
MsvcToolChain::MsvcToolChain(const QString &name, const Abi &abi,
const QString &varsBat, const QString &varsBatArg, Detection d) :
AbstractMsvcToolChain(Constants::MSVC_TOOLCHAIN_ID, d, abi, varsBat),
AbstractMsvcToolChain(Constants::MSVC_TOOLCHAIN_TYPEID, d, abi, varsBat),
m_varsBatArg(varsBatArg)
{
Q_ASSERT(!name.isEmpty());
......@@ -360,7 +360,7 @@ bool MsvcToolChain::isValid() const
}
MsvcToolChain::MsvcToolChain() :
AbstractMsvcToolChain(Constants::MSVC_TOOLCHAIN_ID, ManualDetection)
AbstractMsvcToolChain(Constants::MSVC_TOOLCHAIN_TYPEID, ManualDetection)
{
}
......@@ -481,7 +481,7 @@ void MsvcToolChainConfigWidget::setFromToolChain()
MsvcToolChainFactory::MsvcToolChainFactory()
{
setTypeId(Constants::MSVC_TOOLCHAIN_ID);
setTypeId(Constants::MSVC_TOOLCHAIN_TYPEID);
setDisplayName(tr("MSVC"));
}
......@@ -627,7 +627,7 @@ bool MsvcToolChain::operator ==(const ToolChain &other) const
bool MsvcToolChainFactory::canRestore(const QVariantMap &data)
{
return typeIdFromMap(data) == Constants::MSVC_TOOLCHAIN_ID;
return typeIdFromMap(data) == Constants::MSVC_TOOLCHAIN_TYPEID;
}
} // namespace Internal
......
......@@ -223,14 +223,14 @@ const char BUILDSTEPS_DEPLOY[] = "ProjectExplorer.BuildSteps.Deploy";
// Deploy Configuration id:
const char DEFAULT_DEPLOYCONFIGURATION_ID[] = "ProjectExplorer.DefaultDeployConfiguration";
// ToolChain Ids
const char CLANG_TOOLCHAIN_ID[] = "ProjectExplorer.ToolChain.Clang";
const char GCC_TOOLCHAIN_ID[] = "ProjectExplorer.ToolChain.Gcc";
const char LINUXICC_TOOLCHAIN_ID[] = "ProjectExplorer.ToolChain.LinuxIcc";
const char MINGW_TOOLCHAIN_ID[] = "ProjectExplorer.ToolChain.Mingw";
const char MSVC_TOOLCHAIN_ID[] = "ProjectExplorer.ToolChain.Msvc";
const char WINCE_TOOLCHAIN_ID[] = "ProjectExplorer.ToolChain.WinCE";
const char CUSTOM_TOOLCHAIN_ID[] = "ProjectExplorer.ToolChain.Custom";
// ToolChain TypeIds
const char CLANG_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Clang";
const char GCC_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Gcc";
const char LINUXICC_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.LinuxIcc";
const char MINGW_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Mingw";
const char MSVC_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Msvc";
const char WINCE_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.WinCE";
const char CUSTOM_TOOLCHAIN_TYPEID[] = "ProjectExplorer.ToolChain.Custom";
// Default directory to run custom (build) commands in.
const char DEFAULT_WORKING_DIR[] = "%{buildDir}";
......
......@@ -61,7 +61,10 @@ public:
m_id(QUuid::createUuid().toByteArray()),
m_typeId(typeId),
m_detection(d)
{ }
{
QTC_ASSERT(m_typeId.isValid(), return);
QTC_ASSERT(!m_typeId.toString().contains(QLatin1Char(':')), return);
}
QByteArray m_id;
Core::Id m_typeId;
......
......@@ -242,7 +242,7 @@ WinCEToolChain::WinCEToolChain(const QString &name,
const QString &includePath,
const QString &libPath,
Detection d) :
AbstractMsvcToolChain(Constants::WINCE_TOOLCHAIN_ID, d, abi, vcvarsBat),
AbstractMsvcToolChain(Constants::WINCE_TOOLCHAIN_TYPEID, d, abi, vcvarsBat),
m_msvcVer(msvcVer),
m_ceVer(ceVer),
m_binPath(binPath),
......@@ -258,7 +258,7 @@ WinCEToolChain::WinCEToolChain(const QString &name,
}
WinCEToolChain::WinCEToolChain() :
AbstractMsvcToolChain(Constants::WINCE_TOOLCHAIN_ID, ManualDetection)
AbstractMsvcToolChain(Constants::WINCE_TOOLCHAIN_TYPEID, ManualDetection)
{
}
......@@ -349,7 +349,7 @@ ToolChain *WinCEToolChain::clone() const
WinCEToolChainFactory::WinCEToolChainFactory()
{
setTypeId(Constants::WINCE_TOOLCHAIN_ID);
setTypeId(Constants::WINCE_TOOLCHAIN_TYPEID);
setDisplayName(tr("WinCE"));
}
......@@ -427,7 +427,7 @@ QString WinCEToolChain::autoDetectCdbDebugger(QStringList *checkedDirectories /*
bool WinCEToolChainFactory::canRestore(const QVariantMap &data)
{
return typeIdFromMap(data) == Constants::WINCE_TOOLCHAIN_ID;
return typeIdFromMap(data) == Constants::WINCE_TOOLCHAIN_TYPEID;
}
bool WinCEToolChain::operator ==(const ToolChain &other) const
......
......@@ -133,13 +133,13 @@ static QStringList targetOSList(const ProjectExplorer::Abi &abi, const ProjectEx
static QStringList toolchainList(const ProjectExplorer::ToolChain *tc)
{
QStringList list;
if (tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_ID)
if (tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID)
list << QLatin1String("clang") << QLatin1String("llvm") << QLatin1String("gcc");
else if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_ID)
else if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID)
list << QLatin1String("gcc"); // TODO: Detect llvm-gcc
else if (tc->typeId() == ProjectExplorer::Constants::MINGW_TOOLCHAIN_ID)
else if (tc->typeId() == ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID)
list << QLatin1String("mingw") << QLatin1String("gcc");
else if (tc->typeId() == ProjectExplorer::Constants::MSVC_TOOLCHAIN_ID)
else if (tc->typeId() == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID)
list << QLatin1String("msvc");
return list;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment