forked from qt-creator/qt-creator
Toolchain: Add type() method.
Rename typeName() to typeDisplayName() to make it clear that this is a user visible string that is translated. Add type() method to provide a simple string that can be used by build system plugins to find out which kind of toolchain currently is in use. Change-Id: I7c3f050aa82c8b17071fd03ee142c5ae2f17b1de Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Marco Bubke <marco.bubke@nokia.com>
This commit is contained in:
@@ -74,7 +74,12 @@ MaemoToolChain::MaemoToolChain(const MaemoToolChain &tc) :
|
||||
MaemoToolChain::~MaemoToolChain()
|
||||
{ }
|
||||
|
||||
QString MaemoToolChain::typeName() const
|
||||
QString MaemoToolChain::type() const
|
||||
{
|
||||
return QLatin1String("maemogcc");
|
||||
}
|
||||
|
||||
QString MaemoToolChain::typeDisplayName() const
|
||||
{
|
||||
return MaemoToolChainFactory::tr("Maemo GCC");
|
||||
}
|
||||
|
@@ -48,7 +48,8 @@ class MaemoToolChain : public ProjectExplorer::GccToolChain
|
||||
public:
|
||||
~MaemoToolChain();
|
||||
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
Utils::FileName mkspec() const;
|
||||
|
||||
bool isValid() const;
|
||||
|
@@ -304,8 +304,8 @@ GccToolChain::GccToolChain(const GccToolChain &tc) :
|
||||
QString GccToolChain::defaultDisplayName() const
|
||||
{
|
||||
if (!m_targetAbi.isValid())
|
||||
return typeName();
|
||||
return QString::fromLatin1("%1 (%2 %3)").arg(typeName(),
|
||||
return typeDisplayName();
|
||||
return QString::fromLatin1("%1 (%2 %3)").arg(typeDisplayName(),
|
||||
ProjectExplorer::Abi::toString(m_targetAbi.architecture()),
|
||||
ProjectExplorer::Abi::toString(m_targetAbi.wordWidth()));
|
||||
}
|
||||
@@ -327,7 +327,12 @@ QString GccToolChain::legacyId() const
|
||||
.arg(m_targetAbi.toString()).arg(m_debuggerCommand.toString());
|
||||
}
|
||||
|
||||
QString GccToolChain::typeName() const
|
||||
QString GccToolChain::type() const
|
||||
{
|
||||
return QLatin1String("gcc");
|
||||
}
|
||||
|
||||
QString GccToolChain::typeDisplayName() const
|
||||
{
|
||||
return Internal::GccToolChainFactory::tr("GCC");
|
||||
}
|
||||
@@ -770,7 +775,12 @@ ClangToolChain::ClangToolChain(bool autodetect) :
|
||||
GccToolChain(QLatin1String(Constants::CLANG_TOOLCHAIN_ID), autodetect)
|
||||
{ }
|
||||
|
||||
QString ClangToolChain::typeName() const
|
||||
QString ClangToolChain::type() const
|
||||
{
|
||||
return QLatin1String("clang");
|
||||
}
|
||||
|
||||
QString ClangToolChain::typeDisplayName() const
|
||||
{
|
||||
return Internal::ClangToolChainFactory::tr("Clang");
|
||||
}
|
||||
@@ -862,7 +872,12 @@ MingwToolChain::MingwToolChain(bool autodetect) :
|
||||
GccToolChain(QLatin1String(Constants::MINGW_TOOLCHAIN_ID), autodetect)
|
||||
{ }
|
||||
|
||||
QString MingwToolChain::typeName() const
|
||||
QString MingwToolChain::type() const
|
||||
{
|
||||
return QLatin1String("mingw");
|
||||
}
|
||||
|
||||
QString MingwToolChain::typeDisplayName() const
|
||||
{
|
||||
return Internal::MingwToolChainFactory::tr("MinGW");
|
||||
}
|
||||
@@ -951,7 +966,12 @@ LinuxIccToolChain::LinuxIccToolChain(bool autodetect) :
|
||||
GccToolChain(QLatin1String(Constants::LINUXICC_TOOLCHAIN_ID), autodetect)
|
||||
{ }
|
||||
|
||||
QString LinuxIccToolChain::typeName() const
|
||||
QString LinuxIccToolChain::type() const
|
||||
{
|
||||
return QLatin1String("icc");
|
||||
}
|
||||
|
||||
QString LinuxIccToolChain::typeDisplayName() const
|
||||
{
|
||||
return Internal::LinuxIccToolChainFactory::tr("Linux ICC");
|
||||
}
|
||||
|
@@ -56,7 +56,8 @@ class PROJECTEXPLORER_EXPORT GccToolChain : public ToolChain
|
||||
public:
|
||||
QString legacyId() const;
|
||||
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
Abi targetAbi() const;
|
||||
QString version() const;
|
||||
QList<Abi> supportedAbis() const;
|
||||
@@ -121,7 +122,8 @@ private:
|
||||
class PROJECTEXPLORER_EXPORT ClangToolChain : public GccToolChain
|
||||
{
|
||||
public:
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
QString makeCommand() const;
|
||||
Utils::FileName mkspec() const;
|
||||
|
||||
@@ -143,7 +145,8 @@ private:
|
||||
class PROJECTEXPLORER_EXPORT MingwToolChain : public GccToolChain
|
||||
{
|
||||
public:
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
Utils::FileName mkspec() const;
|
||||
QString makeCommand() const;
|
||||
|
||||
@@ -163,8 +166,8 @@ private:
|
||||
class PROJECTEXPLORER_EXPORT LinuxIccToolChain : public GccToolChain
|
||||
{
|
||||
public:
|
||||
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
|
||||
IOutputParser *outputParser() const;
|
||||
|
||||
|
@@ -318,7 +318,12 @@ QString MsvcToolChain::legacyId() const
|
||||
return id;
|
||||
}
|
||||
|
||||
QString MsvcToolChain::typeName() const
|
||||
QString MsvcToolChain::type() const
|
||||
{
|
||||
return QLatin1String("msvc");
|
||||
}
|
||||
|
||||
QString MsvcToolChain::typeDisplayName() const
|
||||
{
|
||||
return MsvcToolChainFactory::tr("MSVC");
|
||||
}
|
||||
|
@@ -60,7 +60,8 @@ public:
|
||||
|
||||
static MsvcToolChain *readFromMap(const QVariantMap &data);
|
||||
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
Utils::FileName mkspec() const;
|
||||
|
||||
QVariantMap toMap() const;
|
||||
|
@@ -107,7 +107,7 @@ ToolChain::~ToolChain()
|
||||
QString ToolChain::displayName() const
|
||||
{
|
||||
if (d->m_displayName.isEmpty())
|
||||
return typeName();
|
||||
return typeDisplayName();
|
||||
return d->m_displayName;
|
||||
}
|
||||
|
||||
|
@@ -75,7 +75,8 @@ public:
|
||||
// No need to implement this for new tool chains:
|
||||
virtual QString legacyId() const { return QString(); }
|
||||
|
||||
virtual QString typeName() const = 0;
|
||||
virtual QString type() const = 0;
|
||||
virtual QString typeDisplayName() const = 0;
|
||||
virtual Abi targetAbi() const = 0;
|
||||
|
||||
virtual bool isValid() const = 0;
|
||||
|
@@ -194,7 +194,7 @@ QVariant ToolChainModel::data(const QModelIndex &index, int role) const
|
||||
return node->newName.isEmpty() ?
|
||||
node->toolChain->displayName() : node->newName;
|
||||
}
|
||||
return node->toolChain->typeName();
|
||||
return node->toolChain->typeDisplayName();
|
||||
}
|
||||
if (role == Qt::ToolTipRole) {
|
||||
return tr("<nobr><b>ABI:</b> %1")
|
||||
|
@@ -295,7 +295,12 @@ QString WinCEToolChain::legacyId() const
|
||||
return id;
|
||||
}
|
||||
|
||||
QString WinCEToolChain::typeName() const
|
||||
QString WinCEToolChain::type() const
|
||||
{
|
||||
return QLatin1String("wince");
|
||||
}
|
||||
|
||||
QString WinCEToolChain::typeDisplayName() const
|
||||
{
|
||||
return WinCEToolChainFactory::tr("WinCE");
|
||||
}
|
||||
|
@@ -61,7 +61,8 @@ public:
|
||||
|
||||
static WinCEToolChain *readFromMap(const QVariantMap &data);
|
||||
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
|
||||
Utils::FileName mkspec() const;
|
||||
|
||||
|
@@ -84,7 +84,12 @@ static QString gcceVersion(const QString &command)
|
||||
// GcceToolChain
|
||||
// ==========================================================================
|
||||
|
||||
QString GcceToolChain::typeName() const
|
||||
QString GcceToolChain::type() const
|
||||
{
|
||||
return QLatin1String("gcce");
|
||||
}
|
||||
|
||||
QString GcceToolChain::typeDisplayName() const
|
||||
{
|
||||
return GcceToolChainFactory::tr("GCCE");
|
||||
}
|
||||
|
@@ -45,7 +45,8 @@ namespace Internal {
|
||||
class GcceToolChain : public ProjectExplorer::GccToolChain
|
||||
{
|
||||
public:
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
|
||||
QByteArray predefinedMacros() const;
|
||||
void addToEnvironment(Utils::Environment &env) const;
|
||||
|
@@ -143,7 +143,12 @@ RvctToolChain::RvctVersion RvctToolChain::version(const QString &rvctPath)
|
||||
return v;
|
||||
}
|
||||
|
||||
QString RvctToolChain::typeName() const
|
||||
QString RvctToolChain::type() const
|
||||
{
|
||||
return QLatin1String("rvct");
|
||||
}
|
||||
|
||||
QString RvctToolChain::typeDisplayName() const
|
||||
{
|
||||
return RvctToolChainFactory::tr("RVCT");
|
||||
}
|
||||
|
@@ -81,7 +81,8 @@ public:
|
||||
|
||||
enum ArmVersion { ARMv5, ARMv6 };
|
||||
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
ProjectExplorer::Abi targetAbi() const;
|
||||
|
||||
QString legacyId() const;
|
||||
|
@@ -135,7 +135,12 @@ WinscwToolChain::WinscwToolChain(const WinscwToolChain &tc) :
|
||||
WinscwToolChain::~WinscwToolChain()
|
||||
{ }
|
||||
|
||||
QString WinscwToolChain::typeName() const
|
||||
QString WinscwToolChain::type() const
|
||||
{
|
||||
return QLatin1String("winscw");
|
||||
}
|
||||
|
||||
QString WinscwToolChain::typeDisplayName() const
|
||||
{
|
||||
return WinscwToolChainFactory::tr("WINSCW");
|
||||
}
|
||||
|
@@ -52,7 +52,8 @@ public:
|
||||
WinscwToolChain(const WinscwToolChain &);
|
||||
~WinscwToolChain();
|
||||
|
||||
QString typeName() const;
|
||||
QString type() const;
|
||||
QString typeDisplayName() const;
|
||||
ProjectExplorer::Abi targetAbi() const;
|
||||
QString legacyId() const;
|
||||
|
||||
|
Reference in New Issue
Block a user