forked from qt-creator/qt-creator
RemoteLinux: Make mapping between targets and devices more flexible.
Until now, the mapping was based exclusively on the device type. The new approach is more flexible and less static, allowing e.g. the set of supported devices to depend on the current build settings. Change-Id: Iec92bdf9fee647477b166f7624c2364a821e5cbd Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
@@ -147,7 +147,7 @@ void MaemoDeployConfigurationWidget::addIcon()
|
|||||||
{
|
{
|
||||||
DeployableFilesPerProFile * const proFileInfo = m_remoteLinuxWidget->currentModel();
|
DeployableFilesPerProFile * const proFileInfo = m_remoteLinuxWidget->currentModel();
|
||||||
const int iconDim
|
const int iconDim
|
||||||
= MaemoGlobal::applicationIconSize(deployConfiguration()->target()->supportedDeviceType());
|
= MaemoGlobal::applicationIconSize(deployConfiguration()->target());
|
||||||
const QString origFilePath = QFileDialog::getOpenFileName(this,
|
const QString origFilePath = QFileDialog::getOpenFileName(this,
|
||||||
tr("Choose Icon (will be scaled to %1x%1 pixels, if necessary)").arg(iconDim),
|
tr("Choose Icon (will be scaled to %1x%1 pixels, if necessary)").arg(iconDim),
|
||||||
proFileInfo->projectDir(), QLatin1String("(*.png)"));
|
proFileInfo->projectDir(), QLatin1String("(*.png)"));
|
||||||
@@ -212,7 +212,7 @@ QString MaemoDeployConfigurationWidget::remoteIconFilePath(const DeployableFiles
|
|||||||
QString MaemoDeployConfigurationWidget::remoteIconDir() const
|
QString MaemoDeployConfigurationWidget::remoteIconDir() const
|
||||||
{
|
{
|
||||||
return QString::fromLatin1("/usr/share/icons/hicolor/%1x%1/apps")
|
return QString::fromLatin1("/usr/share/icons/hicolor/%1x%1/apps")
|
||||||
.arg(MaemoGlobal::applicationIconSize(deployConfiguration()->target()->supportedDeviceType()));
|
.arg(MaemoGlobal::applicationIconSize(deployConfiguration()->target()));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "maemoconstants.h"
|
#include "maemoconstants.h"
|
||||||
#include "maemoqemumanager.h"
|
#include "maemoqemumanager.h"
|
||||||
|
#include "qt4maemotarget.h"
|
||||||
|
|
||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
#include <qtsupport/baseqtversion.h>
|
#include <qtsupport/baseqtversion.h>
|
||||||
@@ -127,9 +128,9 @@ QString MaemoGlobal::devrootshPath()
|
|||||||
return QLatin1String("/usr/lib/mad-developer/devrootsh");
|
return QLatin1String("/usr/lib/mad-developer/devrootsh");
|
||||||
}
|
}
|
||||||
|
|
||||||
int MaemoGlobal::applicationIconSize(const QString &deviceType)
|
int MaemoGlobal::applicationIconSize(const ProjectExplorer::Target *target)
|
||||||
{
|
{
|
||||||
return deviceType == QLatin1String(HarmattanOsType) ? 80 : 64;
|
return qobject_cast<const Qt4HarmattanTarget *>(target) ? 80 : 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MaemoGlobal::remoteSudo(const QString &deviceType, const QString &uname)
|
QString MaemoGlobal::remoteSudo(const QString &deviceType, const QString &uname)
|
||||||
|
|||||||
@@ -45,13 +45,9 @@ class QProcess;
|
|||||||
class QString;
|
class QString;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace QtSupport {
|
namespace QtSupport { class BaseQtVersion; }
|
||||||
class BaseQtVersion;
|
namespace RemoteLinux { class LinuxDeviceConfiguration; }
|
||||||
}
|
namespace ProjectExplorer { class Target; }
|
||||||
|
|
||||||
namespace RemoteLinux {
|
|
||||||
class LinuxDeviceConfiguration;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Madde {
|
namespace Madde {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -97,7 +93,7 @@ public:
|
|||||||
|
|
||||||
static QString homeDirOnDevice(const QString &uname);
|
static QString homeDirOnDevice(const QString &uname);
|
||||||
static QString devrootshPath();
|
static QString devrootshPath();
|
||||||
static int applicationIconSize(const QString &deviceType);
|
static int applicationIconSize(const ProjectExplorer::Target *target);
|
||||||
static QString remoteSudo(const QString &deviceType, const QString &uname);
|
static QString remoteSudo(const QString &deviceType, const QString &uname);
|
||||||
static QString remoteSourceProfilesCommand();
|
static QString remoteSourceProfilesCommand();
|
||||||
static Utils::PortList freePorts(const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
|
static Utils::PortList freePorts(const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ bool adaptTagValue(QByteArray &document, const QByteArray &fieldName,
|
|||||||
|
|
||||||
|
|
||||||
AbstractQt4MaemoTarget::AbstractQt4MaemoTarget(Qt4Project *parent, const QString &id,
|
AbstractQt4MaemoTarget::AbstractQt4MaemoTarget(Qt4Project *parent, const QString &id,
|
||||||
const QString &supportedDeviceType, const QString &qmakeScope) :
|
const QString &qmakeScope) :
|
||||||
AbstractEmbeddedLinuxTarget(parent, id, supportedDeviceType),
|
AbstractEmbeddedLinuxTarget(parent, id),
|
||||||
m_filesWatcher(new Utils::FileSystemWatcher(this)),
|
m_filesWatcher(new Utils::FileSystemWatcher(this)),
|
||||||
m_deploymentSettingsAssistant(new DeploymentSettingsAssistant(qmakeScope,
|
m_deploymentSettingsAssistant(new DeploymentSettingsAssistant(qmakeScope,
|
||||||
QLatin1String("/opt"), deploymentInfo())),
|
QLatin1String("/opt"), deploymentInfo())),
|
||||||
@@ -375,8 +375,8 @@ void AbstractQt4MaemoTarget::raiseError(const QString &reason)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AbstractDebBasedQt4MaemoTarget::AbstractDebBasedQt4MaemoTarget(Qt4Project *parent,
|
AbstractDebBasedQt4MaemoTarget::AbstractDebBasedQt4MaemoTarget(Qt4Project *parent,
|
||||||
const QString &id, const QString &supportedDeviceType, const QString &qmakeScope)
|
const QString &id, const QString &qmakeScope)
|
||||||
: AbstractQt4MaemoTarget(parent, id, supportedDeviceType, qmakeScope)
|
: AbstractQt4MaemoTarget(parent, id, qmakeScope)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -958,8 +958,8 @@ QString AbstractDebBasedQt4MaemoTarget::shortDayOfWeekName(const QDateTime &dt)
|
|||||||
|
|
||||||
|
|
||||||
AbstractRpmBasedQt4MaemoTarget::AbstractRpmBasedQt4MaemoTarget(Qt4Project *parent,
|
AbstractRpmBasedQt4MaemoTarget::AbstractRpmBasedQt4MaemoTarget(Qt4Project *parent,
|
||||||
const QString &id, const QString &supportedDeviceType, const QString &qmakeScope)
|
const QString &id, const QString &qmakeScope)
|
||||||
: AbstractQt4MaemoTarget(parent, id, supportedDeviceType, qmakeScope)
|
: AbstractQt4MaemoTarget(parent, id, qmakeScope)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1124,14 +1124,18 @@ bool AbstractRpmBasedQt4MaemoTarget::setValueForTag(const QByteArray &tag,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Qt4Maemo5Target::Qt4Maemo5Target(Qt4Project *parent, const QString &id)
|
Qt4Maemo5Target::Qt4Maemo5Target(Qt4Project *parent, const QString &id)
|
||||||
: AbstractDebBasedQt4MaemoTarget(parent, id, QLatin1String(Maemo5OsType),
|
: AbstractDebBasedQt4MaemoTarget(parent, id, QLatin1String("maemo5"))
|
||||||
QLatin1String("maemo5"))
|
|
||||||
{
|
{
|
||||||
setDisplayName(defaultDisplayName());
|
setDisplayName(defaultDisplayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4Maemo5Target::~Qt4Maemo5Target() {}
|
Qt4Maemo5Target::~Qt4Maemo5Target() {}
|
||||||
|
|
||||||
|
bool Qt4Maemo5Target::supportsDevice(const ProjectExplorer::IDevice::ConstPtr &device) const
|
||||||
|
{
|
||||||
|
return device->type() == QLatin1String(Maemo5OsType);
|
||||||
|
}
|
||||||
|
|
||||||
QString Qt4Maemo5Target::defaultDisplayName()
|
QString Qt4Maemo5Target::defaultDisplayName()
|
||||||
{
|
{
|
||||||
return QApplication::translate("Qt4ProjectManager::Qt4Target", "Maemo5",
|
return QApplication::translate("Qt4ProjectManager::Qt4Target", "Maemo5",
|
||||||
@@ -1164,14 +1168,18 @@ QByteArray Qt4Maemo5Target::defaultSection() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
Qt4HarmattanTarget::Qt4HarmattanTarget(Qt4Project *parent, const QString &id)
|
Qt4HarmattanTarget::Qt4HarmattanTarget(Qt4Project *parent, const QString &id)
|
||||||
: AbstractDebBasedQt4MaemoTarget(parent, id, QLatin1String(HarmattanOsType),
|
: AbstractDebBasedQt4MaemoTarget(parent, id, QLatin1String("contains(MEEGO_EDITION,harmattan)"))
|
||||||
QLatin1String("contains(MEEGO_EDITION,harmattan)"))
|
|
||||||
{
|
{
|
||||||
setDisplayName(defaultDisplayName());
|
setDisplayName(defaultDisplayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4HarmattanTarget::~Qt4HarmattanTarget() {}
|
Qt4HarmattanTarget::~Qt4HarmattanTarget() {}
|
||||||
|
|
||||||
|
bool Qt4HarmattanTarget::supportsDevice(const ProjectExplorer::IDevice::ConstPtr &device) const
|
||||||
|
{
|
||||||
|
return device->type() == QLatin1String(HarmattanOsType);
|
||||||
|
}
|
||||||
|
|
||||||
QString Qt4HarmattanTarget::defaultDisplayName()
|
QString Qt4HarmattanTarget::defaultDisplayName()
|
||||||
{
|
{
|
||||||
return QApplication::translate("Qt4ProjectManager::Qt4Target", "Harmattan",
|
return QApplication::translate("Qt4ProjectManager::Qt4Target", "Harmattan",
|
||||||
@@ -1235,7 +1243,7 @@ QByteArray Qt4HarmattanTarget::defaultSection() const
|
|||||||
|
|
||||||
|
|
||||||
Qt4MeegoTarget::Qt4MeegoTarget(Qt4Project *parent, const QString &id)
|
Qt4MeegoTarget::Qt4MeegoTarget(Qt4Project *parent, const QString &id)
|
||||||
: AbstractRpmBasedQt4MaemoTarget(parent, id, QLatin1String(MeeGoOsType),
|
: AbstractRpmBasedQt4MaemoTarget(parent, id,
|
||||||
QLatin1String("!isEmpty(MEEGO_VERSION_MAJOR):!contains(MEEGO_EDITION,harmattan)"))
|
QLatin1String("!isEmpty(MEEGO_VERSION_MAJOR):!contains(MEEGO_EDITION,harmattan)"))
|
||||||
{
|
{
|
||||||
setDisplayName(defaultDisplayName());
|
setDisplayName(defaultDisplayName());
|
||||||
@@ -1243,6 +1251,11 @@ Qt4MeegoTarget::Qt4MeegoTarget(Qt4Project *parent, const QString &id)
|
|||||||
|
|
||||||
Qt4MeegoTarget::~Qt4MeegoTarget() {}
|
Qt4MeegoTarget::~Qt4MeegoTarget() {}
|
||||||
|
|
||||||
|
bool Qt4MeegoTarget::supportsDevice(const ProjectExplorer::IDevice::ConstPtr &device) const
|
||||||
|
{
|
||||||
|
return device->type() == QLatin1String(MeeGoOsType);
|
||||||
|
}
|
||||||
|
|
||||||
QString Qt4MeegoTarget::defaultDisplayName()
|
QString Qt4MeegoTarget::defaultDisplayName()
|
||||||
{
|
{
|
||||||
return QApplication::translate("Qt4ProjectManager::Qt4Target",
|
return QApplication::translate("Qt4ProjectManager::Qt4Target",
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class AbstractQt4MaemoTarget : public RemoteLinux::AbstractEmbeddedLinuxTarget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit AbstractQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
|
explicit AbstractQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
|
||||||
const QString &supportedDeviceType, const QString &qmakeScope);
|
const QString &qmakeScope);
|
||||||
virtual ~AbstractQt4MaemoTarget();
|
virtual ~AbstractQt4MaemoTarget();
|
||||||
|
|
||||||
void createApplicationProFiles(bool reparse);
|
void createApplicationProFiles(bool reparse);
|
||||||
@@ -120,7 +120,7 @@ class AbstractDebBasedQt4MaemoTarget : public AbstractQt4MaemoTarget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AbstractDebBasedQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
|
AbstractDebBasedQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
|
||||||
const QString &supportedDeviceType, const QString &qmakeScope);
|
const QString &qmakeScope);
|
||||||
~AbstractDebBasedQt4MaemoTarget();
|
~AbstractDebBasedQt4MaemoTarget();
|
||||||
|
|
||||||
QString debianDirPath() const;
|
QString debianDirPath() const;
|
||||||
@@ -193,7 +193,7 @@ class AbstractRpmBasedQt4MaemoTarget : public AbstractQt4MaemoTarget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AbstractRpmBasedQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
|
AbstractRpmBasedQt4MaemoTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
|
||||||
const QString &supportedDeviceType, const QString &qmakeScope);
|
const QString &qmakeScope);
|
||||||
~AbstractRpmBasedQt4MaemoTarget();
|
~AbstractRpmBasedQt4MaemoTarget();
|
||||||
|
|
||||||
virtual bool allowsRemoteMounts() const { return false; }
|
virtual bool allowsRemoteMounts() const { return false; }
|
||||||
@@ -240,6 +240,8 @@ public:
|
|||||||
const QString &id);
|
const QString &id);
|
||||||
virtual ~Qt4Maemo5Target();
|
virtual ~Qt4Maemo5Target();
|
||||||
|
|
||||||
|
virtual bool supportsDevice(const QSharedPointer<const ProjectExplorer::IDevice> &device) const;
|
||||||
|
|
||||||
virtual bool allowsRemoteMounts() const { return true; }
|
virtual bool allowsRemoteMounts() const { return true; }
|
||||||
virtual bool allowsPackagingDisabling() const { return true; }
|
virtual bool allowsPackagingDisabling() const { return true; }
|
||||||
virtual bool allowsQmlDebugging() const { return false; }
|
virtual bool allowsQmlDebugging() const { return false; }
|
||||||
@@ -264,6 +266,8 @@ public:
|
|||||||
const QString &id);
|
const QString &id);
|
||||||
virtual ~Qt4HarmattanTarget();
|
virtual ~Qt4HarmattanTarget();
|
||||||
|
|
||||||
|
virtual bool supportsDevice(const QSharedPointer<const ProjectExplorer::IDevice> &device) const;
|
||||||
|
|
||||||
virtual bool allowsRemoteMounts() const { return false; }
|
virtual bool allowsRemoteMounts() const { return false; }
|
||||||
virtual bool allowsPackagingDisabling() const { return false; }
|
virtual bool allowsPackagingDisabling() const { return false; }
|
||||||
virtual bool allowsQmlDebugging() const { return true; }
|
virtual bool allowsQmlDebugging() const { return true; }
|
||||||
@@ -289,6 +293,7 @@ public:
|
|||||||
explicit Qt4MeegoTarget(Qt4ProjectManager::Qt4Project *parent,
|
explicit Qt4MeegoTarget(Qt4ProjectManager::Qt4Project *parent,
|
||||||
const QString &id);
|
const QString &id);
|
||||||
virtual ~Qt4MeegoTarget();
|
virtual ~Qt4MeegoTarget();
|
||||||
|
virtual bool supportsDevice(const QSharedPointer<const ProjectExplorer::IDevice> &device) const;
|
||||||
static QString defaultDisplayName();
|
static QString defaultDisplayName();
|
||||||
private:
|
private:
|
||||||
virtual QString specFileName() const;
|
virtual QString specFileName() const;
|
||||||
|
|||||||
@@ -41,14 +41,11 @@ using namespace Qt4ProjectManager;
|
|||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
|
|
||||||
AbstractEmbeddedLinuxTarget::AbstractEmbeddedLinuxTarget(Qt4Project *parent, const QString &id,
|
AbstractEmbeddedLinuxTarget::AbstractEmbeddedLinuxTarget(Qt4Project *parent, const QString &id) :
|
||||||
const QString &supportedDeviceType) :
|
|
||||||
Qt4BaseTarget(parent, id),
|
Qt4BaseTarget(parent, id),
|
||||||
m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this)),
|
m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this)),
|
||||||
m_supportedDeviceType(supportedDeviceType),
|
|
||||||
m_deploymentInfo(new DeploymentInfo(this)),
|
m_deploymentInfo(new DeploymentInfo(this)),
|
||||||
m_deviceConfigModel(new Internal::TypeSpecificDeviceConfigurationListModel(supportedDeviceType,
|
m_deviceConfigModel(new Internal::TypeSpecificDeviceConfigurationListModel(this))
|
||||||
this))
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,13 @@
|
|||||||
|
|
||||||
#include <qt4projectmanager/qt4target.h>
|
#include <qt4projectmanager/qt4target.h>
|
||||||
|
|
||||||
|
#include <QSharedPointer>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace ProjectExplorer { class IBuildConfigurationFactory; }
|
namespace ProjectExplorer {
|
||||||
|
class IBuildConfigurationFactory;
|
||||||
|
class IDevice;
|
||||||
|
}
|
||||||
namespace Qt4ProjectManager { class Qt4BuildConfigurationFactory; }
|
namespace Qt4ProjectManager { class Qt4BuildConfigurationFactory; }
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
@@ -49,20 +53,21 @@ class REMOTELINUX_EXPORT AbstractEmbeddedLinuxTarget : public Qt4ProjectManager:
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
AbstractEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id,
|
AbstractEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent, const QString &id);
|
||||||
const QString &supportedDeviceType);
|
|
||||||
|
|
||||||
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
|
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
|
||||||
|
|
||||||
QString supportedDeviceType() const { return m_supportedDeviceType; }
|
|
||||||
DeploymentInfo *deploymentInfo() const { return m_deploymentInfo; }
|
DeploymentInfo *deploymentInfo() const { return m_deploymentInfo; }
|
||||||
Internal::TypeSpecificDeviceConfigurationListModel *deviceConfigModel() const {
|
Internal::TypeSpecificDeviceConfigurationListModel *deviceConfigModel() const {
|
||||||
return m_deviceConfigModel;
|
return m_deviceConfigModel;
|
||||||
}
|
}
|
||||||
|
virtual bool supportsDevice(const QSharedPointer<const ProjectExplorer::IDevice> &device) const = 0;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void supportedDevicesChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Qt4ProjectManager::Qt4BuildConfigurationFactory * const m_buildConfigurationFactory;
|
Qt4ProjectManager::Qt4BuildConfigurationFactory * const m_buildConfigurationFactory;
|
||||||
const QString m_supportedDeviceType;
|
|
||||||
DeploymentInfo * const m_deploymentInfo;
|
DeploymentInfo * const m_deploymentInfo;
|
||||||
Internal::TypeSpecificDeviceConfigurationListModel * const m_deviceConfigModel;
|
Internal::TypeSpecificDeviceConfigurationListModel * const m_deviceConfigModel;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "remotelinuxrunconfiguration.h"
|
#include "remotelinuxrunconfiguration.h"
|
||||||
|
|
||||||
#include <projectexplorer/customexecutablerunconfiguration.h>
|
#include <projectexplorer/customexecutablerunconfiguration.h>
|
||||||
|
#include <projectexplorer/devicesupport/idevice.h>
|
||||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||||
#include <qt4projectmanager/qt4nodes.h>
|
#include <qt4projectmanager/qt4nodes.h>
|
||||||
#include <qt4projectmanager/qt4project.h>
|
#include <qt4projectmanager/qt4project.h>
|
||||||
@@ -47,8 +48,7 @@ namespace RemoteLinux {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
GenericEmbeddedLinuxTarget::GenericEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent,
|
GenericEmbeddedLinuxTarget::GenericEmbeddedLinuxTarget(Qt4ProjectManager::Qt4Project *parent,
|
||||||
const QString &id) :
|
const QString &id) : AbstractEmbeddedLinuxTarget(parent, id)
|
||||||
AbstractEmbeddedLinuxTarget(parent, id, QLatin1String(Constants::GenericLinuxOsType))
|
|
||||||
{
|
{
|
||||||
setDisplayName(tr("Embedded Linux"));
|
setDisplayName(tr("Embedded Linux"));
|
||||||
}
|
}
|
||||||
@@ -71,6 +71,11 @@ Utils::FileName GenericEmbeddedLinuxTarget::mkspec(const Qt4ProjectManager::Qt4B
|
|||||||
return version->mkspec();
|
return version->mkspec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GenericEmbeddedLinuxTarget::supportsDevice(const ProjectExplorer::IDevice::ConstPtr &device) const
|
||||||
|
{
|
||||||
|
return device->type() == QLatin1String(Constants::GenericLinuxOsType);
|
||||||
|
}
|
||||||
|
|
||||||
void GenericEmbeddedLinuxTarget::createApplicationProFiles(bool reparse)
|
void GenericEmbeddedLinuxTarget::createApplicationProFiles(bool reparse)
|
||||||
{
|
{
|
||||||
if (!reparse)
|
if (!reparse)
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public:
|
|||||||
void createApplicationProFiles(bool reparse);
|
void createApplicationProFiles(bool reparse);
|
||||||
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
|
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
|
||||||
Utils::FileName mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const;
|
Utils::FileName mkspec(const Qt4ProjectManager::Qt4BuildConfiguration *bc) const;
|
||||||
|
bool supportsDevice(const QSharedPointer<const ProjectExplorer::IDevice> &device) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class EmbeddedLinuxTargetFactory;
|
friend class EmbeddedLinuxTargetFactory;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ RemoteLinuxDeployConfiguration::~RemoteLinuxDeployConfiguration()
|
|||||||
void RemoteLinuxDeployConfiguration::initialize()
|
void RemoteLinuxDeployConfiguration::initialize()
|
||||||
{
|
{
|
||||||
d->deviceConfiguration = target()->deviceConfigModel()->defaultDeviceConfig();
|
d->deviceConfiguration = target()->deviceConfigModel()->defaultDeviceConfig();
|
||||||
connect(target()->deviceConfigModel(), SIGNAL(updated()),
|
connect(target()->deviceConfigModel(), SIGNAL(modelReset()),
|
||||||
SLOT(handleDeviceConfigurationListUpdated()));
|
SLOT(handleDeviceConfigurationListUpdated()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,20 +31,22 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "typespecificdeviceconfigurationlistmodel.h"
|
#include "typespecificdeviceconfigurationlistmodel.h"
|
||||||
|
|
||||||
#include "remotelinux_constants.h"
|
#include "abstractembeddedlinuxtarget.h"
|
||||||
|
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
TypeSpecificDeviceConfigurationListModel::TypeSpecificDeviceConfigurationListModel(const QString &deviceType,
|
TypeSpecificDeviceConfigurationListModel::TypeSpecificDeviceConfigurationListModel(AbstractEmbeddedLinuxTarget *target)
|
||||||
QObject *parent) : QAbstractListModel(parent), m_targetDeviceType(deviceType)
|
: QAbstractListModel(target)
|
||||||
{
|
{
|
||||||
const DeviceManager * const devConfs = DeviceManager::instance();
|
const DeviceManager * const devConfs = DeviceManager::instance();
|
||||||
connect(devConfs, SIGNAL(updated()), this, SIGNAL(updated()));
|
connect(devConfs, SIGNAL(updated()), this, SIGNAL(modelReset()));
|
||||||
|
connect(target, SIGNAL(supportedDevicesChanged()), this, SIGNAL(modelReset()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeSpecificDeviceConfigurationListModel::~TypeSpecificDeviceConfigurationListModel()
|
TypeSpecificDeviceConfigurationListModel::~TypeSpecificDeviceConfigurationListModel()
|
||||||
@@ -58,10 +60,8 @@ int TypeSpecificDeviceConfigurationListModel::rowCount(const QModelIndex &parent
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
const DeviceManager * const devConfs = DeviceManager::instance();
|
const DeviceManager * const devConfs = DeviceManager::instance();
|
||||||
const int devConfsCount = devConfs->deviceCount();
|
const int devConfsCount = devConfs->deviceCount();
|
||||||
if (m_targetDeviceType == QLatin1String(Constants::GenericLinuxOsType))
|
|
||||||
return devConfsCount;
|
|
||||||
for (int i = 0; i < devConfsCount; ++i) {
|
for (int i = 0; i < devConfsCount; ++i) {
|
||||||
if (devConfs->deviceAt(i)->type() == m_targetDeviceType)
|
if (target()->supportsDevice(devConfs->deviceAt(i)))
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
@@ -75,7 +75,7 @@ QVariant TypeSpecificDeviceConfigurationListModel::data(const QModelIndex &index
|
|||||||
const LinuxDeviceConfiguration::ConstPtr &devConf = deviceAt(index.row());
|
const LinuxDeviceConfiguration::ConstPtr &devConf = deviceAt(index.row());
|
||||||
Q_ASSERT(devConf);
|
Q_ASSERT(devConf);
|
||||||
QString displayedName = devConf->displayName();
|
QString displayedName = devConf->displayName();
|
||||||
if (devConf->type() == m_targetDeviceType && DeviceManager::instance()
|
if (target()->supportsDevice(devConf) && DeviceManager::instance()
|
||||||
->defaultDevice(devConf->type()) == devConf) {
|
->defaultDevice(devConf->type()) == devConf) {
|
||||||
displayedName = tr("%1 (default)").arg(displayedName);
|
displayedName = tr("%1 (default)").arg(displayedName);
|
||||||
}
|
}
|
||||||
@@ -86,34 +86,34 @@ LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::dev
|
|||||||
{
|
{
|
||||||
int currentRow = -1;
|
int currentRow = -1;
|
||||||
const DeviceManager * const devConfs = DeviceManager::instance();
|
const DeviceManager * const devConfs = DeviceManager::instance();
|
||||||
if (m_targetDeviceType == QLatin1String(Constants::GenericLinuxOsType))
|
|
||||||
return devConfs->deviceAt(idx).staticCast<const LinuxDeviceConfiguration>();
|
|
||||||
const int devConfsCount = devConfs->deviceCount();
|
const int devConfsCount = devConfs->deviceCount();
|
||||||
for (int i = 0; i < devConfsCount; ++i) {
|
for (int i = 0; i < devConfsCount; ++i) {
|
||||||
const IDevice::ConstPtr device = devConfs->deviceAt(i);
|
const IDevice::ConstPtr device = devConfs->deviceAt(i);
|
||||||
if (device->type() == m_targetDeviceType
|
if (target()->supportsDevice(device) && ++currentRow == idx)
|
||||||
|| m_targetDeviceType == QLatin1String(Constants::GenericLinuxOsType)) {
|
return device.staticCast<const LinuxDeviceConfiguration>();
|
||||||
if (++currentRow == idx)
|
|
||||||
return devConfs->deviceAt(i).staticCast<const LinuxDeviceConfiguration>();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Q_ASSERT(false);
|
QTC_ASSERT(false, return LinuxDeviceConfiguration::ConstPtr());
|
||||||
return LinuxDeviceConfiguration::ConstPtr();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::defaultDeviceConfig() const
|
LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::defaultDeviceConfig() const
|
||||||
{
|
{
|
||||||
return DeviceManager::instance()->defaultDevice(m_targetDeviceType)
|
const DeviceManager * const deviceManager = DeviceManager::instance();
|
||||||
.staticCast<const LinuxDeviceConfiguration>();
|
const int deviceCount = deviceManager->deviceCount();
|
||||||
|
for (int i = 0; i < deviceCount; ++i) {
|
||||||
|
const IDevice::ConstPtr device = deviceManager->deviceAt(i);
|
||||||
|
if (target()->supportsDevice(device)
|
||||||
|
&& deviceManager->defaultDevice(device->type()) == device) {
|
||||||
|
return device.staticCast<const LinuxDeviceConfiguration>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return LinuxDeviceConfiguration::ConstPtr();
|
||||||
}
|
}
|
||||||
|
|
||||||
LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::find(LinuxDeviceConfiguration::Id id) const
|
LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::find(LinuxDeviceConfiguration::Id id) const
|
||||||
{
|
{
|
||||||
const IDevice::ConstPtr &devConf = DeviceManager::instance()->find(id);
|
const IDevice::ConstPtr &devConf = DeviceManager::instance()->find(id);
|
||||||
if (devConf && (devConf->type() == m_targetDeviceType
|
if (devConf && target()->supportsDevice(devConf))
|
||||||
|| m_targetDeviceType == QLatin1String(Constants::GenericLinuxOsType))) {
|
|
||||||
return devConf.staticCast<const LinuxDeviceConfiguration>();
|
return devConf.staticCast<const LinuxDeviceConfiguration>();
|
||||||
}
|
|
||||||
return defaultDeviceConfig();
|
return defaultDeviceConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,5 +127,10 @@ int TypeSpecificDeviceConfigurationListModel::indexForInternalId(LinuxDeviceConf
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AbstractEmbeddedLinuxTarget *TypeSpecificDeviceConfigurationListModel::target() const
|
||||||
|
{
|
||||||
|
return qobject_cast<AbstractEmbeddedLinuxTarget *>(QObject::parent());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace RemoteLinux
|
} // namespace RemoteLinux
|
||||||
|
|||||||
@@ -38,14 +38,14 @@
|
|||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
||||||
namespace RemoteLinux {
|
namespace RemoteLinux {
|
||||||
|
class AbstractEmbeddedLinuxTarget;
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class TypeSpecificDeviceConfigurationListModel : public QAbstractListModel
|
class TypeSpecificDeviceConfigurationListModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit TypeSpecificDeviceConfigurationListModel(const QString &deviceType,
|
explicit TypeSpecificDeviceConfigurationListModel(AbstractEmbeddedLinuxTarget *target);
|
||||||
QObject *parent = 0);
|
|
||||||
~TypeSpecificDeviceConfigurationListModel();
|
~TypeSpecificDeviceConfigurationListModel();
|
||||||
|
|
||||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
@@ -57,11 +57,8 @@ public:
|
|||||||
QSharedPointer<const LinuxDeviceConfiguration> find(LinuxDeviceConfiguration::Id id) const;
|
QSharedPointer<const LinuxDeviceConfiguration> find(LinuxDeviceConfiguration::Id id) const;
|
||||||
int indexForInternalId(LinuxDeviceConfiguration::Id id) const;
|
int indexForInternalId(LinuxDeviceConfiguration::Id id) const;
|
||||||
|
|
||||||
signals:
|
|
||||||
void updated();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QString m_targetDeviceType;
|
AbstractEmbeddedLinuxTarget * target() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user