Commit c78258cd authored by Daniel Teske's avatar Daniel Teske

Allow the user to restrict rc creation to certain .pro

Task-number: QTCREATORBUG-10953
Change-Id: Iff1a31c007ac777bfa390d48237480ef56ffc0e4
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent d15e0aa9
...@@ -37,6 +37,25 @@ ...@@ -37,6 +37,25 @@
namespace Utils namespace Utils
{ {
template<typename T, typename F>
bool anyOf(const T &container, F predicate)
{
return std::any_of(container.begin(), container.end(), predicate);
}
template<typename T, typename F>
bool allOf(const T &container, F predicate)
{
return std::all_of(container.begin(), container.end(), predicate);
}
template<typename T, typename F>
void erase(QList<T> &container, F predicate)
{
container.erase(std::remove_if(container.begin(), container.end(), predicate),
container.end());
}
// Note: add overloads for other container types as needed // Note: add overloads for other container types as needed
template<typename T, typename F> template<typename T, typename F>
Q_REQUIRED_RESULT Q_REQUIRED_RESULT
......
...@@ -85,17 +85,20 @@ bool AndroidRunConfigurationFactory::canClone(Target *parent, RunConfiguration * ...@@ -85,17 +85,20 @@ bool AndroidRunConfigurationFactory::canClone(Target *parent, RunConfiguration *
return canCreate(parent, source->id()); return canCreate(parent, source->id());
} }
QList<Core::Id> AndroidRunConfigurationFactory::availableCreationIds(Target *parent) const QList<Core::Id> AndroidRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
{ {
QList<Core::Id> ids;
if (!AndroidManager::supportsAndroid(parent)) if (!AndroidManager::supportsAndroid(parent))
return ids; return QList<Core::Id>();
QmakeProject *project = static_cast<QmakeProject *>(parent->project()); QmakeProject *project = static_cast<QmakeProject *>(parent->project());
QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>() QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>()
<< ApplicationTemplate << ApplicationTemplate
<< LibraryTemplate); << LibraryTemplate);
if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes);
const Core::Id base = Core::Id(ANDROID_RC_ID_PREFIX); const Core::Id base = Core::Id(ANDROID_RC_ID_PREFIX);
return QmakeProject::idsForNodes(base, nodes); return QmakeProject::idsForNodes(base, nodes);
} }
......
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
explicit AndroidRunConfigurationFactory(QObject *parent = 0); explicit AndroidRunConfigurationFactory(QObject *parent = 0);
QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const;
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const;
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
......
...@@ -84,8 +84,9 @@ bool BareMetalRunConfigurationFactory::canClone(Target *parent, RunConfiguration ...@@ -84,8 +84,9 @@ bool BareMetalRunConfigurationFactory::canClone(Target *parent, RunConfiguration
return bmrc && canCreate(parent, source->id()); return bmrc && canCreate(parent, source->id());
} }
QList<Core::Id> BareMetalRunConfigurationFactory::availableCreationIds(Target *parent) const QList<Core::Id> BareMetalRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
{ {
Q_UNUSED(mode)
QList<Core::Id> result; QList<Core::Id> result;
if (!canHandle(parent)) if (!canHandle(parent))
return result; return result;
......
...@@ -42,7 +42,7 @@ public: ...@@ -42,7 +42,7 @@ public:
~BareMetalRunConfigurationFactory(); ~BareMetalRunConfigurationFactory();
QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const;
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
......
...@@ -352,8 +352,9 @@ CMakeRunConfigurationFactory::~CMakeRunConfigurationFactory() ...@@ -352,8 +352,9 @@ CMakeRunConfigurationFactory::~CMakeRunConfigurationFactory()
} }
// used to show the list of possible additons to a project, returns a list of ids // used to show the list of possible additons to a project, returns a list of ids
QList<Core::Id> CMakeRunConfigurationFactory::availableCreationIds(Target *parent) const QList<Core::Id> CMakeRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
{ {
Q_UNUSED(mode)
if (!canHandle(parent)) if (!canHandle(parent))
return QList<Core::Id>(); return QList<Core::Id>();
CMakeProject *project = static_cast<CMakeProject *>(parent->project()); CMakeProject *project = static_cast<CMakeProject *>(parent->project());
......
...@@ -138,7 +138,7 @@ public: ...@@ -138,7 +138,7 @@ public:
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const; bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const;
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product); ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product);
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const;
static Core::Id idFromBuildTarget(const QString &target); static Core::Id idFromBuildTarget(const QString &target);
......
...@@ -59,7 +59,11 @@ namespace Internal { ...@@ -59,7 +59,11 @@ namespace Internal {
static QString pathFromId(const Core::Id id) static QString pathFromId(const Core::Id id)
{ {
return id.suffixAfter(IOS_RC_ID_PREFIX); QString pathStr = id.toString();
const QString prefix = QLatin1String(IOS_RC_ID_PREFIX);
if (!pathStr.startsWith(prefix))
return QString();
return pathStr.mid(prefix.size());
} }
IosRunConfigurationFactory::IosRunConfigurationFactory(QObject *parent) IosRunConfigurationFactory::IosRunConfigurationFactory(QObject *parent)
...@@ -88,19 +92,19 @@ bool IosRunConfigurationFactory::canClone(Target *parent, RunConfiguration *sour ...@@ -88,19 +92,19 @@ bool IosRunConfigurationFactory::canClone(Target *parent, RunConfiguration *sour
return canCreate(parent, source->id()); return canCreate(parent, source->id());
} }
QList<Core::Id> IosRunConfigurationFactory::availableCreationIds(Target *parent) const QList<Core::Id> IosRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
{ {
QList<Core::Id> ids;
if (!IosManager::supportsIos(parent)) if (!IosManager::supportsIos(parent))
return ids; return QList<Core::Id>();
Core::Id baseId(IOS_RC_ID_PREFIX);
QmakeProject *project = static_cast<QmakeProject *>(parent->project()); QmakeProject *project = static_cast<QmakeProject *>(parent->project());
QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>() QList<QmakeProFileNode *> nodes = project->allProFiles(QList<QmakeProjectType>()
<< ApplicationTemplate << ApplicationTemplate
<< LibraryTemplate << LibraryTemplate
<< AuxTemplate); << AuxTemplate);
if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes);
Core::Id baseId(IOS_RC_ID_PREFIX);
return QmakeProject::idsForNodes(baseId, nodes); return QmakeProject::idsForNodes(baseId, nodes);
} }
......
...@@ -51,7 +51,7 @@ public: ...@@ -51,7 +51,7 @@ public:
explicit IosRunConfigurationFactory(QObject *parent = 0); explicit IosRunConfigurationFactory(QObject *parent = 0);
QString displayNameForId(const Core::Id id) const QTC_OVERRIDE; QString displayNameForId(const Core::Id id) const QTC_OVERRIDE;
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const QTC_OVERRIDE; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode = UserCreate) const QTC_OVERRIDE;
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const QTC_OVERRIDE; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const QTC_OVERRIDE;
......
...@@ -217,7 +217,8 @@ public: ...@@ -217,7 +217,8 @@ public:
explicit IRunConfigurationFactory(QObject *parent = 0); explicit IRunConfigurationFactory(QObject *parent = 0);
virtual ~IRunConfigurationFactory(); virtual ~IRunConfigurationFactory();
virtual QList<Core::Id> availableCreationIds(Target *parent) const = 0; enum CreationMode {UserCreate, AutoCreate};
virtual QList<Core::Id> availableCreationIds(Target *parent, CreationMode mode = UserCreate) const = 0;
virtual QString displayNameForId(const Core::Id id) const = 0; virtual QString displayNameForId(const Core::Id id) const = 0;
virtual bool canCreate(Target *parent, const Core::Id id) const = 0; virtual bool canCreate(Target *parent, const Core::Id id) const = 0;
......
...@@ -599,26 +599,31 @@ void Target::updateDefaultRunConfigurations() ...@@ -599,26 +599,31 @@ void Target::updateDefaultRunConfigurations()
int configuredCount = existingConfigured.count(); int configuredCount = existingConfigured.count();
// find all RC ids that can get created: // find all RC ids that can get created:
QList<Core::Id> factoryIds; QList<Core::Id> availableFactoryIds;
foreach (IRunConfigurationFactory *rcFactory, rcFactories) foreach (IRunConfigurationFactory *rcFactory, rcFactories)
factoryIds.append(rcFactory->availableCreationIds(this)); availableFactoryIds.append(rcFactory->availableCreationIds(this));
QList<Core::Id> autoCreateFactoryIds;
foreach (IRunConfigurationFactory *rcFactory, rcFactories)
autoCreateFactoryIds.append(rcFactory->availableCreationIds(this,
IRunConfigurationFactory::AutoCreate));
// Put outdated RCs into toRemove, do not bother with factories // Put outdated RCs into toRemove, do not bother with factories
// that produce already existing RCs // that produce already existing RCs
QList<RunConfiguration *> toRemove; QList<RunConfiguration *> toRemove;
QList<Core::Id> toIgnore; QList<Core::Id> toIgnore;
foreach (RunConfiguration *rc, existingConfigured) { foreach (RunConfiguration *rc, existingConfigured) {
if (factoryIds.contains(rc->id())) if (availableFactoryIds.contains(rc->id()))
toIgnore.append(rc->id()); // Already there toIgnore.append(rc->id()); // Already there
else else
toRemove << rc; toRemove << rc;
} }
foreach (Core::Id i, toIgnore) foreach (Core::Id i, toIgnore)
factoryIds.removeAll(i); autoCreateFactoryIds.removeAll(i);
configuredCount -= toRemove.count(); configuredCount -= toRemove.count();
// Create new RCs and put them into newConfigured/newUnconfigured // Create new RCs and put them into newConfigured/newUnconfigured
foreach (Core::Id id, factoryIds) { foreach (Core::Id id, autoCreateFactoryIds) {
IRunConfigurationFactory *factory = 0; IRunConfigurationFactory *factory = 0;
foreach (IRunConfigurationFactory *i, rcFactories) { foreach (IRunConfigurationFactory *i, rcFactories) {
if (i->canCreate(this, id)) { if (i->canCreate(this, id)) {
......
...@@ -550,8 +550,9 @@ RunConfiguration *QbsRunConfigurationFactory::clone(Target *parent, RunConfigura ...@@ -550,8 +550,9 @@ RunConfiguration *QbsRunConfigurationFactory::clone(Target *parent, RunConfigura
return new QbsRunConfiguration(parent, old); return new QbsRunConfiguration(parent, old);
} }
QList<Core::Id> QbsRunConfigurationFactory::availableCreationIds(Target *parent) const QList<Core::Id> QbsRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
{ {
Q_UNUSED(mode)
QList<Core::Id> result; QList<Core::Id> result;
if (!canHandle(parent)) if (!canHandle(parent))
return result; return result;
......
...@@ -181,7 +181,7 @@ public: ...@@ -181,7 +181,7 @@ public:
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const;
private: private:
......
...@@ -667,14 +667,15 @@ RunConfiguration *DesktopQmakeRunConfigurationFactory::clone(Target *parent, Run ...@@ -667,14 +667,15 @@ RunConfiguration *DesktopQmakeRunConfigurationFactory::clone(Target *parent, Run
return new DesktopQmakeRunConfiguration(parent, old); return new DesktopQmakeRunConfiguration(parent, old);
} }
QList<Core::Id> DesktopQmakeRunConfigurationFactory::availableCreationIds(Target *parent) const QList<Core::Id> DesktopQmakeRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
{ {
QList<Core::Id> result;
if (!canHandle(parent)) if (!canHandle(parent))
return result; return QList<Core::Id>();
QmakeProject *project = static_cast<QmakeProject *>(parent->project()); QmakeProject *project = static_cast<QmakeProject *>(parent->project());
QList<QmakeProFileNode *> nodes = project->applicationProFiles(); QList<QmakeProFileNode *> nodes = project->applicationProFiles();
if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes);
return QmakeProject::idsForNodes(Core::Id(QMAKE_RC_PREFIX), nodes); return QmakeProject::idsForNodes(Core::Id(QMAKE_RC_PREFIX), nodes);
} }
......
...@@ -193,7 +193,7 @@ public: ...@@ -193,7 +193,7 @@ public:
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const;
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source);
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const;
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t, QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t,
......
...@@ -1591,6 +1591,12 @@ bool QmakeProFileNode::isDebugAndRelease() const ...@@ -1591,6 +1591,12 @@ bool QmakeProFileNode::isDebugAndRelease() const
return configValues.contains(QLatin1String("debug_and_release")); return configValues.contains(QLatin1String("debug_and_release"));
} }
bool QmakeProFileNode::isQtcRunnable() const
{
const QStringList configValues = m_varValues.value(ConfigVar);
return configValues.contains(QLatin1String("qtc_runnable"));
}
QmakeProjectType QmakeProFileNode::projectType() const QmakeProjectType QmakeProFileNode::projectType() const
{ {
return m_projectType; return m_projectType;
......
...@@ -410,6 +410,7 @@ public: ...@@ -410,6 +410,7 @@ public:
bool showInSimpleTree(QmakeProjectType projectType) const; bool showInSimpleTree(QmakeProjectType projectType) const;
bool isDebugAndRelease() const; bool isDebugAndRelease() const;
bool isQtcRunnable() const;
void setParseInProgress(bool b); void setParseInProgress(bool b);
void setParseInProgressRecursive(bool b); void setParseInProgressRecursive(bool b);
......
...@@ -1103,6 +1103,17 @@ bool QmakeProject::hasApplicationProFile(const QString &path) const ...@@ -1103,6 +1103,17 @@ bool QmakeProject::hasApplicationProFile(const QString &path) const
return false; return false;
} }
QList<QmakeProFileNode *> QmakeProject::nodesWithQtcRunnable(QList<QmakeProFileNode *> nodes)
{
std::function<bool (QmakeProFileNode *)> hasQtcRunnable = [](QmakeProFileNode *node) {
return node->isQtcRunnable();
};
if (anyOf(nodes, hasQtcRunnable))
erase(nodes, std::not1(hasQtcRunnable));
return nodes;
}
QList<Core::Id> QmakeProject::idsForNodes(const Core::Id base, const QList<QmakeProFileNode *> &nodes) QList<Core::Id> QmakeProject::idsForNodes(const Core::Id base, const QList<QmakeProFileNode *> &nodes)
{ {
return Utils::transform(nodes, [&base](QmakeProFileNode *node) { return Utils::transform(nodes, [&base](QmakeProFileNode *node) {
......
...@@ -92,6 +92,7 @@ public: ...@@ -92,6 +92,7 @@ public:
QList<QmakeProFileNode *> applicationProFiles(Parsing parse = ExactParse) const; QList<QmakeProFileNode *> applicationProFiles(Parsing parse = ExactParse) const;
bool hasApplicationProFile(const QString &path) const; bool hasApplicationProFile(const QString &path) const;
static QList<QmakeProFileNode *> nodesWithQtcRunnable(QList<QmakeProFileNode *> nodes);
static QList<Core::Id> idsForNodes(const Core::Id base, const QList<QmakeProFileNode *> &nodes); static QList<Core::Id> idsForNodes(const Core::Id base, const QList<QmakeProFileNode *> &nodes);
void notifyChanged(const QString &name); void notifyChanged(const QString &name);
......
...@@ -50,8 +50,9 @@ QmlProjectRunConfigurationFactory::~QmlProjectRunConfigurationFactory() ...@@ -50,8 +50,9 @@ QmlProjectRunConfigurationFactory::~QmlProjectRunConfigurationFactory()
{ {
} }
QList<Core::Id> QmlProjectRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const QList<Core::Id> QmlProjectRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const
{ {
Q_UNUSED(mode)
if (!canHandle(parent)) if (!canHandle(parent))
return QList<Core::Id>(); return QList<Core::Id>();
......
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
explicit QmlProjectRunConfigurationFactory(QObject *parent = 0); explicit QmlProjectRunConfigurationFactory(QObject *parent = 0);
~QmlProjectRunConfigurationFactory(); ~QmlProjectRunConfigurationFactory();
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const;
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qmakeprojectmanager/qmakeproject.h> #include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
...@@ -51,19 +52,21 @@ BlackBerryRunConfigurationFactory::BlackBerryRunConfigurationFactory(QObject *pa ...@@ -51,19 +52,21 @@ BlackBerryRunConfigurationFactory::BlackBerryRunConfigurationFactory(QObject *pa
{ {
} }
QList<Core::Id> BlackBerryRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const QList<Core::Id> BlackBerryRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const
{ {
QList<Core::Id> ids; using QmakeProjectManager::QmakeProject;
if (!canHandle(parent)) if (!canHandle(parent))
return ids; return QList<Core::Id>();
QmakeProjectManager::QmakeProject *qt4Project = qobject_cast<QmakeProjectManager::QmakeProject *>(parent->project()); QmakeProject *qt4Project = qobject_cast<QmakeProject *>(parent->project());
if (!qt4Project) if (!qt4Project)
return ids; return QList<Core::Id>();
QList<QmakeProjectManager::QmakeProFileNode *> nodes = qt4Project->applicationProFiles(); QList<QmakeProjectManager::QmakeProFileNode *> nodes = qt4Project->applicationProFiles();
return QmakeProjectManager::QmakeProject::idsForNodes(Core::Id(Constants::QNX_BB_RUNCONFIGURATION_PREFIX), if (mode == AutoCreate)
nodes); nodes = QmakeProject::nodesWithQtcRunnable(nodes);
return QmakeProject::idsForNodes(Core::Id(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX),
nodes);
} }
QString BlackBerryRunConfigurationFactory::displayNameForId(const Core::Id id) const QString BlackBerryRunConfigurationFactory::displayNameForId(const Core::Id id) const
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
namespace QmakeProjectManager { class QmakeProFileNode; }
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
...@@ -43,7 +45,7 @@ class BlackBerryRunConfigurationFactory : public ProjectExplorer::IRunConfigurat ...@@ -43,7 +45,7 @@ class BlackBerryRunConfigurationFactory : public ProjectExplorer::IRunConfigurat
public: public:
explicit BlackBerryRunConfigurationFactory(QObject *parent = 0); explicit BlackBerryRunConfigurationFactory(QObject *parent = 0);
QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const;
QString displayNameForId(const Core::Id id) const; QString displayNameForId(const Core::Id id) const;
bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const;
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <projectexplorer/kitinformation.h> #include <projectexplorer/kitinformation.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qmakeprojectmanager/qmakeproject.h> #include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
...@@ -52,18 +53,22 @@ QnxRunConfigurationFactory::QnxRunConfigurationFactory(QObject *parent) : ...@@ -52,18 +53,22 @@ QnxRunConfigurationFactory::QnxRunConfigurationFactory(QObject *parent) :
{ {
} }
QList<Core::Id> QnxRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const QList<Core::Id> QnxRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent, CreationMode mode) const
{ {
QList<Core::Id> ids; using QmakeProjectManager::QmakeProject;
if (!canHandle(parent)) if (!canHandle(parent))
return ids; return QList<Core::Id>();
QmakeProjectManager::QmakeProject *qt4Project = qobject_cast<QmakeProjectManager::QmakeProject *>(parent->project()); QmakeProject *qt4Project = qobject_cast<QmakeProject *>(parent->project());
if (!qt4Project) if (!qt4Project)
return ids; return QList<Core::Id>();
QList<QmakeProjectManager::QmakeProFileNode *> nodes = qt4Project->applicationProFiles(); QList<QmakeProjectManager::QmakeProFileNode *> nodes = qt4Project->applicationProFiles();
return QmakeProjectManager::QmakeProject::idsForNodes(Core::Id(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX),
nodes); if (mode == AutoCreate)
nodes = QmakeProject::nodesWithQtcRunnable(nodes);
return QmakeProject::idsForNodes(Core::Id(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX),
nodes);
} }
QString QnxRunConfigurationFactory::displayNameForId(const Core::Id id) const QString QnxRunConfigurationFactory::displayNameForId(const Core::Id id) const
......