forked from qt-creator/qt-creator
Profile introduction
Introduce Profiles to store sets of values that describe a system/device. These profiles are held by a target, getting rid of much of the information stored in the Build-/Run-/DeployConfigurations, greatly simplifying those. This is a squash of the wip/profile branch which has been on gerrit for a while, rebased to current master. Change-Id: I25956c8dd4d1962b2134bfaa8a8076ae3909460f Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -35,10 +35,14 @@
|
||||
#include "buildmanager.h"
|
||||
#include "buildsteplist.h"
|
||||
#include "buildstepspage.h"
|
||||
#include "profileinformation.h"
|
||||
#include "project.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "target.h"
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
@@ -59,7 +63,7 @@ DeployConfiguration::DeployConfiguration(Target *target, const Core::Id id) :
|
||||
//: Display name of the deploy build step list. Used as part of the labels in the project window.
|
||||
m_stepList->setDefaultDisplayName(tr("Deploy"));
|
||||
//: Default DeployConfiguration display name
|
||||
setDefaultDisplayName(tr("No deployment"));
|
||||
setDefaultDisplayName(tr("Deploy locally"));
|
||||
}
|
||||
|
||||
DeployConfiguration::DeployConfiguration(Target *target, DeployConfiguration *source) :
|
||||
@@ -153,14 +157,15 @@ void DeployConfiguration::cloneSteps(DeployConfiguration *source)
|
||||
|
||||
DeployConfigurationFactory::DeployConfigurationFactory(QObject *parent) :
|
||||
QObject(parent)
|
||||
{ }
|
||||
{ setObjectName(QLatin1String("DeployConfigurationFactory")); }
|
||||
|
||||
DeployConfigurationFactory::~DeployConfigurationFactory()
|
||||
{ }
|
||||
|
||||
QList<Core::Id> DeployConfigurationFactory::availableCreationIds(Target *parent) const
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
if (!canHandle(parent))
|
||||
return QList<Core::Id>();
|
||||
return QList<Core::Id>() << Core::Id(Constants::DEFAULT_DEPLOYCONFIGURATION_ID);
|
||||
}
|
||||
|
||||
@@ -174,7 +179,8 @@ QString DeployConfigurationFactory::displayNameForId(const Core::Id id) const
|
||||
|
||||
bool DeployConfigurationFactory::canCreate(Target *parent, const Core::Id id) const
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
if (!canHandle(parent))
|
||||
return false;
|
||||
return id == Core::Id(Constants::DEFAULT_DEPLOYCONFIGURATION_ID);
|
||||
}
|
||||
|
||||
@@ -214,6 +220,35 @@ DeployConfiguration *DeployConfigurationFactory::clone(Target *parent, DeployCon
|
||||
return new DeployConfiguration(parent, product);
|
||||
}
|
||||
|
||||
DeployConfigurationFactory *DeployConfigurationFactory::find(Target *parent, const QVariantMap &map)
|
||||
{
|
||||
QList<DeployConfigurationFactory *> factories
|
||||
= ExtensionSystem::PluginManager::instance()->getObjects<DeployConfigurationFactory>();
|
||||
foreach (DeployConfigurationFactory *factory, factories) {
|
||||
if (factory->canRestore(parent, map))
|
||||
return factory;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
DeployConfigurationFactory *DeployConfigurationFactory::find(Target *parent)
|
||||
{
|
||||
QList<DeployConfigurationFactory *> factories
|
||||
= ExtensionSystem::PluginManager::instance()->getObjects<DeployConfigurationFactory>();
|
||||
foreach (DeployConfigurationFactory *factory, factories) {
|
||||
if (!factory->availableCreationIds(parent).isEmpty())
|
||||
return factory;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool DeployConfigurationFactory::canHandle(Target *parent) const
|
||||
{
|
||||
if (!parent->project()->supportsProfile(parent->profile()))
|
||||
return false;
|
||||
return DeviceTypeProfileInformation::deviceTypeId(parent->profile()) == Core::Id(Constants::DESKTOP_DEVICE_TYPE);
|
||||
}
|
||||
|
||||
///
|
||||
// DeployConfigurationWidget
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user