forked from qt-creator/qt-creator
Start making the Maemo support more generic.
This includes:
- decoupling deploy configurations from targets (Reviewed-by: dt)
- adding a "Generic Linux" device type
- splitting up the Maemo deployment step into small pieces that
can be combined in different ways (and much more easily maintained)
- adding a new version handler for pro.user files
(Reviewed-by: Tobias Hunger)
Also:
- Add and use an SSH manager class for easier connection sharing.
- Make the SSH connection parameters a fixed attribute of the connection.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include "toolchainmanager.h"
|
||||
|
||||
#include <limits>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
@@ -69,6 +70,9 @@ namespace ProjectExplorer {
|
||||
class TargetPrivate {
|
||||
public:
|
||||
TargetPrivate();
|
||||
|
||||
QList<DeployConfigurationFactory *> deployFactories() const;
|
||||
|
||||
bool m_isEnabled;
|
||||
QIcon m_icon;
|
||||
QIcon m_overlayIcon;
|
||||
@@ -90,6 +94,11 @@ TargetPrivate::TargetPrivate() :
|
||||
{
|
||||
}
|
||||
|
||||
QList<DeployConfigurationFactory *> TargetPrivate::deployFactories() const
|
||||
{
|
||||
return ExtensionSystem::PluginManager::instance()->getObjects<DeployConfigurationFactory>();
|
||||
}
|
||||
|
||||
|
||||
Target::Target(Project *project, const QString &id) :
|
||||
ProjectConfiguration(project, id), d(new TargetPrivate)
|
||||
@@ -199,7 +208,7 @@ void Target::addDeployConfiguration(DeployConfiguration *dc)
|
||||
QTC_ASSERT(dc && !d->m_deployConfigurations.contains(dc), return);
|
||||
Q_ASSERT(dc->target() == this);
|
||||
|
||||
if (!deployConfigurationFactory())
|
||||
if (d->deployFactories().isEmpty())
|
||||
return;
|
||||
|
||||
// Check that we don't have a configuration with the same displayName
|
||||
@@ -260,6 +269,32 @@ void Target::setActiveDeployConfiguration(DeployConfiguration *dc)
|
||||
}
|
||||
}
|
||||
|
||||
QStringList Target::availableDeployConfigurationIds()
|
||||
{
|
||||
QStringList ids;
|
||||
foreach (const DeployConfigurationFactory * const factory, d->deployFactories())
|
||||
ids << factory->availableCreationIds(this);
|
||||
return ids;
|
||||
}
|
||||
|
||||
QString Target::displayNameForDeployConfigurationId(const QString &id)
|
||||
{
|
||||
foreach (const DeployConfigurationFactory * const factory, d->deployFactories()) {
|
||||
if (factory->availableCreationIds(this).contains(id))
|
||||
return factory->displayNameForId(id);
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
DeployConfiguration *Target::createDeployConfiguration(const QString &id)
|
||||
{
|
||||
foreach (DeployConfigurationFactory * const factory, d->deployFactories()) {
|
||||
if (factory->canCreate(this, id))
|
||||
return factory->create(this, id);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QList<RunConfiguration *> Target::runConfigurations() const
|
||||
{
|
||||
return d->m_runConfigurations;
|
||||
@@ -451,15 +486,20 @@ bool Target::fromMap(const QVariantMap &map)
|
||||
if (!map.contains(key))
|
||||
return false;
|
||||
DeployConfiguration *dc = 0;
|
||||
if (deployConfigurationFactory())
|
||||
dc = deployConfigurationFactory()->restore(this, map.value(key).toMap());
|
||||
foreach (DeployConfigurationFactory * const factory, d->deployFactories()) {
|
||||
QVariantMap valueMap = map.value(key).toMap();
|
||||
if (factory->canRestore(this, valueMap)) {
|
||||
dc = factory->restore(this, valueMap);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!dc)
|
||||
continue;
|
||||
addDeployConfiguration(dc);
|
||||
if (i == activeConfiguration)
|
||||
setActiveDeployConfiguration(dc);
|
||||
}
|
||||
if (deployConfigurations().isEmpty() && deployConfigurationFactory())
|
||||
if (deployConfigurations().isEmpty() && d->deployFactories().isEmpty())
|
||||
return false;
|
||||
|
||||
int rcCount(map.value(QLatin1String(RC_COUNT_KEY), 0).toInt(&ok));
|
||||
|
||||
Reference in New Issue
Block a user