Commit d1bdfcc3 authored by Tobias Hunger's avatar Tobias Hunger

Integrate target support

 * Ease cross device development by introducing 'targets' which
   group build- and runsettings that are valid for this one target

 Most of the kudos for the code review go to dt. Con, thorbjorn,
 ckandler and others did also review parts of this patch.

Reviewed-by: dt
parent 8ee2521f
......@@ -31,6 +31,7 @@
#include "cmakeopenprojectwizard.h"
#include "cmakeproject.h"
#include "cmaketarget.h"
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/qtcassert.h>
......@@ -46,25 +47,17 @@ const char * const CMAKE_BC_ID("CMakeProjectManager.CMakeBuildConfiguration");
const char * const USER_ENVIRONMENT_CHANGES_KEY("CMakeProjectManager.CMakeBuildConfiguration.UserEnvironmentChanges");
const char * const MSVC_VERSION_KEY("CMakeProjectManager.CMakeBuildConfiguration.MsvcVersion");
const char * const BUILD_DIRECTORY_KEY("CMakeProjectManager.CMakeBuildConfiguration.BuildDirectory");
} // namespace
}
CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeProject *project) :
BuildConfiguration(project, QLatin1String(CMAKE_BC_ID)),
m_toolChain(0),
m_clearSystemEnvironment(false)
{
}
CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeProject *project, const QString &id) :
BuildConfiguration(project, id),
CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeTarget *parent) :
BuildConfiguration(parent, QLatin1String(CMAKE_BC_ID)),
m_toolChain(0),
m_clearSystemEnvironment(false)
{
}
CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeProject *pro, CMakeBuildConfiguration *source) :
BuildConfiguration(pro, source),
CMakeBuildConfiguration::CMakeBuildConfiguration(CMakeTarget *parent, CMakeBuildConfiguration *source) :
BuildConfiguration(parent, source),
m_toolChain(0),
m_clearSystemEnvironment(source->m_clearSystemEnvironment),
m_userEnvironmentChanges(source->m_userEnvironmentChanges),
......@@ -97,9 +90,9 @@ CMakeBuildConfiguration::~CMakeBuildConfiguration()
delete m_toolChain;
}
CMakeProject *CMakeBuildConfiguration::cmakeProject() const
CMakeTarget *CMakeBuildConfiguration::cmakeTarget() const
{
return static_cast<CMakeProject *>(project());
return static_cast<CMakeTarget *>(target());
}
ProjectExplorer::Environment CMakeBuildConfiguration::baseEnvironment() const
......@@ -155,7 +148,7 @@ QString CMakeBuildConfiguration::buildDirectory() const
{
QString buildDirectory = m_buildDirectory;
if (buildDirectory.isEmpty())
buildDirectory = cmakeProject()->sourceDirectory() + "/qtcreator-build";
buildDirectory = cmakeTarget()->cmakeProject()->sourceDirectory() + "/qtcreator-build";
return buildDirectory;
}
......@@ -230,9 +223,9 @@ CMakeBuildConfigurationFactory::~CMakeBuildConfigurationFactory()
{
}
QStringList CMakeBuildConfigurationFactory::availableCreationIds(ProjectExplorer::Project *parent) const
QStringList CMakeBuildConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
{
if (!qobject_cast<CMakeProject *>(parent))
if (!qobject_cast<CMakeTarget *>(parent))
return QStringList();
return QStringList() << QLatin1String(CMAKE_BC_ID);
}
......@@ -244,22 +237,22 @@ QString CMakeBuildConfigurationFactory::displayNameForId(const QString &id) cons
return QString();
}
bool CMakeBuildConfigurationFactory::canCreate(ProjectExplorer::Project *parent, const QString &id) const
bool CMakeBuildConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const QString &id) const
{
if (!qobject_cast<CMakeProject *>(parent))
if (!qobject_cast<CMakeTarget *>(parent))
return false;
if (id == QLatin1String(CMAKE_BC_ID))
return true;
return false;
}
ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer::Project *parent, const QString &id)
CMakeBuildConfiguration *CMakeBuildConfigurationFactory::create(ProjectExplorer::Target *parent, const QString &id)
{
if (!canCreate(parent, id))
return 0;
CMakeProject *cmProject = static_cast<CMakeProject *>(parent);
Q_ASSERT(cmProject);
CMakeTarget *cmtarget = static_cast<CMakeTarget *>(parent);
Q_ASSERT(cmtarget);
//TODO configuration name should be part of the cmakeopenprojectwizard
bool ok;
......@@ -271,7 +264,7 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
&ok);
if (!ok || buildConfigurationName.isEmpty())
return false;
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(cmProject);
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(cmtarget);
bc->setDisplayName(buildConfigurationName);
MakeStep *makeStep = new MakeStep(bc);
......@@ -282,53 +275,53 @@ ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::create(Proj
cleanMakeStep->setAdditionalArguments(QStringList() << "clean");
cleanMakeStep->setClean(true);
CMakeOpenProjectWizard copw(cmProject->projectManager(),
cmProject->sourceDirectory(),
CMakeOpenProjectWizard copw(cmtarget->cmakeProject()->projectManager(),
cmtarget->cmakeProject()->sourceDirectory(),
bc->buildDirectory(),
bc->environment());
if (copw.exec() != QDialog::Accepted) {
delete bc;
return false;
}
cmProject->addBuildConfiguration(bc); // this also makes the name unique
cmtarget->addBuildConfiguration(bc); // this also makes the name unique
bc->setBuildDirectory(copw.buildDirectory());
bc->setMsvcVersion(copw.msvcVersion());
cmProject->parseCMakeLists();
cmtarget->cmakeProject()->parseCMakeLists();
// Default to all
if (cmProject->hasBuildTarget("all"))
if (cmtarget->cmakeProject()->hasBuildTarget("all"))
makeStep->setBuildTarget("all", true);
return bc;
}
bool CMakeBuildConfigurationFactory::canClone(ProjectExplorer::Project *parent, ProjectExplorer::BuildConfiguration *source) const
bool CMakeBuildConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source) const
{
return canCreate(parent, source->id());
}
ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::clone(ProjectExplorer::Project *parent, ProjectExplorer::BuildConfiguration *source)
CMakeBuildConfiguration *CMakeBuildConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source)
{
if (!canClone(parent, source))
return 0;
CMakeBuildConfiguration *old = static_cast<CMakeBuildConfiguration *>(source);
CMakeProject *cmProject(static_cast<CMakeProject *>(parent));
return new CMakeBuildConfiguration(cmProject, old);
CMakeTarget *cmtarget(static_cast<CMakeTarget *>(parent));
return new CMakeBuildConfiguration(cmtarget, old);
}
bool CMakeBuildConfigurationFactory::canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const
bool CMakeBuildConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const
{
QString id(ProjectExplorer::idFromMap(map));
return canCreate(parent, id);
}
ProjectExplorer::BuildConfiguration *CMakeBuildConfigurationFactory::restore(ProjectExplorer::Project *parent, const QVariantMap &map)
CMakeBuildConfiguration *CMakeBuildConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
{
if (!canRestore(parent, map))
return 0;
CMakeProject *cmProject(static_cast<CMakeProject *>(parent));
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(cmProject);
CMakeTarget *cmtarget(static_cast<CMakeTarget *>(parent));
CMakeBuildConfiguration *bc = new CMakeBuildConfiguration(cmtarget);
if (bc->fromMap(map))
return bc;
delete bc;
......
......@@ -36,7 +36,7 @@
namespace CMakeProjectManager {
namespace Internal {
class CMakeProject;
class CMakeTarget;
class CMakeBuildConfigurationFactory;
class CMakeBuildConfiguration : public ProjectExplorer::BuildConfiguration
......@@ -45,10 +45,10 @@ class CMakeBuildConfiguration : public ProjectExplorer::BuildConfiguration
friend class CMakeBuildConfigurationFactory;
public:
CMakeBuildConfiguration(CMakeProject *pro);
CMakeBuildConfiguration(CMakeTarget *parent);
~CMakeBuildConfiguration();
CMakeProject *cmakeProject() const;
CMakeTarget *cmakeTarget() const;
ProjectExplorer::Environment environment() const;
ProjectExplorer::Environment baseEnvironment() const;
......@@ -74,8 +74,7 @@ signals:
void msvcVersionChanged();
protected:
CMakeBuildConfiguration(CMakeProject *pro, const QString &id);
CMakeBuildConfiguration(CMakeProject *pro, CMakeBuildConfiguration *source);
CMakeBuildConfiguration(CMakeTarget *parent, CMakeBuildConfiguration *source);
virtual bool fromMap(const QVariantMap &map);
private:
......@@ -95,15 +94,15 @@ public:
CMakeBuildConfigurationFactory(QObject *parent = 0);
~CMakeBuildConfigurationFactory();
QStringList availableCreationIds(ProjectExplorer::Project *project) const;
QStringList availableCreationIds(ProjectExplorer::Target *parent) const;
QString displayNameForId(const QString &id) const;
bool canCreate(ProjectExplorer::Project *parent, const QString &id) const;
ProjectExplorer::BuildConfiguration *create(ProjectExplorer::Project *parent, const QString &id);
bool canClone(ProjectExplorer::Project *parent, ProjectExplorer::BuildConfiguration *source) const;
ProjectExplorer::BuildConfiguration *clone(ProjectExplorer::Project *parent, ProjectExplorer::BuildConfiguration *source);
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
ProjectExplorer::BuildConfiguration *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
bool canCreate(ProjectExplorer::Target *parent, const QString &id) const;
CMakeBuildConfiguration *create(ProjectExplorer::Target *parent, const QString &id);
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source) const;
CMakeBuildConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::BuildConfiguration *source);
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
CMakeBuildConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
};
} // namespace Internal
......
......@@ -33,6 +33,7 @@
#include "cmakeprojectmanager.h"
#include "cmakeprojectnodes.h"
#include "cmakebuildconfiguration.h"
#include "cmaketarget.h"
#include "makestep.h"
#include <projectexplorer/project.h>
......@@ -72,14 +73,14 @@ public:
CMakeProject(CMakeManager *manager, const QString &filename);
~CMakeProject();
CMakeBuildConfiguration *activeCMakeBuildConfiguration() const;
QString displayName() const;
QString id() const;
Core::IFile *file() const;
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
CMakeTargetFactory *targetFactory() const;
CMakeManager *projectManager() const;
CMakeTarget *activeTarget() const;
QList<ProjectExplorer::Project *> dependsOn(); //NBS TODO implement dependsOn
bool isApplication() const;
......@@ -98,10 +99,9 @@ public:
QString sourceDirectory() const;
bool parseCMakeLists();
signals:
/// convenience signal emitted if the activeBuildConfiguration emits environmentChanged
/// or if the activeBuildConfiguration changes
void environmentChanged();
/// emitted after parsing
void buildTargetsChanged();
......@@ -113,11 +113,10 @@ protected:
private slots:
void fileChanged(const QString &fileName);
void slotActiveBuildConfiguration();
void changeActiveBuildConfiguration(ProjectExplorer::BuildConfiguration*);
void targetAdded(ProjectExplorer::Target *);
private:
bool parseCMakeLists();
void buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::FileNode *> list);
void gatherFileNodes(ProjectExplorer::FolderNode *parent, QList<ProjectExplorer::FileNode *> &list);
ProjectExplorer::FolderNode *findOrCreateFolder(CMakeProjectNode *rootNode, QString directory);
......@@ -126,7 +125,6 @@ private:
QString m_fileName;
CMakeFile *m_file;
QString m_projectName;
CMakeBuildConfigurationFactory *m_buildConfigurationFactory;
// TODO probably need a CMake specific node structure
CMakeProjectNode *m_rootNode;
......@@ -135,9 +133,7 @@ private:
ProjectExplorer::FileWatcher *m_watcher;
bool m_insideFileChanged;
QSet<QString> m_watchedFiles;
CMakeBuildConfiguration *m_lastActiveBuildConfiguration;
friend class CMakeBuildConfigurationFactory; // for parseCMakeLists
CMakeTargetFactory *m_targetFactory;
};
class CMakeCbpParser : public QXmlStreamReader
......
......@@ -7,6 +7,7 @@ HEADERS = cmakeproject.h \
cmakeprojectmanager.h \
cmakeprojectconstants.h \
cmakeprojectnodes.h \
cmaketarget.h \
makestep.h \
cmakerunconfiguration.h \
cmakeopenprojectwizard.h \
......@@ -16,6 +17,7 @@ SOURCES = cmakeproject.cpp \
cmakeprojectplugin.cpp \
cmakeprojectmanager.cpp \
cmakeprojectnodes.cpp \
cmaketarget.cpp \
makestep.cpp \
cmakerunconfiguration.cpp \
cmakeopenprojectwizard.cpp \
......
......@@ -29,9 +29,10 @@
#include "cmakerunconfiguration.h"
#include "cmakeproject.h"
#include "cmakebuildconfiguration.h"
#include "cmakeproject.h"
#include "cmakeprojectconstants.h"
#include "cmaketarget.h"
#include <projectexplorer/environment.h>
#include <projectexplorer/debugginghelper.h>
......@@ -73,8 +74,8 @@ QString idFromBuildTarget(const QString &target)
} // namespace
CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &target, const QString &workingDirectory, const QString &title) :
ProjectExplorer::LocalApplicationRunConfiguration(pro, QString::fromLatin1(CMAKE_RC_PREFIX)),
CMakeRunConfiguration::CMakeRunConfiguration(CMakeTarget *parent, const QString &target, const QString &workingDirectory, const QString &title) :
ProjectExplorer::LocalApplicationRunConfiguration(parent, QString::fromLatin1(CMAKE_RC_PREFIX)),
m_runMode(Gui),
m_buildTarget(target),
m_workingDirectory(workingDirectory),
......@@ -84,8 +85,8 @@ CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, const QString &t
ctor();
}
CMakeRunConfiguration::CMakeRunConfiguration(CMakeProject *pro, CMakeRunConfiguration *source) :
ProjectExplorer::LocalApplicationRunConfiguration(pro, source),
CMakeRunConfiguration::CMakeRunConfiguration(CMakeTarget *parent, CMakeRunConfiguration *source) :
ProjectExplorer::LocalApplicationRunConfiguration(parent, source),
m_runMode(source->m_runMode),
m_buildTarget(source->m_buildTarget),
m_workingDirectory(source->m_workingDirectory),
......@@ -105,14 +106,16 @@ CMakeRunConfiguration::~CMakeRunConfiguration()
void CMakeRunConfiguration::ctor()
{
setDisplayName(m_title);
}
connect(project(), SIGNAL(environmentChanged()),
this, SIGNAL(baseEnvironmentChanged()));
CMakeTarget *CMakeRunConfiguration::cmakeTarget() const
{
return static_cast<CMakeTarget *>(target());
}
CMakeProject *CMakeRunConfiguration::cmakeProject() const
CMakeBuildConfiguration *CMakeRunConfiguration::activeBuildConfiguration() const
{
return static_cast<CMakeProject *>(project());
return cmakeTarget()->activeBuildConfiguration();
}
QString CMakeRunConfiguration::executable() const
......@@ -232,7 +235,7 @@ ProjectExplorer::Environment CMakeRunConfiguration::baseEnvironment() const
} else if (m_baseEnvironmentBase == CMakeRunConfiguration::SystemEnvironmentBase) {
env = ProjectExplorer::Environment::systemEnvironment();
} else if (m_baseEnvironmentBase == CMakeRunConfiguration::BuildEnvironmentBase) {
env = project()->activeBuildConfiguration()->environment();
env = activeBuildConfiguration()->environment();
}
return env;
}
......@@ -284,7 +287,9 @@ void CMakeRunConfiguration::setUserEnvironmentChanges(const QList<ProjectExplore
ProjectExplorer::ToolChain::ToolChainType CMakeRunConfiguration::toolChainType() const
{
CMakeBuildConfiguration *bc = cmakeProject()->activeCMakeBuildConfiguration();
CMakeBuildConfiguration *bc = activeBuildConfiguration();
if (!bc)
return ProjectExplorer::ToolChain::UNKNOWN;
return bc->toolChainType();
}
......@@ -447,13 +452,13 @@ CMakeRunConfigurationFactory::~CMakeRunConfigurationFactory()
}
// used to show the list of possible additons to a project, returns a list of ids
QStringList CMakeRunConfigurationFactory::availableCreationIds(ProjectExplorer::Project *parent) const
QStringList CMakeRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
{
CMakeProject *project(qobject_cast<CMakeProject *>(parent));
if (!project)
CMakeTarget *t(qobject_cast<CMakeTarget *>(parent));
if (!t)
return QStringList();
QStringList allIds;
foreach (const QString &buildTarget, project->buildTargetTitles())
foreach (const QString &buildTarget, t->cmakeProject()->buildTargetTitles())
allIds << idFromBuildTarget(buildTarget);
return allIds;
}
......@@ -464,55 +469,55 @@ QString CMakeRunConfigurationFactory::displayNameForId(const QString &id) const
return buildTargetFromId(id);
}
bool CMakeRunConfigurationFactory::canCreate(ProjectExplorer::Project *parent, const QString &id) const
bool CMakeRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, const QString &id) const
{
CMakeProject *project(qobject_cast<CMakeProject *>(parent));
if (!project)
CMakeTarget *t(qobject_cast<CMakeTarget *>(parent));
if (!t)
return false;
return project->hasBuildTarget(buildTargetFromId(id));
return t->cmakeProject()->hasBuildTarget(buildTargetFromId(id));
}
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::create(ProjectExplorer::Project *parent, const QString &id)
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::create(ProjectExplorer::Target *parent, const QString &id)
{
if (!canCreate(parent, id))
return 0;
CMakeProject *project(static_cast<CMakeProject *>(parent));
CMakeTarget *t(static_cast<CMakeTarget *>(parent));
const QString title(buildTargetFromId(id));
const CMakeBuildTarget &ct = project->buildTargetForTitle(title);
return new CMakeRunConfiguration(project, ct.executable, ct.workingDirectory, ct.title);
const CMakeBuildTarget &ct = t->cmakeProject()->buildTargetForTitle(title);
return new CMakeRunConfiguration(t, ct.executable, ct.workingDirectory, ct.title);
}
bool CMakeRunConfigurationFactory::canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *source) const
bool CMakeRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const
{
if (!qobject_cast<CMakeProject *>(parent))
if (!qobject_cast<CMakeTarget *>(parent))
return false;
return source->id() == QLatin1String(CMAKE_RC_ID);
}
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration * source)
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration * source)
{
if (!canClone(parent, source))
return 0;
CMakeProject *project(static_cast<CMakeProject *>(parent));
CMakeTarget *t(static_cast<CMakeTarget *>(parent));
CMakeRunConfiguration *crc(static_cast<CMakeRunConfiguration *>(source));
return new CMakeRunConfiguration(project, crc);
return new CMakeRunConfiguration(t, crc);
}
bool CMakeRunConfigurationFactory::canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const
bool CMakeRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const
{
if (!qobject_cast<CMakeProject *>(parent))
if (!qobject_cast<CMakeTarget *>(parent))
return false;
QString id(ProjectExplorer::idFromMap(map));
return id.startsWith(QLatin1String(CMAKE_RC_ID));
}
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::restore(ProjectExplorer::Project *parent, const QVariantMap &map)
ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
{
if (!canRestore(parent, map))
return 0;
CMakeProject *project(static_cast<CMakeProject *>(parent));
CMakeRunConfiguration *rc(new CMakeRunConfiguration(project, QString(), QString(), QString()));
CMakeTarget *t(static_cast<CMakeTarget *>(parent));
CMakeRunConfiguration *rc(new CMakeRunConfiguration(t, QString(), QString(), QString()));
if (rc->fromMap(map))
return rc;
delete rc;
......
......@@ -44,7 +44,8 @@ QT_END_NAMESPACE
namespace CMakeProjectManager {
namespace Internal {
class CMakeProject;
class CMakeBuildConfiguration;
class CMakeTarget;
class CMakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
{
......@@ -53,11 +54,12 @@ class CMakeRunConfiguration : public ProjectExplorer::LocalApplicationRunConfigu
friend class CMakeRunConfigurationFactory;
public:
CMakeRunConfiguration(CMakeProject *project, const QString &target,
CMakeRunConfiguration(CMakeTarget *parent, const QString &target,
const QString &workingDirectory, const QString &title);
~CMakeRunConfiguration();
CMakeProject *cmakeProject() const;
CMakeTarget *cmakeTarget() const;
CMakeBuildConfiguration *activeBuildConfiguration() const;
QString executable() const;
RunMode runMode() const;
......@@ -88,7 +90,7 @@ private slots:
void setArguments(const QString &newText);
protected:
CMakeRunConfiguration(CMakeProject *project, CMakeRunConfiguration *source);
CMakeRunConfiguration(CMakeTarget *parent, CMakeRunConfiguration *source);
virtual bool fromMap(const QVariantMap &map);
private:
......@@ -150,17 +152,15 @@ class CMakeRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFa
public:
explicit CMakeRunConfigurationFactory(QObject *parent = 0);
~CMakeRunConfigurationFactory();
// used to recreate the runConfigurations when restoring settings
bool canCreate(ProjectExplorer::Project *project, const QString &id) const;
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Project *project, const QString &id);
bool canRestore(ProjectExplorer::Project *parent, const QVariantMap &map) const;
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Project *parent, const QVariantMap &map);
bool canClone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *product) const;
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Project *parent, ProjectExplorer::RunConfiguration *product);
// used to show the list of possible additons to a project, returns a list of types
QStringList availableCreationIds(ProjectExplorer::Project *pro) const;
// used to translate the types to names to display to the user
bool canCreate(ProjectExplorer::Target *parent, const QString &id) const;
ProjectExplorer::RunConfiguration *create(ProjectExplorer::Target *parent, const QString &id);
bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const;
ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map);
bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const;
ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product);
QStringList availableCreationIds(ProjectExplorer::Target *parent) const;
QString displayNameForId(const QString &id) const;
};
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements