Commit f8073770 authored by dt's avatar dt
Browse files

Adding Target::supportsTargetId()

Reviwed-By: hunger
parent 68163942
......@@ -78,6 +78,11 @@ CMakeProject *CMakeTarget::cmakeProject() const
return static_cast<CMakeProject *>(project());
}
bool CMakeTargetFactory::supportsTargetId(const QString &id) const
{
return id == DEFAULT_CMAKE_TARGET_ID;
}
CMakeBuildConfiguration *CMakeTarget::activeBuildConfiguration() const
{
return static_cast<CMakeBuildConfiguration *>(Target::activeBuildConfiguration());
......
......@@ -81,6 +81,8 @@ public:
CMakeTargetFactory(QObject *parent = 0);
~CMakeTargetFactory();
bool supportsTargetId(const QString &id) const;
QStringList availableCreationIds(ProjectExplorer::Project *parent) const;
QString displayNameForId(const QString &id) const;
......
......@@ -107,6 +107,11 @@ GenericTargetFactory::~GenericTargetFactory()
{
}
bool GenericTargetFactory::supportsTargetId(const QString &id) const
{
return id == QLatin1String(GENERIC_DESKTOP_TARGET_ID);
}
QStringList GenericTargetFactory::availableCreationIds(ProjectExplorer::Project *parent) const
{
if (!qobject_cast<GenericProject *>(parent))
......
......@@ -83,6 +83,8 @@ public:
explicit GenericTargetFactory(QObject *parent = 0);
~GenericTargetFactory();
bool supportsTargetId(const QString &id) const;
QStringList availableCreationIds(ProjectExplorer::Project *parent) const;
QString displayNameForId(const QString &id) const;
......
......@@ -152,6 +152,8 @@ public:
explicit ITargetFactory(QObject *parent = 0);
virtual ~ITargetFactory();
virtual bool supportsTargetId(const QString &id) const = 0;
// used to show the list of possible additons to a target, returns a list of types
virtual QStringList availableCreationIds(Project *parent) const = 0;
// used to translate the types to names to display to the user
......
......@@ -94,6 +94,11 @@ QmlProjectTargetFactory::~QmlProjectTargetFactory()
{
}
bool QmlProjectTargetFactory::supportsTargetId(const QString &id) const
{
return id == QLatin1String(Constants::QML_VIEWER_TARGET_ID);
}
QStringList QmlProjectTargetFactory::availableCreationIds(ProjectExplorer::Project *parent) const
{
if (!qobject_cast<QmlProject *>(parent))
......
......@@ -69,6 +69,7 @@ public:
explicit QmlProjectTargetFactory(QObject *parent = 0);
~QmlProjectTargetFactory();
bool supportsTargetId(const QString &id) const;
QStringList availableCreationIds(ProjectExplorer::Project *parent) const;
QString displayNameForId(const QString &id) const;
......
......@@ -107,6 +107,17 @@ Qt4TargetFactory::~Qt4TargetFactory()
{
}
bool Qt4TargetFactory::supportsTargetId(const QString &id) const
{
QSet<QString> ids;
ids << QLatin1String("Qt4ProjectManager.Target.DesktopTarget")
<< QLatin1String("Qt4ProjectManager.Target.S60EmulatorTarget")
<< QLatin1String("Qt4ProjectManager.Target.S60DeviceTarget")
<< QLatin1String("Qt4ProjectManager.Target.MaemoDeviceTarget")
<< QLatin1String("Qt4ProjectManager.Target.QtSimulatorTarget");
return ids.contains(id);
}
QStringList Qt4TargetFactory::availableCreationIds(ProjectExplorer::Project *parent) const
{
if (!qobject_cast<Qt4Project *>(parent))
......
......@@ -118,6 +118,8 @@ public:
Qt4TargetFactory(QObject *parent = 0);
~Qt4TargetFactory();
virtual bool supportsTargetId(const QString &id) const;
QStringList availableCreationIds(ProjectExplorer::Project *parent) const;
QString displayNameForId(const QString &id) const;
......
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