Commit 53e2cbfb authored by Christian Kandeler's avatar Christian Kandeler
Browse files

RemoteLinux: Move some stuff into the new target base class.



All these things were always conceptually per-target, but due to not
having a common target class we had to awkwardly implement the concept
using shared pointers.

Change-Id: I1bb1992a230a485d519a892a6ca602a6846fc3cf
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 7e9e3a81
......@@ -471,7 +471,7 @@ AbstractRemoteLinuxDeployService *MaemoCopyFilesViaMountStep::deployService() co
bool MaemoCopyFilesViaMountStep::initInternal(QString *error)
{
QList<DeployableFile> deployableFiles;
const QSharedPointer<DeploymentInfo> deploymentInfo = deployConfiguration()->deploymentInfo();
const DeploymentInfo * const deploymentInfo = deployConfiguration()->deploymentInfo();
const int deployableCount = deploymentInfo->deployableCount();
for (int i = 0; i < deployableCount; ++i)
deployableFiles << deploymentInfo->deployableAt(i);
......
......@@ -87,7 +87,7 @@ void MaemoDeployConfigurationWidget::init(DeployConfiguration *dc)
m_remoteLinuxWidget->init(dc);
connect(ui->addDesktopFileButton, SIGNAL(clicked()), SLOT(addDesktopFile()));
connect(ui->addIconButton, SIGNAL(clicked()), SLOT(addIcon()));
connect(deployConfiguration()->deploymentInfo().data(), SIGNAL(modelAboutToBeReset()),
connect(deployConfiguration()->deploymentInfo(), SIGNAL(modelAboutToBeReset()),
SLOT(handleDeploymentInfoToBeReset()));
}
......@@ -144,7 +144,8 @@ void MaemoDeployConfigurationWidget::addDesktopFile()
void MaemoDeployConfigurationWidget::addIcon()
{
DeployableFilesPerProFile * const proFileInfo = m_remoteLinuxWidget->currentModel();
const int iconDim = MaemoGlobal::applicationIconSize(deployConfiguration()->supportedOsType());
const int iconDim
= MaemoGlobal::applicationIconSize(deployConfiguration()->target()->supportedOsType());
const QString origFilePath = QFileDialog::getOpenFileName(this,
tr("Choose Icon (will be scaled to %1x%1 pixels, if necessary)").arg(iconDim),
proFileInfo->projectDir(), QLatin1String("(*.png)"));
......@@ -207,7 +208,7 @@ QString MaemoDeployConfigurationWidget::remoteIconFilePath(const DeployableFiles
QString MaemoDeployConfigurationWidget::remoteIconDir() const
{
return QString::fromLatin1("/usr/share/icons/hicolor/%1x%1/apps")
.arg(MaemoGlobal::applicationIconSize(deployConfiguration()->supportedOsType()));
.arg(MaemoGlobal::applicationIconSize(deployConfiguration()->target()->supportedOsType()));
}
} // namespace Internal
......
......@@ -329,7 +329,7 @@ bool MaemoCopyToSysrootStep::init()
}
m_systemRoot = qtVersion->systemRoot();
const QSharedPointer<DeploymentInfo> deploymentInfo
const DeploymentInfo * const deploymentInfo
= static_cast<RemoteLinuxDeployConfiguration *>(deployConfiguration())->deploymentInfo();
m_files.clear();
for (int i = 0; i < deploymentInfo->deployableCount(); ++i)
......
......@@ -536,8 +536,7 @@ bool MaemoPublisherFremantleFree::updateDesktopFiles(QString *error) const
bool success = true;
const Qt4MaemoDeployConfiguration * const deployConfig
= qobject_cast<Qt4MaemoDeployConfiguration *>(m_buildConfig->target()->activeDeployConfiguration());
const QSharedPointer<DeploymentInfo> deploymentInfo
= deployConfig->deploymentInfo();
const DeploymentInfo * const deploymentInfo = deployConfig->deploymentInfo();
for (int i = 0; i < deploymentInfo->modelCount(); ++i) {
const DeployableFilesPerProFile * const model = deploymentInfo->modelAt(i);
QString desktopFilePath = deployConfig->localDesktopFilePath(model);
......
......@@ -61,8 +61,8 @@ const QString OldDeployConfigId = QLatin1String("2.2MaemoDeployConfig");
} // namespace
Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target,
const QString &id, const QString &displayName, const QString &supportedOsType)
: RemoteLinuxDeployConfiguration(target, id, displayName, supportedOsType)
const QString &id, const QString &displayName)
: RemoteLinuxDeployConfiguration(target, id, displayName)
{
const QList<DeployConfiguration *> &deployConfigs = target->deployConfigurations();
foreach (const DeployConfiguration * const dc, deployConfigs) {
......@@ -75,6 +75,7 @@ Qt4MaemoDeployConfiguration::Qt4MaemoDeployConfiguration(ProjectExplorer::Target
}
if (!m_deploymentSettingsAssistant) {
QString qmakeScope;
const QString supportedOsType = this->target()->supportedOsType();
if (supportedOsType == QLatin1String(Maemo5OsType))
qmakeScope = QLatin1String("maemo5");
else if (supportedOsType == QLatin1String(HarmattanOsType))
......@@ -184,25 +185,20 @@ DeployConfiguration *Qt4MaemoDeployConfigurationFactory::create(Target *parent,
{
Q_ASSERT(canCreate(parent, id));
DeployConfiguration *dc = 0;
const QString displayName = displayNameForId(id);
DeployConfiguration * const dc = new Qt4MaemoDeployConfiguration(parent, id, displayName);
if (id == Qt4MaemoDeployConfiguration::fremantleWithoutPackagingId()) {
dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, QLatin1String(Maemo5OsType));
dc->stepList()->insertStep(0, new MaemoMakeInstallToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoCopyFilesViaMountStep(dc->stepList()));
} else if (id == Qt4MaemoDeployConfiguration::fremantleWithPackagingId()) {
dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, QLatin1String(Maemo5OsType));
dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(2, new MaemoInstallPackageViaMountStep(dc->stepList()));
} else if (id == Qt4MaemoDeployConfiguration::harmattanId()) {
dc = new Qt4MaemoDeployConfiguration(parent, id, displayName,
QLatin1String(HarmattanOsType));
dc->stepList()->insertStep(0, new MaemoDebianPackageCreationStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoInstallDebianPackageToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(2, new MaemoUploadAndInstallPackageStep(dc->stepList()));
} else if (id == Qt4MaemoDeployConfiguration::meegoId()) {
dc = new Qt4MaemoDeployConfiguration(parent, id, displayName, QLatin1String(MeeGoOsType));
dc->stepList()->insertStep(0, new MaemoRpmPackageCreationStep(dc->stepList()));
dc->stepList()->insertStep(1, new MaemoInstallRpmPackageToSysrootStep(dc->stepList()));
dc->stepList()->insertStep(2, new MeegoUploadAndInstallPackageStep(dc->stepList()));
......
......@@ -83,7 +83,7 @@ private:
friend class Internal::Qt4MaemoDeployConfigurationFactory;
Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target, const QString &id,
const QString &displayName, const QString &supportedOsType);
const QString &displayName);
Qt4MaemoDeployConfiguration(ProjectExplorer::Target *target,
Qt4MaemoDeployConfiguration *source);
......
......@@ -32,6 +32,7 @@
#include "qt4maemotarget.h"
#include "maemoconstants.h"
#include "maemoglobal.h"
#include "maemopackagecreationstep.h"
#include "maemorunconfiguration.h"
......@@ -118,8 +119,9 @@ bool adaptTagValue(QByteArray &document, const QByteArray &fieldName,
} // anonymous namespace
AbstractQt4MaemoTarget::AbstractQt4MaemoTarget(Qt4Project *parent, const QString &id) :
AbstractEmbeddedLinuxTarget(parent, id),
AbstractQt4MaemoTarget::AbstractQt4MaemoTarget(Qt4Project *parent, const QString &id,
const QString &supportedOsType) :
AbstractEmbeddedLinuxTarget(parent, id, supportedOsType),
m_filesWatcher(new Utils::FileSystemWatcher(this)),
m_isInitialized(false)
{
......@@ -369,7 +371,8 @@ void AbstractQt4MaemoTarget::raiseError(const QString &reason)
}
AbstractDebBasedQt4MaemoTarget::AbstractDebBasedQt4MaemoTarget(Qt4Project *parent,
const QString &id) : AbstractQt4MaemoTarget(parent, id)
const QString &id, const QString &supportedOsType)
: AbstractQt4MaemoTarget(parent, id, supportedOsType)
{
}
......@@ -951,7 +954,8 @@ QString AbstractDebBasedQt4MaemoTarget::shortDayOfWeekName(const QDateTime &dt)
AbstractRpmBasedQt4MaemoTarget::AbstractRpmBasedQt4MaemoTarget(Qt4Project *parent,
const QString &id) : AbstractQt4MaemoTarget(parent, id)
const QString &id, const QString &supportedOsType)
: AbstractQt4MaemoTarget(parent, id, supportedOsType)
{
}
......@@ -1116,7 +1120,7 @@ bool AbstractRpmBasedQt4MaemoTarget::setValueForTag(const QByteArray &tag,
}
Qt4Maemo5Target::Qt4Maemo5Target(Qt4Project *parent, const QString &id)
: AbstractDebBasedQt4MaemoTarget(parent, id)
: AbstractDebBasedQt4MaemoTarget(parent, id, QLatin1String(Maemo5OsType))
{
setDisplayName(defaultDisplayName());
}
......@@ -1155,7 +1159,7 @@ QByteArray Qt4Maemo5Target::defaultSection() const
}
Qt4HarmattanTarget::Qt4HarmattanTarget(Qt4Project *parent, const QString &id)
: AbstractDebBasedQt4MaemoTarget(parent, id)
: AbstractDebBasedQt4MaemoTarget(parent, id, QLatin1String(HarmattanOsType))
{
setDisplayName(defaultDisplayName());
}
......@@ -1223,7 +1227,7 @@ QByteArray Qt4HarmattanTarget::defaultSection() const
Qt4MeegoTarget::Qt4MeegoTarget(Qt4Project *parent, const QString &id)
: AbstractRpmBasedQt4MaemoTarget(parent, id)
: AbstractRpmBasedQt4MaemoTarget(parent, id, QLatin1String(MeeGoOsType))
{
setDisplayName(defaultDisplayName());
}
......
......@@ -58,8 +58,8 @@ class AbstractQt4MaemoTarget : public RemoteLinux::AbstractEmbeddedLinuxTarget
friend class Qt4MaemoTargetFactory;
Q_OBJECT
public:
explicit AbstractQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent,
const QString &id);
explicit AbstractQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
const QString &supportedOsType);
virtual ~AbstractQt4MaemoTarget();
void createApplicationProFiles(bool reparse);
......@@ -116,8 +116,8 @@ class AbstractDebBasedQt4MaemoTarget : public AbstractQt4MaemoTarget
{
Q_OBJECT
public:
AbstractDebBasedQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent,
const QString &id);
AbstractDebBasedQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
const QString &supportedOsType);
~AbstractDebBasedQt4MaemoTarget();
QString debianDirPath() const;
......@@ -189,8 +189,8 @@ class AbstractRpmBasedQt4MaemoTarget : public AbstractQt4MaemoTarget
{
Q_OBJECT
public:
AbstractRpmBasedQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent,
const QString &id);
AbstractRpmBasedQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
const QString &supportedOsType);
~AbstractRpmBasedQt4MaemoTarget();
virtual bool allowsRemoteMounts() const { return false; }
......
......@@ -31,6 +31,9 @@
**************************************************************************/
#include "abstractembeddedlinuxtarget.h"
#include "deploymentinfo.h"
#include "typespecificdeviceconfigurationlistmodel.h"
#include <qt4projectmanager/qt4buildconfiguration.h>
using namespace ProjectExplorer;
......@@ -38,8 +41,13 @@ using namespace Qt4ProjectManager;
namespace RemoteLinux {
AbstractEmbeddedLinuxTarget::AbstractEmbeddedLinuxTarget(Qt4Project *parent, const QString &id) :
Qt4BaseTarget(parent, id), m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this))
AbstractEmbeddedLinuxTarget::AbstractEmbeddedLinuxTarget(Qt4Project *parent, const QString &id,
const QString &supportedOsType) :
Qt4BaseTarget(parent, id),
m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this)),
m_supportedOsType(supportedOsType),
m_deploymentInfo(new DeploymentInfo(this)),
m_deviceConfigModel(new Internal::TypeSpecificDeviceConfigurationListModel(supportedOsType, this))
{
}
......
......@@ -36,22 +36,35 @@
#include <qt4projectmanager/qt4target.h>
#include <QString>
namespace ProjectExplorer { class IBuildConfigurationFactory; }
namespace Qt4ProjectManager { class Qt4BuildConfigurationFactory; }
namespace RemoteLinux {
class DeploymentInfo;
namespace Internal { class TypeSpecificDeviceConfigurationListModel; }
class REMOTELINUX_EXPORT AbstractEmbeddedLinuxTarget : public Qt4ProjectManager::Qt4BaseTarget
{
Q_OBJECT
public:
AbstractEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id);
AbstractEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
const QString &supportedOsType);
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
QString supportedOsType() const { return m_supportedOsType; }
DeploymentInfo *deploymentInfo() const { return m_deploymentInfo; }
Internal::TypeSpecificDeviceConfigurationListModel *deviceConfigModel() const {
return m_deviceConfigModel;
}
private:
Qt4ProjectManager::Qt4BuildConfigurationFactory *m_buildConfigurationFactory;
Qt4ProjectManager::Qt4BuildConfigurationFactory * const m_buildConfigurationFactory;
const QString m_supportedOsType;
DeploymentInfo * const m_deploymentInfo;
Internal::TypeSpecificDeviceConfigurationListModel * const m_deviceConfigModel;
};
} // namespace RemoteLinux
......
......@@ -130,7 +130,7 @@ RemoteLinuxDeployConfiguration *AbstractPackagingStep::deployConfiguration() con
bool AbstractPackagingStep::isPackagingNeeded() const
{
const QSharedPointer<DeploymentInfo> &deploymentInfo = deployConfiguration()->deploymentInfo();
const DeploymentInfo * const deploymentInfo = deployConfiguration()->deploymentInfo();
QFileInfo packageInfo(packageFilePath());
if (!packageInfo.exists() || deploymentInfo->isModified())
return true;
......
......@@ -31,13 +31,13 @@
#include "deploymentinfo.h"
#include "abstractembeddedlinuxtarget.h"
#include "deployablefile.h"
#include "deployablefilesperprofile.h"
#include <projectexplorer/buildstep.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4target.h>
#include <QtCore/QList>
#include <QtCore/QTimer>
......@@ -49,16 +49,17 @@ namespace Internal {
class DeploymentInfoPrivate
{
public:
DeploymentInfoPrivate(const Qt4BaseTarget *target) : target(target) {}
DeploymentInfoPrivate(const AbstractEmbeddedLinuxTarget *target) : target(target) {}
QList<DeployableFilesPerProFile *> listModels;
const Qt4ProjectManager::Qt4BaseTarget * const target;
const AbstractEmbeddedLinuxTarget * const target;
};
} // namespace Internal
using namespace Internal;
DeploymentInfo::DeploymentInfo(const Qt4BaseTarget *target) : d(new DeploymentInfoPrivate(target))
DeploymentInfo::DeploymentInfo(const AbstractEmbeddedLinuxTarget *target)
: d(new DeploymentInfoPrivate(target))
{
connect (d->target->qt4Project(), SIGNAL(proParsingDone()), SLOT(createModels()));
createModels();
......
......@@ -36,12 +36,10 @@
#include <QtCore/QAbstractListModel>
namespace Qt4ProjectManager {
class Qt4BaseTarget;
class Qt4ProFileNode;
} // namespace Qt4ProjectManager
namespace Qt4ProjectManager { class Qt4ProFileNode; }
namespace RemoteLinux {
class AbstractEmbeddedLinuxTarget;
class DeployableFile;
class DeployableFilesPerProFile;
......@@ -53,7 +51,7 @@ class REMOTELINUX_EXPORT DeploymentInfo : public QAbstractListModel
{
Q_OBJECT
public:
DeploymentInfo(const Qt4ProjectManager::Qt4BaseTarget *target);
DeploymentInfo(const AbstractEmbeddedLinuxTarget *target);
~DeploymentInfo();
void setUnmodified();
......
......@@ -61,14 +61,14 @@ class DeploymentSettingsAssistantInternal
{
public:
DeploymentSettingsAssistantInternal(const QString &qmakeScope, const QString &installPrefix,
const QSharedPointer<DeploymentInfo> &deploymentInfo)
DeploymentInfo *deploymentInfo)
: qmakeScope(qmakeScope), installPrefix(installPrefix), deploymentInfo(deploymentInfo)
{
}
const QString qmakeScope;
const QString installPrefix;
const QSharedPointer<DeploymentInfo> deploymentInfo;
DeploymentInfo * const deploymentInfo;
UpdateSettingsMap updateSettings;
};
......@@ -77,12 +77,11 @@ public:
using namespace Internal;
DeploymentSettingsAssistant::DeploymentSettingsAssistant(const QString &qmakeScope,
const QString &installPrefix, const QSharedPointer<DeploymentInfo> &deploymentInfo,
QObject *parent)
const QString &installPrefix, DeploymentInfo *deploymentInfo, QObject *parent)
: QObject(parent),
d(new DeploymentSettingsAssistantInternal(qmakeScope, installPrefix, deploymentInfo))
{
connect(d->deploymentInfo.data(), SIGNAL(modelReset()), SLOT(handleDeploymentInfoUpdated()));
connect(d->deploymentInfo, SIGNAL(modelReset()), SLOT(handleDeploymentInfoUpdated()));
}
DeploymentSettingsAssistant::~DeploymentSettingsAssistant()
......
......@@ -34,7 +34,6 @@
#include "remotelinux_export.h"
#include <QtCore/QObject>
#include <QtCore/QSharedPointer>
#include <QtCore/QStringList>
namespace RemoteLinux {
......@@ -51,8 +50,8 @@ class REMOTELINUX_EXPORT DeploymentSettingsAssistant : public QObject
Q_OBJECT
Q_DISABLE_COPY(DeploymentSettingsAssistant)
public:
DeploymentSettingsAssistant(const QString &qmakeScope, const QString &iunstallPrefix,
const QSharedPointer<DeploymentInfo> &deploymentInfo, QObject *parent = 0);
DeploymentSettingsAssistant(const QString &qmakeScope, const QString &installPrefix,
DeploymentInfo *deploymentInfo, QObject *parent = 0);
~DeploymentSettingsAssistant();
bool addDeployableToProFile(const DeployableFilesPerProFile *proFileInfo,
......
......@@ -112,7 +112,7 @@ BuildStepConfigWidget *GenericDirectUploadStep::createConfigWidget()
bool GenericDirectUploadStep::initInternal(QString *error)
{
QList<DeployableFile> deployableFiles;
const QSharedPointer<DeploymentInfo> deploymentInfo = deployConfiguration()->deploymentInfo();
const DeploymentInfo * const deploymentInfo = deployConfiguration()->deploymentInfo();
const int deployableCount = deploymentInfo->deployableCount();
for (int i = 0; i < deployableCount; ++i)
deployableFiles << deploymentInfo->deployableAt(i);
......
......@@ -47,7 +47,8 @@ namespace RemoteLinux {
namespace Internal {
GenericEmbeddedLinuxTarget::GenericEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent,
const QString &id) : AbstractEmbeddedLinuxTarget(parent, id)
const QString &id) :
AbstractEmbeddedLinuxTarget(parent, id, QLatin1String(Constants::GenericLinuxOsType))
{
setDisplayName(tr("Embedded Linux"));
}
......
......@@ -31,6 +31,7 @@
**************************************************************************/
#include "remotelinuxdeployconfiguration.h"
#include "abstractembeddedlinuxtarget.h"
#include "deploymentinfo.h"
#include "linuxdeviceconfigurations.h"
#include "remotelinuxdeployconfigurationwidget.h"
......@@ -50,10 +51,7 @@ const char DeviceIdKey[] = "Qt4ProjectManager.MaemoRunConfiguration.DeviceId";
class RemoteLinuxDeployConfigurationPrivate
{
public:
QSharedPointer<DeploymentInfo> deploymentInfo;
QSharedPointer<Internal::TypeSpecificDeviceConfigurationListModel> devConfModel;
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration;
QString supportedOsType;
};
} // namespace Internal
......@@ -61,33 +59,11 @@ public:
using namespace Internal;
RemoteLinuxDeployConfiguration::RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target,
const QString &id, const QString &defaultDisplayName, const QString &supportedOsType)
const QString &id, const QString &defaultDisplayName)
: DeployConfiguration(target, id), d(new RemoteLinuxDeployConfigurationPrivate)
{
d->supportedOsType = supportedOsType;
setDefaultDisplayName(defaultDisplayName);
// A DeploymentInfo object is only dependent on the active build
// configuration and therefore can (and should) be shared among all
// deploy configurations. The per-target device configurations model is
// similarly only dependent on the target.
const QList<DeployConfiguration *> &deployConfigs
= this->target()->deployConfigurations();
foreach (const DeployConfiguration * const dc, deployConfigs) {
const RemoteLinuxDeployConfiguration * const mdc
= qobject_cast<const RemoteLinuxDeployConfiguration *>(dc);
if (mdc) {
d->deploymentInfo = mdc->deploymentInfo();
d->devConfModel = mdc->d->devConfModel;
break;
}
}
if (!d->deploymentInfo) {
d->deploymentInfo = QSharedPointer<DeploymentInfo>(new DeploymentInfo(qobject_cast<Qt4BaseTarget *>(target)));
d->devConfModel = QSharedPointer<TypeSpecificDeviceConfigurationListModel>
(new TypeSpecificDeviceConfigurationListModel(supportedOsType));
}
initialize();
}
......@@ -95,9 +71,6 @@ RemoteLinuxDeployConfiguration::RemoteLinuxDeployConfiguration(ProjectExplorer::
RemoteLinuxDeployConfiguration *source)
: DeployConfiguration(target, source), d(new RemoteLinuxDeployConfigurationPrivate)
{
d->supportedOsType = source->supportedOsType();
d->deploymentInfo = source->deploymentInfo();
d->devConfModel = source->deviceConfigModel();
initialize();
}
......@@ -108,8 +81,8 @@ RemoteLinuxDeployConfiguration::~RemoteLinuxDeployConfiguration()
void RemoteLinuxDeployConfiguration::initialize()
{
d->deviceConfiguration = deviceConfigModel()->defaultDeviceConfig();
connect(deviceConfigModel().data(), SIGNAL(updated()),
d->deviceConfiguration = target()->deviceConfigModel()->defaultDeviceConfig();
connect(target()->deviceConfigModel(), SIGNAL(updated()),
SLOT(handleDeviceConfigurationListUpdated()));
}
......@@ -120,7 +93,7 @@ void RemoteLinuxDeployConfiguration::handleDeviceConfigurationListUpdated()
void RemoteLinuxDeployConfiguration::setDeviceConfig(LinuxDeviceConfiguration::Id internalId)
{
d->deviceConfiguration = deviceConfigModel()->find(internalId);
d->deviceConfiguration = target()->deviceConfigModel()->find(internalId);
emit deviceConfigurationListChanged();
emit currentDeviceConfigurationChanged();
}
......@@ -144,26 +117,27 @@ QVariantMap RemoteLinuxDeployConfiguration::toMap() const
void RemoteLinuxDeployConfiguration::setDeviceConfiguration(int index)
{
const LinuxDeviceConfiguration::ConstPtr &newDevConf = deviceConfigModel()->deviceAt(index);
const LinuxDeviceConfiguration::ConstPtr &newDevConf
= target()->deviceConfigModel()->deviceAt(index);
if (d->deviceConfiguration != newDevConf) {
d->deviceConfiguration = newDevConf;
emit currentDeviceConfigurationChanged();
}
}
DeployConfigurationWidget *RemoteLinuxDeployConfiguration::configurationWidget() const
AbstractEmbeddedLinuxTarget *RemoteLinuxDeployConfiguration::target() const
{
return new RemoteLinuxDeployConfigurationWidget;
return qobject_cast<AbstractEmbeddedLinuxTarget *>(DeployConfiguration::target());
}
QSharedPointer<DeploymentInfo> RemoteLinuxDeployConfiguration::deploymentInfo() const
DeploymentInfo *RemoteLinuxDeployConfiguration::deploymentInfo() const
{
return d->deploymentInfo;
return target()->deploymentInfo();
}
QSharedPointer<TypeSpecificDeviceConfigurationListModel> RemoteLinuxDeployConfiguration::deviceConfigModel() const
DeployConfigurationWidget *RemoteLinuxDeployConfiguration::configurationWidget() const
{
return d->devConfModel;
return new RemoteLinuxDeployConfigurationWidget;
}
LinuxDeviceConfiguration::ConstPtr RemoteLinuxDeployConfiguration::deviceConfiguration() const
......@@ -171,9 +145,4 @@ LinuxDeviceConfiguration::ConstPtr RemoteLinuxDeployConfiguration::deviceConfigu
return d->deviceConfiguration;
}
QString RemoteLinuxDeployConfiguration::supportedOsType() const
{
return d->supportedOsType;
}
} // namespace RemoteLinux
......@@ -42,6 +42,7 @@
#include <QtCore/QSharedPointer>
namespace RemoteLinux {
class AbstractEmbeddedLinuxTarget;
class DeploymentInfo;
namespace Internal {
......@@ -56,7 +57,7 @@ class REMOTELINUX_EXPORT RemoteLinuxDeployConfiguration
Q_DISABLE_COPY(RemoteLinuxDeployConfiguration)
public:
RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target, const QString &id,
const QString &defaultDisplayName, const QString &supportedOsType);
const QString &defaultDisplayName);
RemoteLinuxDeployConfiguration(ProjectExplorer::Target *target,
RemoteLinuxDeployConfiguration *source);
......@@ -66,10 +67,9 @@ public:
ProjectExplorer::DeployConfigurationWidget *configurationWidget() const;
void setDeviceConfiguration(int index);
QSharedPointer<DeploymentInfo> deploymentInfo() const;
QSharedPointer<Internal::TypeSpecificDeviceConfigurationListModel> deviceConfigModel() const;
AbstractEmbeddedLinuxTarget *target() const;
DeploymentInfo *deploymentInfo() const;
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
QString supportedOsType() const;
template<class T> T *earlierBuildStep(const ProjectExplorer::BuildStep *laterBuildStep) const
{
......
......@@ -78,7 +78,7 @@ DeployConfiguration *RemoteLinuxDeployConfigurationFactory::create(Target *paren
Q_ASSERT(canCreate(parent, id));
DeployConfiguration * const dc = new RemoteLinuxDeployConfiguration(parent, id,
genericLinuxDisplayName(), QLatin1String(Constants::GenericLinuxOsType));
genericLinuxDisplayName());