forked from qt-creator/qt-creator
PE: Add convenience function for retrieving a toolchain's factory
Change-Id: I76839ea04576b5a2c6252c09dea7955883e7ad9a Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -167,6 +167,11 @@ QString Toolchain::detectionSource() const
|
||||
return d->m_detectionSource;
|
||||
}
|
||||
|
||||
ToolchainFactory *Toolchain::factory() const
|
||||
{
|
||||
return ToolchainFactory::factoryForType(typeId());
|
||||
}
|
||||
|
||||
QByteArray Toolchain::id() const
|
||||
{
|
||||
return d->m_id;
|
||||
@@ -220,7 +225,7 @@ bool Toolchain::operator == (const Toolchain &tc) const
|
||||
|
||||
Toolchain *Toolchain::clone() const
|
||||
{
|
||||
if (ToolchainFactory *const f = ToolchainFactory::factoryForType(d->m_typeId)) {
|
||||
if (ToolchainFactory * const f = factory()) {
|
||||
Toolchain *tc = f->create();
|
||||
QTC_ASSERT(tc, return nullptr);
|
||||
Store data;
|
||||
|
||||
@@ -42,6 +42,7 @@ QString languageId(Language l);
|
||||
|
||||
class GccToolchain;
|
||||
class ToolchainConfigWidget;
|
||||
class ToolchainFactory;
|
||||
class Kit;
|
||||
|
||||
namespace Internal { class ToolchainSettingsAccessor; }
|
||||
@@ -78,6 +79,7 @@ public:
|
||||
bool isSdkProvided() const { return detection() == AutoDetectionFromSdk; }
|
||||
Detection detection() const;
|
||||
QString detectionSource() const;
|
||||
ToolchainFactory *factory() const;
|
||||
|
||||
QByteArray id() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user