Merge remote-tracking branch 'origin/2.6'

This commit is contained in:
Eike Ziller
2012-07-26 19:54:03 +02:00
101 changed files with 469 additions and 650 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -117,7 +117,7 @@ def dynamicTypeName(value):
pass pass
return str(value.type) return str(value.type)
def upcast(value): def downcast(value):
try: try:
return value.cast(value.dynamic_type) return value.cast(value.dynamic_type)
except: except:
@@ -128,7 +128,7 @@ def upcast(value):
# pass # pass
return value return value
def expensiveUpcast(value): def expensiveDowncast(value):
try: try:
return value.cast(value.dynamic_type) return value.cast(value.dynamic_type)
except: except:
@@ -1054,7 +1054,7 @@ class Dumper:
pass pass
for item in locals: for item in locals:
value = upcast(item.value) value = downcast(item.value)
with OutputSafer(self): with OutputSafer(self):
self.anonNumber = -1 self.anonNumber = -1
@@ -1639,7 +1639,7 @@ class Dumper:
if self.useDynamicType and tryDynamic: if self.useDynamicType and tryDynamic:
self.putItem(expensiveUpcast(value), False) self.putItem(expensiveDowncast(value), False)
return return
format = self.formats.get(self.currentIName) format = self.formats.get(self.currentIName)
@@ -1669,7 +1669,7 @@ class Dumper:
dumper = qqDumpers.get(nsStrippedType, None) dumper = qqDumpers.get(nsStrippedType, None)
if not dumper is None: if not dumper is None:
if tryDynamic: if tryDynamic:
dumper(self, expensiveUpcast(value)) dumper(self, expensiveDowncast(value))
else: else:
dumper(self, value) dumper(self, value)
return return
@@ -1789,7 +1789,7 @@ class Dumper:
#if not bitsize is None: #if not bitsize is None:
# self.put("bitsize=\"%s\",bitpos=\"%s\"," # self.put("bitsize=\"%s\",bitpos=\"%s\","
# % (bitsize, bitpos)) # % (bitsize, bitpos))
self.putItem(upcast(value[field.name])) self.putItem(downcast(value[field.name]))
def listAnonymous(self, value, name, type): def listAnonymous(self, value, name, type):

View File

@@ -2003,7 +2003,7 @@ def qdump__std__shared_ptr(d, value):
if isSimpleType(templateArgument(value.type, 0)): if isSimpleType(templateArgument(value.type, 0)):
d.putValue("%s @0x%x" % (i.dereference(), long(i))) d.putValue("%s @0x%x" % (i.dereference(), long(i)))
else: else:
i = expensiveUpcast(i) i = expensiveDowncast(i)
d.putValue("@0x%x" % long(i)) d.putValue("@0x%x" % long(i))
d.putNumChild(3) d.putNumChild(3)
@@ -2024,7 +2024,7 @@ def qdump__std__unique_ptr(d, value):
if isSimpleType(templateArgument(value.type, 0)): if isSimpleType(templateArgument(value.type, 0)):
d.putValue("%s @0x%x" % (i.dereference(), long(i))) d.putValue("%s @0x%x" % (i.dereference(), long(i)))
else: else:
i = expensiveUpcast(i) i = expensiveDowncast(i)
d.putValue("@0x%x" % long(i)) d.putValue("@0x%x" % long(i))
d.putNumChild(1) d.putNumChild(1)

View File

@@ -124,8 +124,8 @@ AndroidDebugSupport::AndroidDebugSupport(AndroidRunConfiguration *runConfig,
connect(m_runner, SIGNAL(remoteProcessStarted(int,int)), connect(m_runner, SIGNAL(remoteProcessStarted(int,int)),
SLOT(handleRemoteProcessStarted(int,int))); SLOT(handleRemoteProcessStarted(int,int)));
connect(m_runner, SIGNAL(remoteProcessFinished(const QString &)), connect(m_runner, SIGNAL(remoteProcessFinished(QString)),
SLOT(handleRemoteProcessFinished(const QString &))); SLOT(handleRemoteProcessFinished(QString)));
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)),
SLOT(handleRemoteErrorOutput(QByteArray))); SLOT(handleRemoteErrorOutput(QByteArray)));
@@ -146,8 +146,8 @@ void AndroidDebugSupport::handleRemoteProcessStarted(int gdbServerPort, int qmlP
void AndroidDebugSupport::handleRemoteProcessFinished(const QString &errorMsg) void AndroidDebugSupport::handleRemoteProcessFinished(const QString &errorMsg)
{ {
disconnect(m_runner, SIGNAL(remoteProcessFinished(const QString &)), disconnect(m_runner, SIGNAL(remoteProcessFinished(QString)),
this,SLOT(handleRemoteProcessFinished(const QString &))); this,SLOT(handleRemoteProcessFinished(QString)));
m_runControl->engine()->notifyEngineRemoteSetupFailed(errorMsg); m_runControl->engine()->notifyEngineRemoteSetupFailed(errorMsg);
} }

View File

@@ -37,7 +37,9 @@ namespace Android {
namespace Internal { namespace Internal {
AndroidDevice::AndroidDevice(): AndroidDevice::AndroidDevice():
ProjectExplorer::IDevice(Core::Id(Constants::ANDROID_DEVICE_TYPE), IDevice::AutoDetected, ProjectExplorer::IDevice(Core::Id(Constants::ANDROID_DEVICE_TYPE),
IDevice::AutoDetected,
IDevice::Hardware,
Core::Id(Constants::ANDROID_DEVICE_ID)) Core::Id(Constants::ANDROID_DEVICE_ID))
{ {
setDisplayName(QCoreApplication::translate("ProjectExplorer::AndroidDevice", "Run on Android")); setDisplayName(QCoreApplication::translate("ProjectExplorer::AndroidDevice", "Run on Android"));

View File

@@ -38,19 +38,14 @@
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qtsupport/qtoutputformatter.h> #include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4project.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
namespace Android { namespace Android {
namespace Internal { namespace Internal {
using namespace ProjectExplorer;
AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, Core::Id id, const QString &path) AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, Core::Id id, const QString &path)
: RunConfiguration(parent, id) : RunConfiguration(parent, id)
, m_proFilePath(path) , m_proFilePath(path)
@@ -58,8 +53,7 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, Core::Id id, co
init(); init();
} }
AndroidRunConfiguration::AndroidRunConfiguration(ProjectExplorer::Target *parent, AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, AndroidRunConfiguration *source)
AndroidRunConfiguration *source)
: RunConfiguration(parent, source) : RunConfiguration(parent, source)
, m_proFilePath(source->m_proFilePath) , m_proFilePath(source->m_proFilePath)
{ {
@@ -71,15 +65,6 @@ void AndroidRunConfiguration::init()
setDefaultDisplayName(defaultDisplayName()); setDefaultDisplayName(defaultDisplayName());
} }
AndroidRunConfiguration::~AndroidRunConfiguration()
{
}
Qt4BuildConfiguration *AndroidRunConfiguration::activeQt4BuildConfiguration() const
{
return static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration());
}
QWidget *AndroidRunConfiguration::createConfigurationWidget() QWidget *AndroidRunConfiguration::createConfigurationWidget()
{ {
return 0;// no special running configurations return 0;// no special running configurations

View File

@@ -34,19 +34,8 @@
#include "androidconstants.h" #include "androidconstants.h"
#include "androidconfigurations.h" #include "androidconfigurations.h"
#include <utils/environment.h>
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
QT_FORWARD_DECLARE_CLASS(QWidget)
namespace Qt4ProjectManager {
class Qt4BuildConfiguration;
class Qt4Project;
class Qt4ProFileNode;
}
namespace Android { namespace Android {
namespace Internal { namespace Internal {
@@ -69,11 +58,9 @@ public:
enum DebuggingType { DebugCppOnly, DebugQmlOnly, DebugCppAndQml }; enum DebuggingType { DebugCppOnly, DebugQmlOnly, DebugCppAndQml };
AndroidRunConfiguration(ProjectExplorer::Target *parent, Core::Id id, const QString &path); AndroidRunConfiguration(ProjectExplorer::Target *parent, Core::Id id, const QString &path);
virtual ~AndroidRunConfiguration();
QWidget *createConfigurationWidget(); QWidget *createConfigurationWidget();
Utils::OutputFormatter *createOutputFormatter() const; Utils::OutputFormatter *createOutputFormatter() const;
Qt4ProjectManager::Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
AndroidDeployStep *deployStep() const; AndroidDeployStep *deployStep() const;
@@ -95,7 +82,6 @@ private:
void init(); void init();
QString m_proFilePath; QString m_proFilePath;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -67,8 +67,8 @@ void AndroidRunControl::start()
SLOT(handleRemoteErrorOutput(QByteArray))); SLOT(handleRemoteErrorOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteOutput(QByteArray)), connect(m_runner, SIGNAL(remoteOutput(QByteArray)),
SLOT(handleRemoteOutput(QByteArray))); SLOT(handleRemoteOutput(QByteArray)));
connect(m_runner, SIGNAL(remoteProcessFinished(const QString &)), connect(m_runner, SIGNAL(remoteProcessFinished(QString)),
SLOT(handleRemoteProcessFinished(const QString &))); SLOT(handleRemoteProcessFinished(QString)));
appendMessage(tr("Starting remote process ..."), Utils::NormalMessageFormat); appendMessage(tr("Starting remote process ..."), Utils::NormalMessageFormat);
m_runner->start(); m_runner->start();
} }

View File

@@ -285,7 +285,7 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor)
if (!m_engineClientConnected) if (!m_engineClientConnected)
return; return;
if (newEditor && newEditor->id() if (!newEditor || newEditor->id()
!= QmlJSEditor::Constants::C_QMLJSEDITOR_ID) != QmlJSEditor::Constants::C_QMLJSEDITOR_ID)
return; return;

View File

@@ -3920,11 +3920,6 @@ static QRegExp vimPatternToQtPattern(QString needle, QTextDocument::FindFlags *f
// FIXME: Rough mapping of a common case. // FIXME: Rough mapping of a common case.
if (needle.startsWith(_("\\<")) && needle.endsWith(_("\\>"))) if (needle.startsWith(_("\\<")) && needle.endsWith(_("\\>")))
(*flags) |= QTextDocument::FindWholeWords; (*flags) |= QTextDocument::FindWholeWords;
// Half-hearted attempt at removing pitfalls.
if (needle.startsWith(_(".*")))
needle = needle.mid(2);
if (needle.endsWith(_(".*")))
needle = needle.left(needle.size() - 2);
needle.remove(_("\\<")); // start of word needle.remove(_("\\<")); // start of word
needle.remove(_("\\>")); // end of word needle.remove(_("\\>")); // end of word
@@ -4046,6 +4041,8 @@ void FakeVimHandler::Private::highlightMatches(const QString &needle)
tc = tc.document()->find(needleExp, tc.position(), flags); tc = tc.document()->find(needleExp, tc.position(), flags);
if (tc.isNull()) if (tc.isNull())
break; break;
if (!tc.hasSelection())
tc.movePosition(Right, KeepAnchor, 1);
QTextEdit::ExtraSelection sel; QTextEdit::ExtraSelection sel;
sel.cursor = tc; sel.cursor = tc;
sel.format = tc.blockCharFormat(); sel.format = tc.blockCharFormat();

View File

@@ -925,7 +925,7 @@ void HelpPlugin::activateContext()
QUrl source = *links.begin(); QUrl source = *links.begin();
const QLatin1String qtRefDoc = QLatin1String("com.trolltech.qt"); const QLatin1String qtRefDoc = QLatin1String("com.trolltech.qt");
// workaround to show the latest qt version // workaround to show the latest Qt version
foreach (const QUrl &tmp, links) { foreach (const QUrl &tmp, links) {
const QString &authority = tmp.authority(); const QString &authority = tmp.authority();
if (authority.startsWith(qtRefDoc)) { if (authority.startsWith(qtRefDoc)) {

View File

@@ -59,7 +59,7 @@ MaddeDeviceTester::~MaddeDeviceTester()
{ {
} }
void MaddeDeviceTester::testDevice(const LinuxDeviceConfiguration::ConstPtr &deviceConfiguration) void MaddeDeviceTester::testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration)
{ {
QTC_ASSERT(m_state == Inactive, return); QTC_ASSERT(m_state == Inactive, return);

View File

@@ -32,8 +32,6 @@
#include <remotelinux/linuxdevicetester.h> #include <remotelinux/linuxdevicetester.h>
#include <QByteArray>
namespace QSsh { namespace QSsh {
class SshRemoteProcessRunner; class SshRemoteProcessRunner;
} }
@@ -44,11 +42,12 @@ namespace Internal {
class MaddeDeviceTester : public RemoteLinux::AbstractLinuxDeviceTester class MaddeDeviceTester : public RemoteLinux::AbstractLinuxDeviceTester
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit MaddeDeviceTester(QObject *parent = 0); explicit MaddeDeviceTester(QObject *parent = 0);
~MaddeDeviceTester(); ~MaddeDeviceTester();
void testDevice(const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &deviceConfiguration); void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration);
void stopTest(); void stopTest();
private slots: private slots:
@@ -70,7 +69,7 @@ private:
State m_state; State m_state;
TestResult m_result; TestResult m_result;
QSsh::SshRemoteProcessRunner *m_processRunner; QSsh::SshRemoteProcessRunner *m_processRunner;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_deviceConfiguration; ProjectExplorer::IDevice::ConstPtr m_deviceConfiguration;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -33,16 +33,15 @@
#include "maemopackagecreationstep.h" #include "maemopackagecreationstep.h"
#include "maemopackageinstaller.h" #include "maemopackageinstaller.h"
#include "maemoqemumanager.h" #include "maemoqemumanager.h"
#include "qt4maemodeployconfiguration.h"
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>
#include <remotelinux/abstractuploadandinstallpackageservice.h> #include <remotelinux/abstractuploadandinstallpackageservice.h>
#include <remotelinux/linuxdeviceconfiguration.h> #include <remotelinux/remotelinuxdeployconfiguration.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
using namespace ProjectExplorer;
using namespace RemoteLinux; using namespace RemoteLinux;
namespace Madde { namespace Madde {
@@ -60,7 +59,7 @@ protected:
void doDeviceSetup() void doDeviceSetup()
{ {
if (deviceConfiguration()->machineType() == LinuxDeviceConfiguration::Hardware) { if (deviceConfiguration()->machineType() == IDevice::Hardware) {
handleDeviceSetupDone(true); handleDeviceSetupDone(true);
return; return;
} }
@@ -71,8 +70,7 @@ protected:
} }
MaemoQemuRuntime rt; MaemoQemuRuntime rt;
const int qtId = qt4BuildConfiguration() const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile());
? QtSupport::QtProfileInformation::qtVersionId(qt4BuildConfiguration()->target()->profile()) : -1;
if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) { if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) {
MaemoQemuManager::instance().startRuntime(); MaemoQemuManager::instance().startRuntime();
emit errorMessage(tr("Cannot deploy: Qemu was not running. " emit errorMessage(tr("Cannot deploy: Qemu was not running. "

View File

@@ -156,7 +156,7 @@ void AbstractMaemoDeployByMountService::doDeviceSetup()
{ {
QTC_ASSERT(m_state == Inactive, return); QTC_ASSERT(m_state == Inactive, return);
if (deviceConfiguration()->machineType() == LinuxDeviceConfiguration::Hardware) { if (deviceConfiguration()->machineType() == IDevice::Hardware) {
handleDeviceSetupDone(true); handleDeviceSetupDone(true);
return; return;
} }
@@ -167,8 +167,7 @@ void AbstractMaemoDeployByMountService::doDeviceSetup()
} }
MaemoQemuRuntime rt; MaemoQemuRuntime rt;
const int qtId = qt4BuildConfiguration() const int qtId = QtSupport::QtProfileInformation::qtVersionId(profile());
? QtSupport::QtProfileInformation::qtVersionId(qt4BuildConfiguration()->target()->profile()) : -1;
if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) { if (MaemoQemuManager::instance().runtimeForQtVersion(qtId, &rt)) {
MaemoQemuManager::instance().startRuntime(); MaemoQemuManager::instance().startRuntime();
emit errorMessage(tr("Cannot deploy: Qemu was not running. " emit errorMessage(tr("Cannot deploy: Qemu was not running. "
@@ -192,15 +191,14 @@ void AbstractMaemoDeployByMountService::doDeploy()
{ {
QTC_ASSERT(m_state == Inactive, return); QTC_ASSERT(m_state == Inactive, return);
if (!qt4BuildConfiguration()) { if (!buildConfiguration()) {
emit errorMessage(tr("Missing build configuration.")); emit errorMessage(tr("Missing build configuration."));
setFinished(); setFinished();
return; return;
} }
m_state = Mounting; m_state = Mounting;
m_mounter->setupMounts(connection(), deviceConfiguration(), mountSpecifications(), m_mounter->setupMounts(connection(), mountSpecifications(), profile());
qt4BuildConfiguration());
} }
void AbstractMaemoDeployByMountService::stopDeployment() void AbstractMaemoDeployByMountService::stopDeployment()
@@ -280,7 +278,7 @@ QString AbstractMaemoDeployByMountService::deployMountPoint() const
{ {
return MaemoGlobal::homeDirOnDevice(deviceConfiguration()->sshParameters().userName) return MaemoGlobal::homeDirOnDevice(deviceConfiguration()->sshParameters().userName)
+ QLatin1String("/deployMountPoint_") + QLatin1String("/deployMountPoint_")
+ qt4BuildConfiguration()->target()->project()->displayName(); + buildConfiguration()->target()->project()->displayName();
} }

View File

@@ -34,14 +34,12 @@
#include "maemoremotemounter.h" #include "maemoremotemounter.h"
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h> #include <projectexplorer/profileinformation.h>
#include <qtsupport/qtprofileinformation.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <remotelinux/remotelinuxusedportsgatherer.h> #include <remotelinux/remotelinuxusedportsgatherer.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
using namespace Qt4ProjectManager; using namespace ProjectExplorer;
using namespace RemoteLinux; using namespace RemoteLinux;
using namespace QSsh; using namespace QSsh;
@@ -71,17 +69,16 @@ MaemoDeploymentMounter::MaemoDeploymentMounter(QObject *parent)
MaemoDeploymentMounter::~MaemoDeploymentMounter() {} MaemoDeploymentMounter::~MaemoDeploymentMounter() {}
void MaemoDeploymentMounter::setupMounts(SshConnection *connection, void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
const LinuxDeviceConfiguration::ConstPtr &devConf,
const QList<MaemoMountSpecification> &mountSpecs, const QList<MaemoMountSpecification> &mountSpecs,
const Qt4BuildConfiguration *bc) const Profile *profile)
{ {
QTC_ASSERT(m_state == Inactive, return); QTC_ASSERT(m_state == Inactive, return);
m_mountSpecs = mountSpecs; m_mountSpecs = mountSpecs;
m_connection = connection; m_connection = connection;
m_devConf = devConf; m_profile = profile;
m_devConf = DeviceProfileInformation::device(profile);
m_mounter->setConnection(m_connection, m_devConf); m_mounter->setConnection(m_connection, m_devConf);
m_buildConfig = bc;
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError())); connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
setState(UnmountingOldDirs); setState(UnmountingOldDirs);
unmount(); unmount();
@@ -102,7 +99,7 @@ void MaemoDeploymentMounter::setupMounter()
setState(UnmountingCurrentDirs); setState(UnmountingCurrentDirs);
m_mounter->resetMountSpecifications(); m_mounter->resetMountSpecifications();
m_mounter->setBuildConfiguration(m_buildConfig); m_mounter->setProfile(m_profile);
foreach (const MaemoMountSpecification &mountSpec, m_mountSpecs) foreach (const MaemoMountSpecification &mountSpec, m_mountSpecs)
m_mounter->addMountSpecification(mountSpec, true); m_mounter->addMountSpecification(mountSpec, true);
unmount(); unmount();
@@ -173,7 +170,7 @@ void MaemoDeploymentMounter::handlePortListReady()
return; return;
setState(Mounting); setState(Mounting);
m_freePorts = MaemoGlobal::freePorts(m_devConf, QtSupport::QtProfileInformation::qtVersion(m_buildConfig->target()->profile())); m_freePorts = MaemoGlobal::freePorts(m_profile);
m_mounter->mount(&m_freePorts, m_portsGatherer); m_mounter->mount(&m_freePorts, m_portsGatherer);
} }

View File

@@ -33,19 +33,14 @@
#include "maemomountspecification.h" #include "maemomountspecification.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <utils/portlist.h> #include <utils/portlist.h>
#include <QList>
#include <QObject>
#include <QSharedPointer> #include <QSharedPointer>
namespace ProjectExplorer { class Profile; }
namespace QSsh { class SshConnection; } namespace QSsh { class SshConnection; }
namespace Qt4ProjectManager { class Qt4BuildConfiguration; } namespace RemoteLinux { class RemoteLinuxUsedPortsGatherer; }
namespace RemoteLinux {
class LinuxDeviceConfiguration;
class RemoteLinuxUsedPortsGatherer;
}
namespace Madde { namespace Madde {
namespace Internal { namespace Internal {
@@ -60,9 +55,8 @@ public:
// Connection must be in connected state. // Connection must be in connected state.
void setupMounts(QSsh::SshConnection *connection, void setupMounts(QSsh::SshConnection *connection,
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf,
const QList<MaemoMountSpecification> &mountSpecs, const QList<MaemoMountSpecification> &mountSpecs,
const Qt4ProjectManager::Qt4BuildConfiguration *bc); const ProjectExplorer::Profile *profile);
void tearDownMounts(); void tearDownMounts();
signals: signals:
@@ -92,12 +86,12 @@ private:
State m_state; State m_state;
QSsh::SshConnection *m_connection; QSsh::SshConnection *m_connection;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_devConf; ProjectExplorer::IDevice::ConstPtr m_devConf;
MaemoRemoteMounter * const m_mounter; MaemoRemoteMounter * const m_mounter;
RemoteLinux::RemoteLinuxUsedPortsGatherer * const m_portsGatherer; RemoteLinux::RemoteLinuxUsedPortsGatherer * const m_portsGatherer;
Utils::PortList m_freePorts; Utils::PortList m_freePorts;
QList<MaemoMountSpecification> m_mountSpecs; QList<MaemoMountSpecification> m_mountSpecs;
const Qt4ProjectManager::Qt4BuildConfiguration *m_buildConfig; const ProjectExplorer::Profile *m_profile;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -68,9 +68,9 @@ QString defaultUser(Core::Id deviceType)
return QLatin1String("developer"); return QLatin1String("developer");
} }
QString defaultHost(LinuxDeviceConfiguration::MachineType type) QString defaultHost(IDevice::MachineType type)
{ {
return QLatin1String(type == LinuxDeviceConfiguration::Hardware ? "192.168.2.15" : "localhost"); return QLatin1String(type == IDevice::Hardware ? "192.168.2.15" : "localhost");
} }
struct WizardData struct WizardData
@@ -79,7 +79,7 @@ struct WizardData
QString hostName; QString hostName;
Core::Id deviceType; Core::Id deviceType;
SshConnectionParameters::AuthenticationType authType; SshConnectionParameters::AuthenticationType authType;
LinuxDeviceConfiguration::MachineType machineType; IDevice::MachineType machineType;
QString privateKeyFilePath; QString privateKeyFilePath;
QString publicKeyFilePath; QString publicKeyFilePath;
QString userName; QString userName;
@@ -138,8 +138,8 @@ public:
QString hostName() const QString hostName() const
{ {
return machineType() == LinuxDeviceConfiguration::Emulator return machineType() == IDevice::Emulator
? defaultHost(LinuxDeviceConfiguration::Emulator) ? defaultHost(IDevice::Emulator)
: m_ui->hostNameLineEdit->text().trimmed(); : m_ui->hostNameLineEdit->text().trimmed();
} }
@@ -148,22 +148,20 @@ public:
return m_deviceType; return m_deviceType;
} }
LinuxDeviceConfiguration::MachineType machineType() const IDevice::MachineType machineType() const
{ {
return m_ui->hwButton->isChecked() return m_ui->hwButton->isChecked() ? IDevice::Hardware : IDevice::Emulator;
? LinuxDeviceConfiguration::Hardware : LinuxDeviceConfiguration::Emulator;
} }
int sshPort() const int sshPort() const
{ {
return machineType() == LinuxDeviceConfiguration::Emulator return machineType() == IDevice::Emulator ? 6666 : m_ui->sshPortSpinBox->value();
? 6666 : m_ui->sshPortSpinBox->value();
} }
private slots: private slots:
void handleMachineTypeChanged() void handleMachineTypeChanged()
{ {
const bool enable = machineType() == LinuxDeviceConfiguration::Hardware; const bool enable = machineType() == IDevice::Hardware;
m_ui->hostNameLabel->setEnabled(enable); m_ui->hostNameLabel->setEnabled(enable);
m_ui->hostNameLineEdit->setEnabled(enable); m_ui->hostNameLineEdit->setEnabled(enable);
m_ui->sshPortLabel->setEnabled(enable); m_ui->sshPortLabel->setEnabled(enable);
@@ -206,7 +204,7 @@ public:
virtual void initializePage() virtual void initializePage()
{ {
m_ui->keyWasNotSetUpButton->setChecked(true); m_ui->keyWasNotSetUpButton->setChecked(true);
m_ui->privateKeyFilePathChooser->setPath(LinuxDeviceConfiguration::defaultPrivateKeyFilePath()); m_ui->privateKeyFilePathChooser->setPath(IDevice::defaultPrivateKeyFilePath());
handleSelectionChanged(); handleSelectionChanged();
} }
@@ -262,8 +260,8 @@ public:
virtual void initializePage() virtual void initializePage()
{ {
m_ui->dontReuseButton->setChecked(true); m_ui->dontReuseButton->setChecked(true);
m_ui->privateKeyFilePathChooser->setPath(LinuxDeviceConfiguration::defaultPrivateKeyFilePath()); m_ui->privateKeyFilePathChooser->setPath(IDevice::defaultPrivateKeyFilePath());
m_ui->publicKeyFilePathChooser->setPath(LinuxDeviceConfiguration::defaultPublicKeyFilePath()); m_ui->publicKeyFilePathChooser->setPath(IDevice::defaultPublicKeyFilePath());
handleSelectionChanged(); handleSelectionChanged();
} }
@@ -504,7 +502,7 @@ public:
private: private:
QString infoText() const QString infoText() const
{ {
if (m_wizardData.machineType == LinuxDeviceConfiguration::Emulator) if (m_wizardData.machineType == IDevice::Emulator)
return tr("The new device configuration will now be created."); return tr("The new device configuration will now be created.");
return GenericLinuxDeviceConfigurationWizardFinalPage::infoText(); return GenericLinuxDeviceConfigurationWizardFinalPage::infoText();
} }
@@ -563,7 +561,7 @@ IDevice::Ptr MaemoDeviceConfigWizard::device()
sshParams.userName = defaultUser(d->wizardData.deviceType); sshParams.userName = defaultUser(d->wizardData.deviceType);
sshParams.host = d->wizardData.hostName; sshParams.host = d->wizardData.hostName;
sshParams.port = d->wizardData.sshPort; sshParams.port = d->wizardData.sshPort;
if (d->wizardData.machineType == LinuxDeviceConfiguration::Emulator) { if (d->wizardData.machineType == IDevice::Emulator) {
sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword; sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword;
sshParams.password = d->wizardData.deviceType == Core::Id(MeeGoOsType) sshParams.password = d->wizardData.deviceType == Core::Id(MeeGoOsType)
? QLatin1String("meego") : QString(); ? QLatin1String("meego") : QString();
@@ -597,7 +595,7 @@ int MaemoDeviceConfigWizard::nextId() const
d->wizardData.machineType = d->startPage.machineType(); d->wizardData.machineType = d->startPage.machineType();
d->wizardData.hostName = d->startPage.hostName(); d->wizardData.hostName = d->startPage.hostName();
d->wizardData.sshPort = d->startPage.sshPort(); d->wizardData.sshPort = d->startPage.sshPort();
if (d->wizardData.machineType == LinuxDeviceConfiguration::Emulator) if (d->wizardData.machineType == IDevice::Emulator)
return FinalPageId; return FinalPageId;
return PreviousKeySetupCheckPageId; return PreviousKeySetupCheckPageId;
case PreviousKeySetupCheckPageId: case PreviousKeySetupCheckPageId:

View File

@@ -32,11 +32,12 @@
#include "maemoconstants.h" #include "maemoconstants.h"
#include "maemoqemumanager.h" #include "maemoqemumanager.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/profileinformation.h> #include <projectexplorer/profileinformation.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <remotelinux/linuxdeviceconfiguration.h> #include <qtsupport/qtprofileinformation.h>
#include <remotelinux/remotelinux_constants.h> #include <remotelinux/remotelinux_constants.h>
#include <utils/environment.h> #include <utils/environment.h>
@@ -46,6 +47,7 @@
#include <QString> #include <QString>
#include <QDesktopServices> #include <QDesktopServices>
using namespace ProjectExplorer;
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Constants; using namespace Qt4ProjectManager::Constants;
using namespace RemoteLinux; using namespace RemoteLinux;
@@ -56,9 +58,9 @@ namespace {
static const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX); static const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX);
} // namespace } // namespace
bool MaemoGlobal::hasMaemoDevice(const ProjectExplorer::Profile *p) bool MaemoGlobal::hasMaemoDevice(const Profile *p)
{ {
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(p); IDevice::ConstPtr dev = DeviceProfileInformation::device(p);
if (dev.isNull()) if (dev.isNull())
return false; return false;
@@ -67,9 +69,9 @@ bool MaemoGlobal::hasMaemoDevice(const ProjectExplorer::Profile *p)
|| type == Core::Id(MeeGoOsType); || type == Core::Id(MeeGoOsType);
} }
bool MaemoGlobal::supportsMaemoDevice(const ProjectExplorer::Profile *p) bool MaemoGlobal::supportsMaemoDevice(const Profile *p)
{ {
const Core::Id type = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(p); const Core::Id type = DeviceTypeProfileInformation::deviceTypeId(p);
return type == Core::Id(Maemo5OsType) || type == Core::Id(HarmattanOsType) return type == Core::Id(Maemo5OsType) || type == Core::Id(HarmattanOsType)
|| type == Core::Id(MeeGoOsType); || type == Core::Id(MeeGoOsType);
} }
@@ -124,9 +126,9 @@ QString MaemoGlobal::devrootshPath()
return QLatin1String("/usr/lib/mad-developer/devrootsh"); return QLatin1String("/usr/lib/mad-developer/devrootsh");
} }
int MaemoGlobal::applicationIconSize(const ProjectExplorer::Target *target) int MaemoGlobal::applicationIconSize(const Target *target)
{ {
Core::Id deviceType = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target->profile()); Core::Id deviceType = DeviceTypeProfileInformation::deviceTypeId(target->profile());
return deviceType == Core::Id(HarmattanOsType) ? 80 : 64; return deviceType == Core::Id(HarmattanOsType) ? 80 : 64;
} }
@@ -151,12 +153,14 @@ QString MaemoGlobal::remoteSourceProfilesCommand()
return QString::fromAscii(remoteCall); return QString::fromAscii(remoteCall);
} }
Utils::PortList MaemoGlobal::freePorts(const LinuxDeviceConfiguration::ConstPtr &devConf, Utils::PortList MaemoGlobal::freePorts(const Profile *profile)
const QtSupport::BaseQtVersion *qtVersion)
{ {
IDevice::ConstPtr devConf = DeviceProfileInformation::device(profile);
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtProfileInformation::qtVersion(profile);
if (!devConf || !qtVersion) if (!devConf || !qtVersion)
return Utils::PortList(); return Utils::PortList();
if (devConf->machineType() == LinuxDeviceConfiguration::Emulator) { if (devConf->machineType() == IDevice::Emulator) {
MaemoQemuRuntime rt; MaemoQemuRuntime rt;
const int id = qtVersion->uniqueId(); const int id = qtVersion->uniqueId();
if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt)) if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt))

View File

@@ -41,11 +41,8 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QProcess; class QProcess;
class QString;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace QtSupport { class BaseQtVersion; }
namespace RemoteLinux { class LinuxDeviceConfiguration; }
namespace ProjectExplorer { namespace ProjectExplorer {
class Profile; class Profile;
class Target; class Target;
@@ -96,8 +93,7 @@ public:
static int applicationIconSize(const ProjectExplorer::Target *target); static int applicationIconSize(const ProjectExplorer::Target *target);
static QString remoteSudo(Core::Id deviceType, const QString &uname); static QString remoteSudo(Core::Id 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 ProjectExplorer::Profile *profile);
const QtSupport::BaseQtVersion *qtVersion);
static void addMaddeEnvironment(Utils::Environment &env, const QString &qmakePath); static void addMaddeEnvironment(Utils::Environment &env, const QString &qmakePath);
static void transformMaddeCall(QString &command, QStringList &args, const QString &qmakePath); static void transformMaddeCall(QString &command, QStringList &args, const QString &qmakePath);

View File

@@ -34,10 +34,8 @@
#include "maemopublishingwizardfremantlefree.h" #include "maemopublishingwizardfremantlefree.h"
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qmakestep.h>
#include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h> #include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/baseqtversion.h> #include <qtsupport/baseqtversion.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>
#include <qtsupport/qtsupportconstants.h> #include <qtsupport/qtsupportconstants.h>

View File

@@ -50,8 +50,6 @@
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>
#include <qtsupport/qtversionmanager.h> #include <qtsupport/qtversionmanager.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <remotelinux/remotelinuxrunconfiguration.h> #include <remotelinux/remotelinuxrunconfiguration.h>
#include <utils/filesystemwatcher.h> #include <utils/filesystemwatcher.h>
@@ -68,7 +66,6 @@
#include <limits.h> #include <limits.h>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace RemoteLinux; using namespace RemoteLinux;
namespace Madde { namespace Madde {
@@ -105,7 +102,7 @@ MaemoQemuManager::MaemoQemuManager(QObject *parent)
m_qemuAction->setEnabled(false); m_qemuAction->setEnabled(false);
m_qemuAction->setVisible(false); m_qemuAction->setVisible(false);
// listen to qt version changes to update the start button // listen to Qt version changes to update the start button
connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)), connect(QtSupport::QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>,QList<int>,QList<int>)),
this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>))); this, SLOT(qtVersionsChanged(QList<int>,QList<int>,QList<int>)));
@@ -198,7 +195,7 @@ void MaemoQemuManager::qtVersionsChanged(const QList<int> &added, const QList<in
} }
} }
} else { } else {
// this qt version has been removed from the settings // this Qt version has been removed from the settings
m_runtimes.remove(uniqueId); m_runtimes.remove(uniqueId);
if (uniqueId == m_runningQtId) { if (uniqueId == m_runningQtId) {
terminateRuntime(); terminateRuntime();
@@ -252,7 +249,7 @@ void MaemoQemuManager::targetAdded(ProjectExplorer::Target *target)
if (!target || !MaemoGlobal::hasMaemoDevice(target->profile())) if (!target || !MaemoGlobal::hasMaemoDevice(target->profile()))
return; return;
// handle the qt version changes the build configuration uses // handle the Qt version changes the build configuration uses
connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged())); connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
connect(target, SIGNAL(profileChanged()), this, SLOT(systemChanged())); connect(target, SIGNAL(profileChanged()), this, SLOT(systemChanged()));
@@ -286,7 +283,7 @@ void MaemoQemuManager::systemChanged()
void MaemoQemuManager::environmentChanged() void MaemoQemuManager::environmentChanged()
{ {
// likely to happen when the qt version changes the build config is using // likely to happen when the Qt version changes the build config is using
if (ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance()) { if (ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance()) {
if (Project *project = explorer->session()->startupProject()) if (Project *project = explorer->session()->startupProject())
toggleStarterButton(project->activeTarget()); toggleStarterButton(project->activeTarget());
@@ -516,10 +513,8 @@ bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
if (qtVersion) if (qtVersion)
*qtVersion = version; *qtVersion = version;
const LinuxDeviceConfiguration::ConstPtr &config const IDevice::ConstPtr config = DeviceProfileInformation::device(target->profile());
= ProjectExplorer::DeviceProfileInformation::device(target->profile()) return !config.isNull() && config->machineType() == IDevice::Emulator;
.dynamicCast<const LinuxDeviceConfiguration>();
return !config.isNull() && config->machineType() == LinuxDeviceConfiguration::Emulator;
} }
void MaemoQemuManager::notify(const QList<int> uniqueIds) void MaemoQemuManager::notify(const QList<int> uniqueIds)

View File

@@ -83,7 +83,7 @@ private slots:
void targetChanged(ProjectExplorer::Target *target); void targetChanged(ProjectExplorer::Target *target);
void systemChanged(); void systemChanged();
void environmentChanged(); // needed to check for qt version void environmentChanged(); // needed to check for Qt version
void deviceConfigurationChanged(ProjectExplorer::Target *target); void deviceConfigurationChanged(ProjectExplorer::Target *target);
void terminateRuntime(); void terminateRuntime();

View File

@@ -40,8 +40,6 @@
#include <QStringList> #include <QStringList>
#include <QTextStream> #include <QTextStream>
using namespace RemoteLinux;
namespace Madde { namespace Madde {
namespace Internal { namespace Internal {

View File

@@ -31,14 +31,14 @@
#include "maemoglobal.h" #include "maemoglobal.h"
#include <remotelinux/linuxdeviceconfiguration.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
#include <ssh/sshremoteprocessrunner.h> #include <ssh/sshremoteprocessrunner.h>
#include <QDir> #include <QDir>
using namespace RemoteLinux; using namespace ProjectExplorer;
using namespace QSsh; using namespace QSsh;
using namespace RemoteLinux;
namespace Madde { namespace Madde {
namespace Internal { namespace Internal {
@@ -51,7 +51,7 @@ MaemoRemoteCopyFacility::MaemoRemoteCopyFacility(QObject *parent) :
MaemoRemoteCopyFacility::~MaemoRemoteCopyFacility() {} MaemoRemoteCopyFacility::~MaemoRemoteCopyFacility() {}
void MaemoRemoteCopyFacility::copyFiles(SshConnection *connection, void MaemoRemoteCopyFacility::copyFiles(SshConnection *connection,
const LinuxDeviceConfiguration::ConstPtr &devConf, const IDevice::ConstPtr &devConf,
const QList<DeployableFile> &deployables, const QString &mountPoint) const QList<DeployableFile> &deployables, const QString &mountPoint)
{ {
Q_ASSERT(connection->state() == SshConnection::Connected); Q_ASSERT(connection->state() == SshConnection::Connected);

View File

@@ -32,21 +32,16 @@
#define MAEMOREMOTECOPYFACILITY_H #define MAEMOREMOTECOPYFACILITY_H
#include <remotelinux/deployablefile.h> #include <remotelinux/deployablefile.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <QList> #include <QList>
#include <QObject>
#include <QSharedPointer> #include <QSharedPointer>
#include <QString>
namespace QSsh { namespace QSsh {
class SshConnection; class SshConnection;
class SshRemoteProcessRunner; class SshRemoteProcessRunner;
} }
namespace RemoteLinux {
class LinuxDeviceConfiguration;
}
namespace Madde { namespace Madde {
namespace Internal { namespace Internal {
@@ -58,7 +53,7 @@ public:
~MaemoRemoteCopyFacility(); ~MaemoRemoteCopyFacility();
void copyFiles(QSsh::SshConnection *connection, void copyFiles(QSsh::SshConnection *connection,
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf, const ProjectExplorer::IDevice::ConstPtr &devConf,
const QList<RemoteLinux::DeployableFile> &deployables, const QString &mountPoint); const QList<RemoteLinux::DeployableFile> &deployables, const QString &mountPoint);
void cancel(); void cancel();
@@ -81,7 +76,7 @@ private:
QSsh::SshRemoteProcessRunner *m_copyRunner; QSsh::SshRemoteProcessRunner *m_copyRunner;
QSsh::SshRemoteProcessRunner *m_killProcess; QSsh::SshRemoteProcessRunner *m_killProcess;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_devConf; ProjectExplorer::IDevice::ConstPtr m_devConf;
QList<RemoteLinux::DeployableFile> m_deployables; QList<RemoteLinux::DeployableFile> m_deployables;
QString m_mountPoint; QString m_mountPoint;
bool m_isCopying; // TODO: Redundant due to being in sync with m_copyRunner? bool m_isCopying; // TODO: Redundant due to being in sync with m_copyRunner?

View File

@@ -37,17 +37,14 @@
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
#include <ssh/sshremoteprocess.h> #include <ssh/sshremoteprocess.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/baseqtversion.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <remotelinux/remotelinuxusedportsgatherer.h> #include <remotelinux/remotelinuxusedportsgatherer.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QTimer> #include <QTimer>
using namespace Qt4ProjectManager; using namespace ProjectExplorer;
using namespace RemoteLinux;
using namespace QSsh; using namespace QSsh;
using namespace RemoteLinux;
using namespace Utils; using namespace Utils;
namespace Madde { namespace Madde {
@@ -67,7 +64,7 @@ MaemoRemoteMounter::~MaemoRemoteMounter()
} }
void MaemoRemoteMounter::setConnection(SshConnection *connection, void MaemoRemoteMounter::setConnection(SshConnection *connection,
const LinuxDeviceConfiguration::ConstPtr &devConf) const IDevice::ConstPtr &devConf)
{ {
QTC_ASSERT(m_state == Inactive, return); QTC_ASSERT(m_state == Inactive, return);
@@ -75,13 +72,13 @@ void MaemoRemoteMounter::setConnection(SshConnection *connection,
m_devConf = devConf; m_devConf = devConf;
} }
void MaemoRemoteMounter::setBuildConfiguration(const Qt4BuildConfiguration *bc) void MaemoRemoteMounter::setProfile(const Profile *profile)
{ {
QTC_ASSERT(m_state == Inactive, return); QTC_ASSERT(m_state == Inactive, return);
Core::Id typeId = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(bc->target()->profile()); Core::Id typeId = DeviceTypeProfileInformation::deviceTypeId(profile);
m_remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId); m_remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId);
m_maddeRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(bc->target()->profile()); m_maddeRoot = SysRootProfileInformation::sysRoot(profile);
} }
void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec, void MaemoRemoteMounter::addMountSpecification(const MaemoMountSpecification &mountSpec,

View File

@@ -33,6 +33,7 @@
#include "maemomountspecification.h" #include "maemomountspecification.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <QList> #include <QList>
@@ -44,18 +45,13 @@
QT_FORWARD_DECLARE_CLASS(QTimer) QT_FORWARD_DECLARE_CLASS(QTimer)
namespace QSsh { namespace QSsh {
class SftpChannel;
class SshConnection; class SshConnection;
class SshRemoteProcess; class SshRemoteProcess;
} }
namespace ProjectExplorer { class Profile; }
namespace RemoteLinux { class RemoteLinuxUsedPortsGatherer; }
namespace Utils { class PortList; } namespace Utils { class PortList; }
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace RemoteLinux {
class LinuxDeviceConfiguration;
class RemoteLinuxUsedPortsGatherer;
}
namespace Madde { namespace Madde {
namespace Internal { namespace Internal {
@@ -69,9 +65,9 @@ public:
// Must already be connected. // Must already be connected.
void setConnection(QSsh::SshConnection *connection, void setConnection(QSsh::SshConnection *connection,
const QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> &devConf); const ProjectExplorer::IDevice::ConstPtr &devConf);
void setBuildConfiguration(const Qt4ProjectManager::Qt4BuildConfiguration *bc); void setProfile(const ProjectExplorer::Profile *profile);
void addMountSpecification(const MaemoMountSpecification &mountSpec, void addMountSpecification(const MaemoMountSpecification &mountSpec,
bool mountAsRoot); bool mountAsRoot);
bool hasValidMountSpecifications() const; bool hasValidMountSpecifications() const;
@@ -124,7 +120,7 @@ private:
}; };
QSsh::SshConnection *m_connection; QSsh::SshConnection *m_connection;
QSharedPointer<const RemoteLinux::LinuxDeviceConfiguration> m_devConf; ProjectExplorer::IDevice::ConstPtr m_devConf;
QList<MountInfo> m_mountSpecs; QList<MountInfo> m_mountSpecs;
QSharedPointer<QSsh::SshRemoteProcess> m_mountProcess; QSharedPointer<QSsh::SshRemoteProcess> m_mountProcess;
QSharedPointer<QSsh::SshRemoteProcess> m_unmountProcess; QSharedPointer<QSsh::SshRemoteProcess> m_unmountProcess;

View File

@@ -33,14 +33,13 @@
#include "maemoglobal.h" #include "maemoglobal.h"
#include "maemoremotemountsmodel.h" #include "maemoremotemountsmodel.h"
#include "maemorunconfigurationwidget.h" #include "maemorunconfigurationwidget.h"
#include "qt4maemodeployconfiguration.h"
#include <debugger/debuggerconstants.h> #include <debugger/debuggerconstants.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/profileinformation.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/qtprofileinformation.h>
#include <utils/portlist.h> #include <utils/portlist.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
@@ -48,7 +47,6 @@
#include <QFileInfo> #include <QFileInfo>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace RemoteLinux; using namespace RemoteLinux;
namespace Madde { namespace Madde {
@@ -121,9 +119,7 @@ QString MaemoRunConfiguration::environmentPreparationCommand() const
QString MaemoRunConfiguration::commandPrefix() const QString MaemoRunConfiguration::commandPrefix() const
{ {
LinuxDeviceConfiguration::ConstPtr dev = IDevice::ConstPtr dev = DeviceProfileInformation::device(target()->profile());
ProjectExplorer::DeviceProfileInformation::device(target()->profile())
.dynamicCast<const LinuxDeviceConfiguration>();
if (!dev) if (!dev)
return QString(); return QString();
@@ -136,9 +132,7 @@ QString MaemoRunConfiguration::commandPrefix() const
Utils::PortList MaemoRunConfiguration::freePorts() const Utils::PortList MaemoRunConfiguration::freePorts() const
{ {
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile()); return MaemoGlobal::freePorts(target()->profile());
return MaemoGlobal::freePorts(ProjectExplorer::DeviceProfileInformation::device(target()->profile())
.staticCast<const LinuxDeviceConfiguration>(), version);
} }
QString MaemoRunConfiguration::localDirToMountForRemoteGdb() const QString MaemoRunConfiguration::localDirToMountForRemoteGdb() const
@@ -162,7 +156,7 @@ QString MaemoRunConfiguration::localDirToMountForRemoteGdb() const
QString MaemoRunConfiguration::remoteProjectSourcesMountPoint() const QString MaemoRunConfiguration::remoteProjectSourcesMountPoint() const
{ {
return MaemoGlobal::homeDirOnDevice(ProjectExplorer::DeviceProfileInformation::device(target()->profile())->sshParameters().userName) return MaemoGlobal::homeDirOnDevice(DeviceProfileInformation::device(target()->profile())->sshParameters().userName)
+ QLatin1String("/gdbSourcesDir_") + QLatin1String("/gdbSourcesDir_")
+ QFileInfo(localExecutableFilePath()).fileName(); + QFileInfo(localExecutableFilePath()).fileName();
} }
@@ -170,7 +164,7 @@ QString MaemoRunConfiguration::remoteProjectSourcesMountPoint() const
bool MaemoRunConfiguration::hasEnoughFreePorts(RunMode mode) const bool MaemoRunConfiguration::hasEnoughFreePorts(RunMode mode) const
{ {
const int freePortCount = freePorts().count(); const int freePortCount = freePorts().count();
Core::Id typeId = ProjectExplorer::DeviceTypeProfileInformation::deviceTypeId(target()->profile()); Core::Id typeId = DeviceTypeProfileInformation::deviceTypeId(target()->profile());
const bool remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId); const bool remoteMountsAllowed = MaddeDevice::allowsRemoteMounts(typeId);
const int mountDirCount = remoteMountsAllowed const int mountDirCount = remoteMountsAllowed
? remoteMounts()->validMountSpecificationCount() : 0; ? remoteMounts()->validMountSpecificationCount() : 0;

View File

@@ -33,16 +33,15 @@
#include "maemoremotemountsmodel.h" #include "maemoremotemountsmodel.h"
#include "maemorunconfiguration.h" #include "maemorunconfiguration.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>
#include <remotelinux/linuxdeviceconfiguration.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
using namespace Qt4ProjectManager; using namespace ProjectExplorer;
using namespace RemoteLinux;
using namespace QSsh; using namespace QSsh;
using namespace RemoteLinux;
namespace Madde { namespace Madde {
namespace Internal { namespace Internal {
@@ -53,9 +52,10 @@ MaemoSshRunner::MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig
m_mountSpecs(runConfig->remoteMounts()->mountSpecs()), m_mountSpecs(runConfig->remoteMounts()->mountSpecs()),
m_mountState(InactiveMountState) m_mountState(InactiveMountState)
{ {
const Qt4BuildConfiguration * const bc = runConfig->activeQt4BuildConfiguration(); const BuildConfiguration * const bc = runConfig->target()->activeBuildConfiguration();
m_qtId = bc ? QtSupport::QtProfileInformation::qtVersionId(bc->target()->profile()) : -1; Profile *profile = bc ? bc->target()->profile() : 0;
m_mounter->setBuildConfiguration(bc); m_qtId = QtSupport::QtProfileInformation::qtVersionId(profile);
m_mounter->setProfile(profile);
connect(m_mounter, SIGNAL(mounted()), this, SLOT(handleMounted())); connect(m_mounter, SIGNAL(mounted()), this, SLOT(handleMounted()));
connect(m_mounter, SIGNAL(unmounted()), this, SLOT(handleUnmounted())); connect(m_mounter, SIGNAL(unmounted()), this, SLOT(handleUnmounted()));
connect(m_mounter, SIGNAL(error(QString)), this, connect(m_mounter, SIGNAL(error(QString)), this,
@@ -66,14 +66,12 @@ MaemoSshRunner::MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig
SIGNAL(mountDebugOutput(QString))); SIGNAL(mountDebugOutput(QString)));
} }
MaemoSshRunner::~MaemoSshRunner() {}
bool MaemoSshRunner::canRun(QString &whyNot) const bool MaemoSshRunner::canRun(QString &whyNot) const
{ {
if (!AbstractRemoteLinuxApplicationRunner::canRun(whyNot)) if (!AbstractRemoteLinuxApplicationRunner::canRun(whyNot))
return false; return false;
if (devConfig()->machineType() == LinuxDeviceConfiguration::Emulator if (devConfig()->machineType() == IDevice::Emulator
&& !MaemoQemuManager::instance().qemuIsRunning()) { && !MaemoQemuManager::instance().qemuIsRunning()) {
MaemoQemuRuntime rt; MaemoQemuRuntime rt;
if (MaemoQemuManager::instance().runtimeForQtVersion(m_qtId, &rt)) { if (MaemoQemuManager::instance().runtimeForQtVersion(m_qtId, &rt)) {

View File

@@ -42,9 +42,9 @@ class MaemoRunConfiguration;
class MaemoSshRunner : public RemoteLinux::AbstractRemoteLinuxApplicationRunner class MaemoSshRunner : public RemoteLinux::AbstractRemoteLinuxApplicationRunner
{ {
Q_OBJECT Q_OBJECT
public: public:
MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig); MaemoSshRunner(QObject *parent, MaemoRunConfiguration *runConfig);
~MaemoSshRunner();
signals: signals:
void mountDebugOutput(const QString &output); void mountDebugOutput(const QString &output);

View File

@@ -38,7 +38,6 @@
#include <coreplugin/documentmanager.h> #include <coreplugin/documentmanager.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>
#include <utils/filesystemwatcher.h> #include <utils/filesystemwatcher.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>

View File

@@ -71,7 +71,9 @@ IDevice::Ptr DesktopDevice::clone() const
return Ptr(new DesktopDevice(*this)); return Ptr(new DesktopDevice(*this));
} }
DesktopDevice::DesktopDevice() : IDevice(Core::Id(Constants::DESKTOP_DEVICE_TYPE), IDevice::AutoDetected, DesktopDevice::DesktopDevice() : IDevice(Core::Id(Constants::DESKTOP_DEVICE_TYPE),
IDevice::AutoDetected,
IDevice::Hardware,
Core::Id(Constants::DESKTOP_DEVICE_ID)) Core::Id(Constants::DESKTOP_DEVICE_ID))
{ {
setDisplayName(QCoreApplication::translate("ProjectExplorer::DesktopDevice", "Run locally")); setDisplayName(QCoreApplication::translate("ProjectExplorer::DesktopDevice", "Run locally"));

View File

@@ -150,6 +150,7 @@ const char DisplayNameKey[] = "Name";
const char TypeKey[] = "OsType"; const char TypeKey[] = "OsType";
const char IdKey[] = "InternalId"; const char IdKey[] = "InternalId";
const char OriginKey[] = "Origin"; const char OriginKey[] = "Origin";
const char MachineTypeKey[] = "Type";
// Connection // Connection
const char HostKey[] = "Host"; const char HostKey[] = "Host";
@@ -163,6 +164,7 @@ const char TimeoutKey[] = "Timeout";
typedef QSsh::SshConnectionParameters::AuthenticationType AuthType; typedef QSsh::SshConnectionParameters::AuthenticationType AuthType;
const AuthType DefaultAuthType = QSsh::SshConnectionParameters::AuthenticationByKey; const AuthType DefaultAuthType = QSsh::SshConnectionParameters::AuthenticationByKey;
const IDevice::MachineType DefaultMachineType = IDevice::Hardware;
const int DefaultTimeout = 10; const int DefaultTimeout = 10;
@@ -172,7 +174,8 @@ class IDevicePrivate
public: public:
IDevicePrivate() : IDevicePrivate() :
origin(IDevice::AutoDetected), origin(IDevice::AutoDetected),
deviceState(IDevice::DeviceStateUnknown) deviceState(IDevice::DeviceStateUnknown),
machineType(IDevice::Hardware)
{ } { }
QString displayName; QString displayName;
@@ -180,6 +183,7 @@ public:
IDevice::Origin origin; IDevice::Origin origin;
Core::Id id; Core::Id id;
IDevice::DeviceState deviceState; IDevice::DeviceState deviceState;
IDevice::MachineType machineType;
QSsh::SshConnectionParameters sshParameters; QSsh::SshConnectionParameters sshParameters;
Utils::PortList freePorts; Utils::PortList freePorts;
@@ -189,10 +193,12 @@ public:
IDevice::IDevice() : d(new Internal::IDevicePrivate) IDevice::IDevice() : d(new Internal::IDevicePrivate)
{ } { }
IDevice::IDevice(Core::Id type, Origin origin, Core::Id id) : d(new Internal::IDevicePrivate) IDevice::IDevice(Core::Id type, Origin origin, MachineType machineType, Core::Id id)
: d(new Internal::IDevicePrivate)
{ {
d->type = type; d->type = type;
d->origin = origin; d->origin = origin;
d->machineType = machineType;
QTC_CHECK(origin == ManuallyAdded || id.isValid()); QTC_CHECK(origin == ManuallyAdded || id.isValid());
d->id = id.isValid() ? id : newId(); d->id = id.isValid() ? id : newId();
} }
@@ -288,6 +294,7 @@ void IDevice::fromMap(const QVariantMap &map)
d->freePorts = Utils::PortList::fromString(map.value(PortsSpecKey, d->freePorts = Utils::PortList::fromString(map.value(PortsSpecKey,
QLatin1String("10000-10100")).toString()); QLatin1String("10000-10100")).toString());
d->machineType = static_cast<MachineType>(map.value(MachineTypeKey, DefaultMachineType).toInt());
} }
QVariantMap IDevice::toMap() const QVariantMap IDevice::toMap() const
@@ -298,6 +305,7 @@ QVariantMap IDevice::toMap() const
map.insert(QLatin1String(IdKey), d->id.name()); map.insert(QLatin1String(IdKey), d->id.name());
map.insert(QLatin1String(OriginKey), d->origin); map.insert(QLatin1String(OriginKey), d->origin);
map.insert(MachineTypeKey, d->machineType);
map.insert(HostKey, d->sshParameters.host); map.insert(HostKey, d->sshParameters.host);
map.insert(SshPortKey, d->sshParameters.port); map.insert(SshPortKey, d->sshParameters.port);
map.insert(UserNameKey, d->sshParameters.userName); map.insert(UserNameKey, d->sshParameters.userName);
@@ -353,6 +361,11 @@ Utils::PortList IDevice::freePorts() const
return d->freePorts; return d->freePorts;
} }
IDevice::MachineType IDevice::machineType() const
{
return d->machineType;
}
QString IDevice::defaultPrivateKeyFilePath() QString IDevice::defaultPrivateKeyFilePath()
{ {
return QDesktopServices::storageLocation(QDesktopServices::HomeLocation) return QDesktopServices::storageLocation(QDesktopServices::HomeLocation)

View File

@@ -57,6 +57,7 @@ public:
typedef QSharedPointer<const IDevice> ConstPtr; typedef QSharedPointer<const IDevice> ConstPtr;
enum Origin { ManuallyAdded, AutoDetected }; enum Origin { ManuallyAdded, AutoDetected };
enum MachineType { Hardware, Emulator };
virtual ~IDevice(); virtual ~IDevice();
@@ -108,9 +109,11 @@ public:
Utils::PortList freePorts() const; Utils::PortList freePorts() const;
void setFreePorts(const Utils::PortList &freePorts); void setFreePorts(const Utils::PortList &freePorts);
MachineType machineType() const;
protected: protected:
IDevice(); IDevice();
IDevice(Core::Id type, Origin origin, Core::Id id = Core::Id()); IDevice(Core::Id type, Origin origin, MachineType machineType, Core::Id id = Core::Id());
IDevice(const IDevice &other); IDevice(const IDevice &other);
Ptr sharedFromThis(); Ptr sharedFromThis();

View File

@@ -35,10 +35,6 @@
#include "subcomponentmanager.h" #include "subcomponentmanager.h"
#include "model/viewlogger.h" #include "model/viewlogger.h"
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/qtprofileinformation.h>
#include <itemlibraryview.h> #include <itemlibraryview.h>
#include <itemlibrarywidget.h> #include <itemlibrarywidget.h>
#include <navigatorview.h> #include <navigatorview.h>
@@ -62,8 +58,15 @@
#include <model/modelnodecontextmenu.h> #include <model/modelnodecontextmenu.h>
#include <designmodewidget.h> #include <designmodewidget.h>
#include <utils/fileutils.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
#include <qmlprojectmanager/qmlprojectrunconfiguration.h>
#include <qtsupport/qtprofileinformation.h>
#include <qtsupport/qtsupportconstants.h>
#include <qtsupport/qtversionmanager.h>
#include <utils/crumblepath.h> #include <utils/crumblepath.h>
#include <utils/fileutils.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <QDir> #include <QDir>
@@ -87,12 +90,6 @@
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QApplication> #include <QApplication>
#include <projectexplorer/projectexplorer.h>
#include <qt4projectmanager/qt4project.h>
#include <qtsupport/qtversionmanager.h>
#include <qtsupport/qtsupportconstants.h>
#include <qmlprojectmanager/qmlprojectrunconfiguration.h>
enum { enum {
debug = false debug = false
}; };

View File

@@ -69,7 +69,6 @@
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actioncontainer.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt-s60/s60devicedebugruncontrol.h> #include <qt4projectmanager/qt-s60/s60devicedebugruncontrol.h>
#include <qt4projectmanager/qt-s60/s60devicerunconfiguration.h> #include <qt4projectmanager/qt-s60/s60devicerunconfiguration.h>
#include <qt4projectmanager/qt-s60/s60deployconfiguration.h> #include <qt4projectmanager/qt-s60/s60deployconfiguration.h>

View File

@@ -79,6 +79,7 @@ bool parseRunningState(const QString &line)
} }
} }
using namespace ProjectExplorer;
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
@@ -97,18 +98,16 @@ BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool debugMode, BlackBe
{ {
QTC_ASSERT(runConfiguration, return); QTC_ASSERT(runConfiguration, return);
Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfig = runConfiguration->activeQt4BuildConfiguration(); Target *target = runConfiguration->target();
m_environment = qt4BuildConfig->environment(); BuildConfiguration *buildConfig = target->activeBuildConfiguration();
m_environment = buildConfig->environment();
m_deployCmd = m_environment.searchInPath(QLatin1String(DEPLOY_CMD)); m_deployCmd = m_environment.searchInPath(QLatin1String(DEPLOY_CMD));
m_deviceHost = runConfiguration->deployConfiguration()->deviceHost(); m_deviceHost = runConfiguration->deployConfiguration()->deviceHost();
m_password = runConfiguration->deployConfiguration()->password(); m_password = runConfiguration->deployConfiguration()->password();
m_barPackage = runConfiguration->barPackage();
BlackBerryRunConfiguration *blackberryRunConfiguration = qobject_cast<BlackBerryRunConfiguration *>(runConfiguration); BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target->profile());
if (blackberryRunConfiguration)
m_barPackage = blackberryRunConfiguration->barPackage();
BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(runConfiguration->target()->profile());
m_sshParams = device->sshParameters(); m_sshParams = device->sshParameters();
// The BlackBerry device always uses key authentication // The BlackBerry device always uses key authentication
m_sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByKey; m_sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByKey;

View File

@@ -35,7 +35,7 @@
#include "blackberryrunconfiguration.h" #include "blackberryrunconfiguration.h"
#include "blackberrydeployconfiguration.h" #include "blackberrydeployconfiguration.h"
#include <qt4projectmanager/qt4buildconfiguration.h> #include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -43,6 +43,7 @@
#include <QProcess> #include <QProcess>
#include <QApplication> #include <QApplication>
using namespace ProjectExplorer;
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
@@ -90,8 +91,9 @@ BlackBerryConnect::BlackBerryConnect(BlackBerryRunConfiguration *runConfig)
m_process = new QProcess(this); m_process = new QProcess(this);
Utils::Environment env; Utils::Environment env;
if (runConfig->activeQt4BuildConfiguration()) Target *target = runConfig->target();
env = runConfig->activeQt4BuildConfiguration()->environment(); if (target->activeBuildConfiguration())
env = target->activeBuildConfiguration()->environment();
m_process->setEnvironment(env.toStringList()); m_process->setEnvironment(env.toStringList());
m_connectCmd = env.searchInPath(QLatin1String(CONNECT_CMD)); m_connectCmd = env.searchInPath(QLatin1String(CONNECT_CMD));
@@ -101,7 +103,7 @@ BlackBerryConnect::BlackBerryConnect(BlackBerryRunConfiguration *runConfig)
m_deviceHost = deployConfig->deviceHost(); m_deviceHost = deployConfig->deviceHost();
m_password = deployConfig->password(); m_password = deployConfig->password();
BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(runConfig->target()->profile()); BlackBerryDeviceConfiguration::ConstPtr device = BlackBerryDeviceConfiguration::device(target->profile());
m_publicKeyFile = device->sshParameters().privateKeyFile + QLatin1String(".pub"); m_publicKeyFile = device->sshParameters().privateKeyFile + QLatin1String(".pub");
connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput())); connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));

View File

@@ -40,6 +40,7 @@
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
using namespace ProjectExplorer;
BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration() BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration()
: RemoteLinux::LinuxDeviceConfiguration() : RemoteLinux::LinuxDeviceConfiguration()
@@ -47,8 +48,8 @@ BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration()
} }
BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration(const QString &name, Core::Id type, BlackBerryDeviceConfiguration::BlackBerryDeviceConfiguration(const QString &name, Core::Id type,
RemoteLinux::LinuxDeviceConfiguration::MachineType machineType, IDevice::MachineType machineType,
ProjectExplorer::IDevice::Origin origin, Core::Id id) IDevice::Origin origin, Core::Id id)
: RemoteLinux::LinuxDeviceConfiguration(name, type, machineType, origin, id) : RemoteLinux::LinuxDeviceConfiguration(name, type, machineType, origin, id)
{ {
} }
@@ -65,8 +66,8 @@ BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfiguration::create()
} }
BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfiguration::create(const QString &name, Core::Id type, BlackBerryDeviceConfiguration::Ptr BlackBerryDeviceConfiguration::create(const QString &name, Core::Id type,
RemoteLinux::LinuxDeviceConfiguration::MachineType machineType, IDevice::MachineType machineType,
ProjectExplorer::IDevice::Origin origin, Core::Id id) IDevice::Origin origin, Core::Id id)
{ {
return Ptr(new BlackBerryDeviceConfiguration(name, type, machineType, origin, id)); return Ptr(new BlackBerryDeviceConfiguration(name, type, machineType, origin, id));
} }
@@ -87,14 +88,14 @@ void BlackBerryDeviceConfiguration::fromMap(const QVariantMap &map)
m_debugToken = map.value(QLatin1String(Constants::QNX_DEBUG_TOKEN_KEY)).toString(); m_debugToken = map.value(QLatin1String(Constants::QNX_DEBUG_TOKEN_KEY)).toString();
} }
ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfiguration::clone() const IDevice::Ptr BlackBerryDeviceConfiguration::clone() const
{ {
return Ptr(new BlackBerryDeviceConfiguration(*this)); return Ptr(new BlackBerryDeviceConfiguration(*this));
} }
BlackBerryDeviceConfiguration::ConstPtr BlackBerryDeviceConfiguration::device(const ProjectExplorer::Profile *p) BlackBerryDeviceConfiguration::ConstPtr BlackBerryDeviceConfiguration::device(const Profile *p)
{ {
ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(p); IDevice::ConstPtr dev = DeviceProfileInformation::device(p);
return dev.dynamicCast<const BlackBerryDeviceConfiguration>(); return dev.dynamicCast<const BlackBerryDeviceConfiguration>();
} }
@@ -103,7 +104,7 @@ QString BlackBerryDeviceConfiguration::displayType() const
return tr("BlackBerry"); return tr("BlackBerry");
} }
ProjectExplorer::IDeviceWidget *BlackBerryDeviceConfiguration::createWidget() IDeviceWidget *BlackBerryDeviceConfiguration::createWidget()
{ {
return new BlackBerryDeviceConfigurationWidget(sharedFromThis() return new BlackBerryDeviceConfigurationWidget(sharedFromThis()
.staticCast<BlackBerryDeviceConfiguration>()); .staticCast<BlackBerryDeviceConfiguration>());

View File

@@ -35,15 +35,14 @@
#include "ui_blackberrydeviceconfigurationwidget.h" #include "ui_blackberrydeviceconfigurationwidget.h"
#include "qnxconstants.h" #include "qnxconstants.h"
#include <remotelinux/linuxdeviceconfiguration.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
#include <utils/pathchooser.h> #include <utils/pathchooser.h>
using namespace ProjectExplorer;
using namespace Qnx::Internal; using namespace Qnx::Internal;
BlackBerryDeviceConfigurationWidget::BlackBerryDeviceConfigurationWidget(const ProjectExplorer::IDevice::Ptr &device, QWidget *parent) : BlackBerryDeviceConfigurationWidget::BlackBerryDeviceConfigurationWidget(const IDevice::Ptr &device, QWidget *parent) :
ProjectExplorer::IDeviceWidget(device, parent), IDeviceWidget(device, parent),
ui(new Ui::BlackBerryDeviceConfigurationWidget) ui(new Ui::BlackBerryDeviceConfigurationWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
@@ -112,7 +111,7 @@ void BlackBerryDeviceConfigurationWidget::initGui()
ui->showPasswordCheckBox->setChecked(false); ui->showPasswordCheckBox->setChecked(false);
ui->debugToken->setPath(deviceConfiguration()->debugToken()); ui->debugToken->setPath(deviceConfiguration()->debugToken());
if (deviceConfiguration()->machineType() == RemoteLinux::LinuxDeviceConfiguration::Emulator) { if (deviceConfiguration()->machineType() == IDevice::Emulator) {
ui->debugToken->setEnabled(false); ui->debugToken->setEnabled(false);
ui->debugTokenLabel->setEnabled(false); ui->debugTokenLabel->setEnabled(false);
} }

View File

@@ -41,6 +41,7 @@
#include <QFormLayout> #include <QFormLayout>
#include <QMessageBox> #include <QMessageBox>
using namespace ProjectExplorer;
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
@@ -110,12 +111,9 @@ QString BlackBerryDeviceConfigurationWizardSetupPage::debugToken() const
return m_ui->debugToken->fileName().toString(); return m_ui->debugToken->fileName().toString();
} }
RemoteLinux::LinuxDeviceConfiguration::MachineType BlackBerryDeviceConfigurationWizardSetupPage::machineType() const IDevice::MachineType BlackBerryDeviceConfigurationWizardSetupPage::machineType() const
{ {
if (m_ui->physicalDevice->isChecked()) return m_ui->physicalDevice->isChecked() ? IDevice::Hardware : IDevice::Emulator;
return RemoteLinux::LinuxDeviceConfiguration::Hardware;
else
return RemoteLinux::LinuxDeviceConfiguration::Emulator;
} }

View File

@@ -63,7 +63,7 @@ public:
QString hostName() const; QString hostName() const;
QString password() const; QString password() const;
QString debugToken() const; QString debugToken() const;
RemoteLinux::LinuxDeviceConfiguration::MachineType machineType() const; ProjectExplorer::IDevice::MachineType machineType() const;
private: private:
Ui::BlackBerryDeviceConfigurationWizardSetupPage *m_ui; Ui::BlackBerryDeviceConfigurationWizardSetupPage *m_ui;

View File

@@ -142,11 +142,6 @@ BlackBerryDeployConfiguration *BlackBerryRunConfiguration::deployConfiguration()
return qobject_cast<BlackBerryDeployConfiguration *>(target()->activeDeployConfiguration()); return qobject_cast<BlackBerryDeployConfiguration *>(target()->activeDeployConfiguration());
} }
Qt4ProjectManager::Qt4BuildConfiguration *BlackBerryRunConfiguration::activeQt4BuildConfiguration() const
{
return static_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(activeBuildConfiguration());
}
QString BlackBerryRunConfiguration::key() const QString BlackBerryRunConfiguration::key() const
{ {
return barPackage() + QLatin1Char('_') + BlackBerryDeviceConfiguration::device(target()->profile())->sshParameters().host; return barPackage() + QLatin1Char('_') + BlackBerryDeviceConfiguration::device(target()->profile())->sshParameters().host;

View File

@@ -57,7 +57,7 @@ QnxDeviceConfiguration::Ptr QnxDeviceConfiguration::create()
return Ptr(new QnxDeviceConfiguration); return Ptr(new QnxDeviceConfiguration);
} }
QnxDeviceConfiguration::Ptr QnxDeviceConfiguration::create(const QString &name, Core::Id type, RemoteLinux::LinuxDeviceConfiguration::MachineType machineType, ProjectExplorer::IDevice::Origin origin, Core::Id id) QnxDeviceConfiguration::Ptr QnxDeviceConfiguration::create(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id)
{ {
return Ptr(new QnxDeviceConfiguration(name, type, machineType, origin, id)); return Ptr(new QnxDeviceConfiguration(name, type, machineType, origin, id));
} }

View File

@@ -44,6 +44,7 @@
#include <remotelinux/remotelinuxusedportsgatherer.h> #include <remotelinux/remotelinuxusedportsgatherer.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
using namespace ProjectExplorer;
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
@@ -60,7 +61,7 @@ QnxDeviceConfigurationWizard::QnxDeviceConfigurationWizard(QWidget *parent) :
m_finalPage->setCommitPage(true); m_finalPage->setCommitPage(true);
} }
ProjectExplorer::IDevice::Ptr QnxDeviceConfigurationWizard::device() IDevice::Ptr QnxDeviceConfigurationWizard::device()
{ {
QSsh::SshConnectionParameters sshParams; QSsh::SshConnectionParameters sshParams;
sshParams.proxyType = QSsh::SshConnectionParameters::NoProxy; sshParams.proxyType = QSsh::SshConnectionParameters::NoProxy;
@@ -76,7 +77,7 @@ ProjectExplorer::IDevice::Ptr QnxDeviceConfigurationWizard::device()
} }
QnxDeviceConfiguration::Ptr devConf = QnxDeviceConfiguration::create(m_setupPage->configurationName(), QnxDeviceConfiguration::Ptr devConf = QnxDeviceConfiguration::create(m_setupPage->configurationName(),
Core::Id(Constants::QNX_QNX_OS_TYPE), RemoteLinux::LinuxDeviceConfiguration::Hardware); Core::Id(Constants::QNX_QNX_OS_TYPE), IDevice::Hardware);
devConf->setSshParameters(sshParams); devConf->setSshParameters(sshParams);
devConf->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100"))); devConf->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));

View File

@@ -45,27 +45,58 @@
#include <debugger/debuggerrunner.h> #include <debugger/debuggerrunner.h>
#include <debugger/debuggerstartparameters.h> #include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerprofileinformation.h> #include <debugger/debuggerprofileinformation.h>
#include <debugger/debuggerstartparameters.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h> #include <projectexplorer/toolchain.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>
#include <utils/portlist.h> #include <utils/portlist.h>
using namespace Debugger;
using namespace ProjectExplorer;
using namespace Qnx; using namespace Qnx;
using namespace Qnx::Internal; using namespace Qnx::Internal;
DebuggerStartParameters createStartParameters(const QnxRunConfiguration *runConfig)
{
DebuggerStartParameters params;
Target *target = runConfig->target();
Profile *profile = target->profile();
const IDevice::ConstPtr devConf = DeviceProfileInformation::device(profile);
if (devConf.isNull())
return params;
params.startMode = AttachToRemoteServer;
params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();
params.sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
if (ToolChain *tc = ToolChainProfileInformation::toolChain(profile))
params.toolChainAbi = tc->targetAbi();
params.symbolFileName = runConfig->localExecutableFilePath();
params.remoteExecutable = runConfig->remoteExecutableFilePath();
params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1");
params.displayName = runConfig->displayName();
params.remoteSetupNeeded = true;
params.closeMode = DetachAtClose;
QnxQtVersion *qtVersion =
dynamic_cast<QnxQtVersion *>(QtSupport::QtProfileInformation::qtVersion(profile));
if (qtVersion)
params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
return params;
}
QnxRunControlFactory::QnxRunControlFactory(QObject *parent) QnxRunControlFactory::QnxRunControlFactory(QObject *parent)
: IRunControlFactory(parent) : IRunControlFactory(parent)
{ {
} }
QnxRunControlFactory::~QnxRunControlFactory() bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, RunMode mode) const
{ {
} if (mode != NormalRunMode && mode != DebugRunMode)
bool QnxRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunMode mode) const
{
if (mode != ProjectExplorer::NormalRunMode && mode != ProjectExplorer::DebugRunMode)
return false; return false;
if (!runConfiguration->isEnabled() if (!runConfiguration->isEnabled()
@@ -75,8 +106,8 @@ bool QnxRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfigur
const QnxRunConfiguration * const rc = qobject_cast<QnxRunConfiguration *>(runConfiguration); const QnxRunConfiguration * const rc = qobject_cast<QnxRunConfiguration *>(runConfiguration);
if (mode == ProjectExplorer::DebugRunMode) { if (mode == DebugRunMode) {
const QnxDeviceConfiguration::ConstPtr dev = ProjectExplorer::DeviceProfileInformation::device(runConfiguration->target()->profile()) const QnxDeviceConfiguration::ConstPtr dev = DeviceProfileInformation::device(runConfiguration->target()->profile())
.dynamicCast<const QnxDeviceConfiguration>(); .dynamicCast<const QnxDeviceConfiguration>();
if (dev.isNull()) if (dev.isNull())
return false; return false;
@@ -85,17 +116,17 @@ bool QnxRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfigur
return true; return true;
} }
ProjectExplorer::RunControl *QnxRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfig, ProjectExplorer::RunMode mode) RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, RunMode mode)
{ {
Q_ASSERT(canRun(runConfig, mode)); Q_ASSERT(canRun(runConfig, mode));
QnxRunConfiguration *rc = qobject_cast<QnxRunConfiguration *>(runConfig); QnxRunConfiguration *rc = qobject_cast<QnxRunConfiguration *>(runConfig);
Q_ASSERT(rc); Q_ASSERT(rc);
if (mode == ProjectExplorer::NormalRunMode) if (mode == NormalRunMode)
return new QnxRunControl(rc); return new QnxRunControl(rc);
const Debugger::DebuggerStartParameters params = startParameters(rc); const DebuggerStartParameters params = createStartParameters(rc);
Debugger::DebuggerRunControl * const runControl = Debugger::DebuggerPlugin::createDebugger(params, rc); DebuggerRunControl * const runControl = DebuggerPlugin::createDebugger(params, rc);
if (!runControl) if (!runControl)
return 0; return 0;
@@ -110,42 +141,8 @@ QString QnxRunControlFactory::displayName() const
return tr("Run on remote QNX device"); return tr("Run on remote QNX device");
} }
ProjectExplorer::RunConfigWidget *QnxRunControlFactory::createConfigurationWidget(ProjectExplorer::RunConfiguration *config) RunConfigWidget *QnxRunControlFactory::createConfigurationWidget(RunConfiguration *config)
{ {
Q_UNUSED(config) Q_UNUSED(config)
return 0; return 0;
} }
Debugger::DebuggerStartParameters QnxRunControlFactory::startParameters(
const QnxRunConfiguration *runConfig)
{
Debugger::DebuggerStartParameters params;
ProjectExplorer::Target *target = runConfig->target();
ProjectExplorer::Profile *profile = target->profile();
const QnxDeviceConfiguration::ConstPtr devConf = ProjectExplorer::DeviceProfileInformation::device(runConfig->target()->profile())
.dynamicCast<const QnxDeviceConfiguration>();
if (devConf.isNull())
return params;
params.startMode = Debugger::AttachToRemoteServer;
params.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString();
params.sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(profile).toString();
if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile))
params.toolChainAbi = tc->targetAbi();
params.symbolFileName = runConfig->localExecutableFilePath();
params.remoteExecutable = runConfig->remoteExecutableFilePath();
params.remoteChannel = devConf->sshParameters().host + QLatin1String(":-1");
params.displayName = runConfig->displayName();
params.remoteSetupNeeded = true;
params.closeMode = Debugger::DetachAtClose;
QnxQtVersion *qtVersion =
dynamic_cast<QnxQtVersion *>(QtSupport::QtProfileInformation::qtVersion(profile));
if (qtVersion)
params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
return params;
}

View File

@@ -34,20 +34,17 @@
#ifndef QNX_INTERNAL_QNXRUNCONTROLFACTORY_H #ifndef QNX_INTERNAL_QNXRUNCONTROLFACTORY_H
#define QNX_INTERNAL_QNXRUNCONTROLFACTORY_H #define QNX_INTERNAL_QNXRUNCONTROLFACTORY_H
#include <debugger/debuggerstartparameters.h>
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
namespace Qnx { namespace Qnx {
namespace Internal { namespace Internal {
class QnxRunConfiguration;
class QnxRunControlFactory : public ProjectExplorer::IRunControlFactory class QnxRunControlFactory : public ProjectExplorer::IRunControlFactory
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit QnxRunControlFactory(QObject *parent = 0); explicit QnxRunControlFactory(QObject *parent = 0);
~QnxRunControlFactory();
QString displayName() const; QString displayName() const;
ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration *runConfiguration); ProjectExplorer::RunConfigWidget *createConfigurationWidget(ProjectExplorer::RunConfiguration *runConfiguration);
@@ -56,9 +53,6 @@ public:
ProjectExplorer::RunMode mode) const; ProjectExplorer::RunMode mode) const;
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration, ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
ProjectExplorer::RunMode mode); ProjectExplorer::RunMode mode);
private:
static Debugger::DebuggerStartParameters startParameters( const QnxRunConfiguration *runConfig);
}; };
} // namespace Internal } // namespace Internal

View File

@@ -31,7 +31,6 @@
#include "externaleditors.h" #include "externaleditors.h"
#include "qt4project.h" #include "qt4project.h"
#include "qt4projectmanagerconstants.h" #include "qt4projectmanagerconstants.h"
#include "qt4buildconfiguration.h"
#include <utils/synchronousprocess.h> #include <utils/synchronousprocess.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>

View File

@@ -51,25 +51,25 @@
#include <QFileInfo> #include <QFileInfo>
using ExtensionSystem::PluginManager; using ExtensionSystem::PluginManager;
using namespace ProjectExplorer;
using namespace Qt4ProjectManager; using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal; using namespace Qt4ProjectManager::Internal;
namespace { namespace {
const char * const MAKESTEP_BS_ID("Qt4ProjectManager.MakeStep"); const char MAKESTEP_BS_ID[] = "Qt4ProjectManager.MakeStep";
const char MAKE_ARGUMENTS_KEY[] = "Qt4ProjectManager.MakeStep.MakeArguments";
const char * const MAKE_ARGUMENTS_KEY("Qt4ProjectManager.MakeStep.MakeArguments"); const char MAKE_COMMAND_KEY[] = "Qt4ProjectManager.MakeStep.MakeCommand";
const char * const MAKE_COMMAND_KEY("Qt4ProjectManager.MakeStep.MakeCommand"); const char CLEAN_KEY[] = "Qt4ProjectManager.MakeStep.Clean";
const char * const CLEAN_KEY("Qt4ProjectManager.MakeStep.Clean");
} }
MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl) : MakeStep::MakeStep(BuildStepList *bsl) :
AbstractProcessStep(bsl, Core::Id(MAKESTEP_BS_ID)), AbstractProcessStep(bsl, Core::Id(MAKESTEP_BS_ID)),
m_clean(false) m_clean(false)
{ {
ctor(); ctor();
} }
MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs) : MakeStep::MakeStep(BuildStepList *bsl, MakeStep *bs) :
AbstractProcessStep(bsl, bs), AbstractProcessStep(bsl, bs),
m_clean(bs->m_clean), m_clean(bs->m_clean),
m_userArgs(bs->m_userArgs), m_userArgs(bs->m_userArgs),
@@ -78,7 +78,7 @@ MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl, MakeStep *bs) :
ctor(); ctor();
} }
MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl, const Core::Id id) : MakeStep::MakeStep(BuildStepList *bsl, const Core::Id id) :
AbstractProcessStep(bsl, id), AbstractProcessStep(bsl, id),
m_clean(false) m_clean(false)
{ {
@@ -121,7 +121,7 @@ QString MakeStep::makeCommand() const
QVariantMap MakeStep::toMap() const QVariantMap MakeStep::toMap() const
{ {
QVariantMap map(ProjectExplorer::AbstractProcessStep::toMap()); QVariantMap map(AbstractProcessStep::toMap());
map.insert(QLatin1String(MAKE_ARGUMENTS_KEY), m_userArgs); map.insert(QLatin1String(MAKE_ARGUMENTS_KEY), m_userArgs);
map.insert(QLatin1String(MAKE_COMMAND_KEY), m_makeCmd); map.insert(QLatin1String(MAKE_COMMAND_KEY), m_makeCmd);
map.insert(QLatin1String(CLEAN_KEY), m_clean); map.insert(QLatin1String(CLEAN_KEY), m_clean);
@@ -134,7 +134,7 @@ bool MakeStep::fromMap(const QVariantMap &map)
m_userArgs = map.value(QLatin1String(MAKE_ARGUMENTS_KEY)).toString(); m_userArgs = map.value(QLatin1String(MAKE_ARGUMENTS_KEY)).toString();
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool(); m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
return ProjectExplorer::AbstractProcessStep::fromMap(map); return AbstractProcessStep::fromMap(map);
} }
bool MakeStep::init() bool MakeStep::init()
@@ -145,23 +145,21 @@ bool MakeStep::init()
m_tasks.clear(); m_tasks.clear();
if (!bc) { if (!bc) {
m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, m_tasks.append(Task(Task::Error, tr("Qt Creator needs a build configuration set up to build. Configure a tool chain in Project mode."),
tr("Qt Creator needs a build configuration set up to build. Configure a tool chain in Project mode."),
Utils::FileName(), -1, Utils::FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return false; return false;
} }
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile()); ToolChain *tc = ToolChainProfileInformation::toolChain(target()->profile());
if (!tc) { if (!tc) {
m_tasks.append(ProjectExplorer::Task(ProjectExplorer::Task::Error, m_tasks.append(Task(Task::Error, tr("Qt Creator needs a tool chain set up to build. Configure a tool chain the target options."),
tr("Qt Creator needs a tool chain set up to build. Configure a tool chain the profile options."),
Utils::FileName(), -1, Utils::FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
return false; return false;
} }
ProjectExplorer::ProcessParameters *pp = processParameters(); ProcessParameters *pp = processParameters();
pp->setMacroExpander(bc->macroExpander()); pp->setMacroExpander(bc->macroExpander());
QString workingDirectory; QString workingDirectory;
@@ -246,10 +244,10 @@ bool MakeStep::init()
// but for now this is the least invasive change // but for now this is the least invasive change
// We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose // We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
if (tc && m_makeCmd.isEmpty()) { if (tc && m_makeCmd.isEmpty()) {
if (tc->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat ) if (tc->targetAbi().binaryFormat() != Abi::PEFormat )
Utils::QtcProcess::addArg(&args, QLatin1String("-w")); Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
if (tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS if (tc->targetAbi().os() == Abi::WindowsOS
&& tc->targetAbi().osFlavor() != ProjectExplorer::Abi::WindowsMSysFlavor) { && tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS"); const QString makeFlags = QLatin1String("MAKEFLAGS");
env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags)); env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags));
} }
@@ -258,7 +256,7 @@ bool MakeStep::init()
pp->setEnvironment(env); pp->setEnvironment(env);
pp->setArguments(args); pp->setArguments(args);
ProjectExplorer::IOutputParser *parser = 0; IOutputParser *parser = 0;
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile()); QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
if (version) if (version)
parser = version->createOutputParser(); parser = version->createOutputParser();
@@ -294,9 +292,9 @@ void MakeStep::run(QFutureInterface<bool> & fi)
// Warn on common error conditions: // Warn on common error conditions:
bool canContinue = true; bool canContinue = true;
foreach (const ProjectExplorer::Task &t, m_tasks) { foreach (const Task &t, m_tasks) {
addTask(t); addTask(t);
if (t.type == ProjectExplorer::Task::Error) if (t.type == Task::Error)
canContinue = false; canContinue = false;
} }
if (!canContinue) { if (!canContinue) {
@@ -322,7 +320,7 @@ bool MakeStep::immutable() const
return false; return false;
} }
ProjectExplorer::BuildStepConfigWidget *MakeStep::createConfigWidget() BuildStepConfigWidget *MakeStep::createConfigWidget()
{ {
return new MakeStepConfigWidget(this); return new MakeStepConfigWidget(this);
} }
@@ -361,13 +359,13 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
connect(makeStep, SIGNAL(userArgumentsChanged()), connect(makeStep, SIGNAL(userArgumentsChanged()),
this, SLOT(userArgumentsChanged())); this, SLOT(userArgumentsChanged()));
ProjectExplorer::BuildConfiguration *bc = makeStep->buildConfiguration(); BuildConfiguration *bc = makeStep->buildConfiguration();
if (!bc) { if (!bc) {
// That means the step is in the deploylist, so we listen to the active build config // That means the step is in the deploylist, so we listen to the active build config
// changed signal and react to the buildDirectoryChanged() signal of the buildconfiguration // changed signal and react to the buildDirectoryChanged() signal of the buildconfiguration
bc = makeStep->target()->activeBuildConfiguration(); bc = makeStep->target()->activeBuildConfiguration();
m_bc = bc; m_bc = bc;
connect (makeStep->target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), connect (makeStep->target(), SIGNAL(activeBuildConfigurationChanged(BuildConfiguration*)),
this, SLOT(activeBuildConfigurationChanged())); this, SLOT(activeBuildConfigurationChanged()));
} }
@@ -376,7 +374,7 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
this, SLOT(updateDetails())); this, SLOT(updateDetails()));
} }
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()), connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateDetails())); this, SLOT(updateDetails()));
connect(m_makeStep->target(), SIGNAL(profileChanged()), this, SLOT(updateDetails())); connect(m_makeStep->target(), SIGNAL(profileChanged()), this, SLOT(updateDetails()));
} }
@@ -412,15 +410,15 @@ MakeStepConfigWidget::~MakeStepConfigWidget()
void MakeStepConfigWidget::updateDetails() void MakeStepConfigWidget::updateDetails()
{ {
ProjectExplorer::ToolChain *tc ToolChain *tc
= ProjectExplorer::ToolChainProfileInformation::toolChain(m_makeStep->target()->profile()); = ToolChainProfileInformation::toolChain(m_makeStep->target()->profile());
if (tc) if (tc)
m_ui->makeLabel->setText(tr("Override %1:").arg(tc->makeCommand())); m_ui->makeLabel->setText(tr("Override %1:").arg(tc->makeCommand()));
else else
m_ui->makeLabel->setText(tr("Make:")); m_ui->makeLabel->setText(tr("Make:"));
if (!tc) { if (!tc) {
setSummaryText(tr("<b>Make:</b> No tool chain set in profile.")); setSummaryText(tr("<b>Make:</b> No tool chain set in target."));
return; return;
} }
Qt4BuildConfiguration *bc = m_makeStep->qt4BuildConfiguration(); Qt4BuildConfiguration *bc = m_makeStep->qt4BuildConfiguration();
@@ -431,7 +429,7 @@ void MakeStepConfigWidget::updateDetails()
return; return;
} }
ProjectExplorer::ProcessParameters param; ProcessParameters param;
param.setMacroExpander(bc->macroExpander()); param.setMacroExpander(bc->macroExpander());
param.setWorkingDirectory(bc->buildDirectory()); param.setWorkingDirectory(bc->buildDirectory());
QString makeCmd = tc->makeCommand(); QString makeCmd = tc->makeCommand();
@@ -456,10 +454,10 @@ void MakeStepConfigWidget::updateDetails()
// but for now this is the least invasive change // but for now this is the least invasive change
// We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose // We also prepend "L" to the MAKEFLAGS, so that nmake / jom are less verbose
if (tc && m_makeStep->makeCommand().isEmpty()) { if (tc && m_makeStep->makeCommand().isEmpty()) {
if (tc->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat ) if (tc->targetAbi().binaryFormat() != Abi::PEFormat )
Utils::QtcProcess::addArg(&args, QLatin1String("-w")); Utils::QtcProcess::addArg(&args, QLatin1String("-w"));
if (tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS if (tc->targetAbi().os() == Abi::WindowsOS
&& tc->targetAbi().osFlavor() != ProjectExplorer::Abi::WindowsMSysFlavor) { && tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS"); const QString makeFlags = QLatin1String("MAKEFLAGS");
env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags)); env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags));
} }
@@ -510,7 +508,7 @@ void MakeStepConfigWidget::makeArgumentsLineEdited()
/// ///
MakeStepFactory::MakeStepFactory(QObject *parent) : MakeStepFactory::MakeStepFactory(QObject *parent) :
ProjectExplorer::IBuildStepFactory(parent) IBuildStepFactory(parent)
{ {
} }
@@ -518,14 +516,14 @@ MakeStepFactory::~MakeStepFactory()
{ {
} }
bool MakeStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const bool MakeStepFactory::canCreate(BuildStepList *parent, const Core::Id id) const
{ {
if (parent->target()->project()->id() != Core::Id(Constants::QT4PROJECT_ID)) if (parent->target()->project()->id() != Core::Id(Constants::QT4PROJECT_ID))
return false; return false;
return (id == Core::Id(MAKESTEP_BS_ID)); return (id == Core::Id(MAKESTEP_BS_ID));
} }
ProjectExplorer::BuildStep *MakeStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id) BuildStep *MakeStepFactory::create(BuildStepList *parent, const Core::Id id)
{ {
if (!canCreate(parent, id)) if (!canCreate(parent, id))
return 0; return 0;
@@ -537,24 +535,24 @@ ProjectExplorer::BuildStep *MakeStepFactory::create(ProjectExplorer::BuildStepLi
return step; return step;
} }
bool MakeStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) const bool MakeStepFactory::canClone(BuildStepList *parent, BuildStep *source) const
{ {
return canCreate(parent, source->id()); return canCreate(parent, source->id());
} }
ProjectExplorer::BuildStep *MakeStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *source) BuildStep *MakeStepFactory::clone(BuildStepList *parent, BuildStep *source)
{ {
if (!canClone(parent, source)) if (!canClone(parent, source))
return 0; return 0;
return new MakeStep(parent, static_cast<MakeStep *>(source)); return new MakeStep(parent, static_cast<MakeStep *>(source));
} }
bool MakeStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const bool MakeStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
{ {
return canCreate(parent, ProjectExplorer::idFromMap(map)); return canCreate(parent, idFromMap(map));
} }
ProjectExplorer::BuildStep *MakeStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) BuildStep *MakeStepFactory::restore(BuildStepList *parent, const QVariantMap &map)
{ {
if (!canRestore(parent, map)) if (!canRestore(parent, map))
return 0; return 0;
@@ -565,7 +563,7 @@ ProjectExplorer::BuildStep *MakeStepFactory::restore(ProjectExplorer::BuildStepL
return 0; return 0;
} }
QList<Core::Id> MakeStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const QList<Core::Id> MakeStepFactory::availableCreationIds(BuildStepList *parent) const
{ {
if (parent->target()->project()->id() == Core::Id(Constants::QT4PROJECT_ID)) if (parent->target()->project()->id() == Core::Id(Constants::QT4PROJECT_ID))
return QList<Core::Id>() << Core::Id(MAKESTEP_BS_ID); return QList<Core::Id>() << Core::Id(MAKESTEP_BS_ID);

View File

@@ -39,9 +39,7 @@
namespace ProjectExplorer { namespace ProjectExplorer {
class BuildStep; class BuildStep;
class GnuMakeParser;
class IBuildStepFactory; class IBuildStepFactory;
class Project;
} }
namespace Qt4ProjectManager { namespace Qt4ProjectManager {

View File

@@ -51,6 +51,7 @@ namespace Qt4ProjectManager {
SymbianIDevice::SymbianIDevice() : SymbianIDevice::SymbianIDevice() :
ProjectExplorer::IDevice(Internal::SymbianIDeviceFactory::deviceType(), ProjectExplorer::IDevice(Internal::SymbianIDeviceFactory::deviceType(),
ProjectExplorer::IDevice::AutoDetected, ProjectExplorer::IDevice::AutoDetected,
ProjectExplorer::IDevice::Hardware,
Core::Id("Symbian Device")), Core::Id("Symbian Device")),
m_port(QLatin1String(DEFAULT_CODA_TCP_PORT)), m_port(QLatin1String(DEFAULT_CODA_TCP_PORT)),
m_communicationChannel(CommunicationCodaSerialConnection) m_communicationChannel(CommunicationCodaSerialConnection)

View File

@@ -151,7 +151,7 @@ void Qt4BuildConfiguration::profileChanged()
void Qt4BuildConfiguration::emitBuildDirectoryChanged() void Qt4BuildConfiguration::emitBuildDirectoryChanged()
{ {
// We also emit buildDirectoryChanged if the the qt version's supportShadowBuild changed // We also emit buildDirectoryChanged if the the Qt version's supportShadowBuild changed
if (buildDirectory() != m_lastEmmitedBuildDirectory if (buildDirectory() != m_lastEmmitedBuildDirectory
|| supportsShadowBuilds() != m_qtVersionSupportsShadowBuilds) { || supportsShadowBuilds() != m_qtVersionSupportsShadowBuilds) {
m_lastEmmitedBuildDirectory = buildDirectory(); m_lastEmmitedBuildDirectory = buildDirectory();
@@ -442,7 +442,7 @@ Qt4BuildConfiguration::MakefileState Qt4BuildConfiguration::compareToImportFrom(
} }
} else { } else {
if (debug) if (debug)
qDebug()<<"diffrent qt versions, buildconfiguration:"<<version->qmakeCommand().toString()<<" Makefile:"<<qmakePath.toString(); qDebug() << "different Qt versions, buildconfiguration:" << version->qmakeCommand().toString() << " Makefile:"<< qmakePath.toString();
return MakefileForWrongProject; return MakefileForWrongProject;
} }
} }

View File

@@ -123,14 +123,14 @@ public:
QString additionalArguments, QString additionalArguments,
QString directory, QString directory,
bool importing); bool importing);
/// returns whether the qt version in the profile supports shadow building (also true for no qt version) /// returns whether the Qt version in the profile supports shadow building (also true for no Qt version)
bool supportsShadowBuilds(); bool supportsShadowBuilds();
public slots: public slots:
void emitEvaluateBuildSystem(); void emitEvaluateBuildSystem();
signals: signals:
/// emitted for setQMakeBuildConfig, not emitted for qt version changes, even /// emitted for setQMakeBuildConfig, not emitted for Qt version changes, even
/// if those change the qmakebuildconfig /// if those change the qmakebuildconfig
void qmakeBuildConfigurationChanged(); void qmakeBuildConfigurationChanged();
/// emitted when smart installer property of S60 create package step changes /// emitted when smart installer property of S60 create package step changes

View File

@@ -111,7 +111,7 @@ Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
void Qt4ProjectConfigWidget::updateDetails() void Qt4ProjectConfigWidget::updateDetails()
{ {
m_detailsContainer->setSummaryText( m_detailsContainer->setSummaryText(
tr("building in <b>%3</b>") tr("building in <b>%1</b>")
.arg(QDir::toNativeSeparators(m_buildConfiguration->buildDirectory()))); .arg(QDir::toNativeSeparators(m_buildConfiguration->buildDirectory())));
} }
@@ -245,7 +245,7 @@ void Qt4ProjectConfigWidget::updateProblemLabel()
QString shadowBuildWarning; QString shadowBuildWarning;
if (!version->supportsShadowBuilds() && m_buildConfiguration->shadowBuild()) { if (!version->supportsShadowBuilds() && m_buildConfiguration->shadowBuild()) {
shadowBuildWarning =tr("The qt version %1 does not support shadow builds, building might fail.") shadowBuildWarning =tr("The Qt version %1 does not support shadow builds, building might fail.")
.arg(version->displayName()) .arg(version->displayName())
+ QLatin1String("<br>"); + QLatin1String("<br>");
} }

View File

@@ -245,7 +245,7 @@ private:
QString findQtBinary(Binaries binary) const; QString findQtBinary(Binaries binary) const;
void updateMkspec() const; void updateMkspec() const;
void setId(int id); // used by the qtversionmanager for legacy restore void setId(int id); // used by the qtversionmanager for legacy restore
// and by the qtoptionspage to replace qt versions // and by the qtoptionspage to replace Qt versions
QString m_displayName; QString m_displayName;
int m_id; int m_id;
bool m_isAutodetected; bool m_isAutodetected;

View File

@@ -326,7 +326,7 @@ QStringList ExamplesListModel::exampleSources(QString *examplesFallback, QString
return sources; return sources;
// try to find a suitable Qt version // try to find a suitable Qt version
m_updateOnQtVersionsChanged = true; // this must be updated when the qt versions change m_updateOnQtVersionsChanged = true; // this must be updated when the Qt versions change
// fallbacks are passed back if no example manifest is found // fallbacks are passed back if no example manifest is found
// and we fallback to Qt Creator's shipped manifest (e.g. only old Qt Versions found) // and we fallback to Qt Creator's shipped manifest (e.g. only old Qt Versions found)
QString potentialExamplesFallback; QString potentialExamplesFallback;

View File

@@ -700,7 +700,7 @@ void QtOptionsPageWidget::editPath()
if (current->type() != version->type()) { if (current->type() != version->type()) {
// not the same type, error out // not the same type, error out
QMessageBox::critical(this, tr("Qt versions incompatible"), QMessageBox::critical(this, tr("Qt versions incompatible"),
tr("The qt version selected must be for the same target."), tr("The Qt version selected must be for the same target."),
QMessageBox::Ok); QMessageBox::Ok);
delete version; delete version;
return; return;
@@ -911,7 +911,7 @@ void QtOptionsPageWidget::updateDebuggingHelperUi()
} }
} }
// To be called if a qt version was removed or added // To be called if a Qt version was removed or added
void QtOptionsPageWidget::updateCleanUpButton() void QtOptionsPageWidget::updateCleanUpButton()
{ {
bool hasInvalidVersion = false; bool hasInvalidVersion = false;
@@ -1057,7 +1057,7 @@ void QtOptionsPageWidget::apply()
this, SLOT(updateQtVersions(QList<int>,QList<int>,QList<int>))); this, SLOT(updateQtVersions(QList<int>,QList<int>,QList<int>)));
} }
/* Checks that the qt version name is unique /* Checks that the Qt version name is unique
* and otherwise changes the name * and otherwise changes the name
* *
*/ */
@@ -1115,7 +1115,7 @@ QString QtOptionsPageWidget::searchKeywords() const
// Symbian specific, could be factored out to the factory // Symbian specific, could be factored out to the factory
// checking m_configurationWidget is not enough, we want them to be a keyword // checking m_configurationWidget is not enough, we want them to be a keyword
// regardless of which qt versions configuration widget is currently active // regardless of which Qt versions configuration widget is currently active
ts << sep << tr("S60 SDK:") ts << sep << tr("S60 SDK:")
<< sep << tr("SBS v2 directory:"); << sep << tr("SBS v2 directory:");

View File

@@ -141,7 +141,7 @@ void QtVersionManager::extensionsInitialized()
if (!success) { if (!success) {
// We did neither restore our settings or upgraded // We did neither restore our settings or upgraded
// in that case figure out if there's a qt in path // in that case figure out if there's a qt in path
// and add it to the qt versions // and add it to the Qt versions
findSystemQt(); findSystemQt();
} }
@@ -288,7 +288,7 @@ void QtVersionManager::updateFromInstaller()
qDebug("Warning: Unable to find factory for type '%s'", qPrintable(type)); qDebug("Warning: Unable to find factory for type '%s'", qPrintable(type));
continue; continue;
} }
// First try to find a existing qt version to update // First try to find a existing Qt version to update
bool restored = false; bool restored = false;
foreach (BaseQtVersion *v, m_versions) { foreach (BaseQtVersion *v, m_versions) {
if (v->autodetectionSource() == autoDetectionSource) { if (v->autodetectionSource() == autoDetectionSource) {

View File

@@ -32,8 +32,8 @@
#include "deployablefile.h" #include "deployablefile.h"
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
@@ -44,7 +44,7 @@
#include <QPointer> #include <QPointer>
#include <QString> #include <QString>
using namespace Qt4ProjectManager; using namespace ProjectExplorer;
using namespace QSsh; using namespace QSsh;
namespace RemoteLinux { namespace RemoteLinux {
@@ -84,10 +84,11 @@ class AbstractRemoteLinuxDeployServicePrivate
{ {
public: public:
AbstractRemoteLinuxDeployServicePrivate() AbstractRemoteLinuxDeployServicePrivate()
: connection(0), state(Inactive), stopRequested(false) {} : profile(0), connection(0), state(Inactive), stopRequested(false) {}
LinuxDeviceConfiguration::ConstPtr deviceConfiguration; IDevice::ConstPtr deviceConfiguration;
QPointer<Qt4BuildConfiguration> buildConfiguration; QPointer<BuildConfiguration> buildConfiguration;
Profile *profile;
SshConnection *connection; SshConnection *connection;
State state; State state;
bool stopRequested; bool stopRequested;
@@ -108,12 +109,17 @@ AbstractRemoteLinuxDeployService::~AbstractRemoteLinuxDeployService()
delete d; delete d;
} }
const Qt4BuildConfiguration *AbstractRemoteLinuxDeployService::qt4BuildConfiguration() const const BuildConfiguration *AbstractRemoteLinuxDeployService::buildConfiguration() const
{ {
return d->buildConfiguration; return d->buildConfiguration;
} }
LinuxDeviceConfiguration::ConstPtr AbstractRemoteLinuxDeployService::deviceConfiguration() const const Profile *AbstractRemoteLinuxDeployService::profile() const
{
return d->profile;
}
IDevice::ConstPtr AbstractRemoteLinuxDeployService::deviceConfiguration() const
{ {
return d->deviceConfiguration; return d->deviceConfiguration;
} }
@@ -128,10 +134,10 @@ void AbstractRemoteLinuxDeployService::saveDeploymentTimeStamp(const DeployableF
if (!d->buildConfiguration) if (!d->buildConfiguration)
return; return;
const QtSupport::BaseQtVersion *const qtVersion const QtSupport::BaseQtVersion *const qtVersion
= QtSupport::QtProfileInformation::qtVersion(d->buildConfiguration->target()->profile()); = QtSupport::QtProfileInformation::qtVersion(d->profile);
QString systemRoot; QString systemRoot;
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->buildConfiguration->target()->profile())) if (SysRootProfileInformation::hasSysRoot(d->profile))
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->buildConfiguration->target()->profile()).toString(); systemRoot = SysRootProfileInformation::sysRoot(d->profile).toString();
if (!qtVersion || !qtVersion->isValid()) if (!qtVersion || !qtVersion->isValid())
return; return;
d->lastDeployed.insert(DeployParameters(deployableFile, d->lastDeployed.insert(DeployParameters(deployableFile,
@@ -145,26 +151,26 @@ bool AbstractRemoteLinuxDeployService::hasChangedSinceLastDeployment(const Deplo
if (!d->buildConfiguration) if (!d->buildConfiguration)
return true; return true;
const QtSupport::BaseQtVersion *const qtVersion const QtSupport::BaseQtVersion *const qtVersion
= QtSupport::QtProfileInformation::qtVersion(d->buildConfiguration->target()->profile()); = QtSupport::QtProfileInformation::qtVersion(d->profile);
if (!qtVersion || !qtVersion->isValid()) if (!qtVersion || !qtVersion->isValid())
return true; return true;
QString systemRoot; QString systemRoot;
if (ProjectExplorer::SysRootProfileInformation::hasSysRoot(d->buildConfiguration->target()->profile())) if (SysRootProfileInformation::hasSysRoot(d->profile))
systemRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(d->buildConfiguration->target()->profile()).toString(); systemRoot = SysRootProfileInformation::sysRoot(d->profile).toString();
const QDateTime &lastDeployed = d->lastDeployed.value(DeployParameters(deployableFile, const QDateTime &lastDeployed = d->lastDeployed.value(DeployParameters(deployableFile,
deviceConfiguration()->sshParameters().host, systemRoot)); deviceConfiguration()->sshParameters().host, systemRoot));
return !lastDeployed.isValid() return !lastDeployed.isValid()
|| QFileInfo(deployableFile.localFilePath).lastModified() > lastDeployed; || QFileInfo(deployableFile.localFilePath).lastModified() > lastDeployed;
} }
void AbstractRemoteLinuxDeployService::setDeviceConfiguration(const LinuxDeviceConfiguration::ConstPtr &deviceConfiguration) void AbstractRemoteLinuxDeployService::setBuildConfiguration(BuildConfiguration *bc)
{
d->deviceConfiguration = deviceConfiguration;
}
void AbstractRemoteLinuxDeployService::setBuildConfiguration(Qt4BuildConfiguration *bc)
{ {
d->buildConfiguration = bc; d->buildConfiguration = bc;
if (bc && bc->target())
d->profile = bc->target()->profile();
else
d->profile = 0;
d->deviceConfiguration = DeviceProfileInformation::device(d->profile);
} }
void AbstractRemoteLinuxDeployService::start() void AbstractRemoteLinuxDeployService::start()
@@ -272,7 +278,7 @@ void AbstractRemoteLinuxDeployService::handleDeviceSetupDone(bool success)
} }
d->state = Connecting; d->state = Connecting;
d->connection = SshConnectionManager::instance().acquireConnection(d->deviceConfiguration->sshParameters()); d->connection = SshConnectionManager::instance().acquireConnection(deviceConfiguration()->sshParameters());
connect(d->connection, SIGNAL(error(QSsh::SshError)), connect(d->connection, SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionFailure())); SLOT(handleConnectionFailure()));
if (d->connection->state() == SshConnection::Connected) { if (d->connection->state() == SshConnection::Connected) {
@@ -314,7 +320,7 @@ void AbstractRemoteLinuxDeployService::handleConnectionFailure()
break; break;
case Connecting: { case Connecting: {
QString errorMsg = tr("Could not connect to host: %1").arg(d->connection->errorString()); QString errorMsg = tr("Could not connect to host: %1").arg(d->connection->errorString());
if (deviceConfiguration()->machineType() == LinuxDeviceConfiguration::Emulator) if (deviceConfiguration()->machineType() == IDevice::Emulator)
errorMsg += tr("\nDid the emulator fail to start?"); errorMsg += tr("\nDid the emulator fail to start?");
else else
errorMsg += tr("\nIs the device connected and set up for network access?"); errorMsg += tr("\nIs the device connected and set up for network access?");

View File

@@ -32,21 +32,22 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <QObject> #include <QObject>
#include <QSharedPointer> #include <QSharedPointer>
#include <QVariantMap> #include <QVariantMap>
QT_FORWARD_DECLARE_CLASS(QString)
namespace QSsh { class SshConnection; } namespace QSsh { class SshConnection; }
namespace Qt4ProjectManager { namespace ProjectExplorer {
class Qt4BuildConfiguration; class BuildConfiguration;
class Profile;
} }
namespace RemoteLinux { namespace RemoteLinux {
class DeployableFile; class DeployableFile;
class DeploymentInfo; class DeploymentInfo;
class LinuxDeviceConfiguration;
namespace Internal { namespace Internal {
class AbstractRemoteLinuxDeployServicePrivate; class AbstractRemoteLinuxDeployServicePrivate;
@@ -60,8 +61,7 @@ public:
explicit AbstractRemoteLinuxDeployService(QObject *parent = 0); explicit AbstractRemoteLinuxDeployService(QObject *parent = 0);
~AbstractRemoteLinuxDeployService(); ~AbstractRemoteLinuxDeployService();
void setDeviceConfiguration(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfiguration); void setBuildConfiguration(ProjectExplorer::BuildConfiguration *bc);
void setBuildConfiguration(Qt4ProjectManager::Qt4BuildConfiguration *bc);
void start(); void start();
void stop(); void stop();
@@ -78,8 +78,9 @@ signals:
void stdErrData(const QString &data); void stdErrData(const QString &data);
protected: protected:
const Qt4ProjectManager::Qt4BuildConfiguration *qt4BuildConfiguration() const; const ProjectExplorer::BuildConfiguration *buildConfiguration() const;
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const; const ProjectExplorer::Profile *profile() const;
ProjectExplorer::IDevice::ConstPtr deviceConfiguration() const;
QSsh::SshConnection *connection() const; QSsh::SshConnection *connection() const;
void saveDeploymentTimeStamp(const DeployableFile &deployableFile); void saveDeploymentTimeStamp(const DeployableFile &deployableFile);

View File

@@ -27,17 +27,16 @@
** **
** **
**************************************************************************/ **************************************************************************/
#include "abstractremotelinuxdeploystep.h" #include "abstractremotelinuxdeploystep.h"
#include "abstractremotelinuxdeployservice.h" #include "abstractremotelinuxdeployservice.h"
#include "linuxdeviceconfiguration.h"
#include "remotelinuxdeployconfiguration.h" #include "remotelinuxdeployconfiguration.h"
#include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/profileinformation.h> #include <projectexplorer/profileinformation.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
using namespace ProjectExplorer; using namespace ProjectExplorer;
@@ -85,9 +84,7 @@ QVariantMap AbstractRemoteLinuxDeployStep::toMap() const
bool AbstractRemoteLinuxDeployStep::init() bool AbstractRemoteLinuxDeployStep::init()
{ {
QString error; QString error;
deployService()->setDeviceConfiguration(ProjectExplorer::DeviceProfileInformation::device(target()->profile()) deployService()->setBuildConfiguration(target()->activeBuildConfiguration());
.dynamicCast<const LinuxDeviceConfiguration>());
deployService()->setBuildConfiguration(qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(target()->activeBuildConfiguration()));
const bool canDeploy = initInternal(&error); const bool canDeploy = initInternal(&error);
if (!canDeploy) if (!canDeploy)
emit addOutput(tr("Cannot deploy: %1").arg(error), ErrorMessageOutput); emit addOutput(tr("Cannot deploy: %1").arg(error), ErrorMessageOutput);
@@ -138,7 +135,7 @@ void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message)
{ {
emit addOutput(message, ErrorMessageOutput); emit addOutput(message, ErrorMessageOutput);
emit addTask(Task(Task::Error, message, Utils::FileName(), -1, emit addTask(Task(Task::Error, message, Utils::FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
d->hasError = true; d->hasError = true;
} }
@@ -146,7 +143,7 @@ void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message)
{ {
emit addOutput(message, ErrorMessageOutput); emit addOutput(message, ErrorMessageOutput);
emit addTask(Task(Task::Warning, message, Utils::FileName(), -1, emit addTask(Task(Task::Warning, message, Utils::FileName(), -1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM))); Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
} }
void AbstractRemoteLinuxDeployStep::handleFinished() void AbstractRemoteLinuxDeployStep::handleFinished()

View File

@@ -35,7 +35,6 @@
#include <projectexplorer/buildstep.h> #include <projectexplorer/buildstep.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4project.h>
#include <qtsupport/qtprofileinformation.h> #include <qtsupport/qtprofileinformation.h>

View File

@@ -71,8 +71,8 @@ bool GenericLinuxDeviceConfigurationFactory::canRestore(const QVariantMap &map)
IDevice::Ptr GenericLinuxDeviceConfigurationFactory::restore(const QVariantMap &map) const IDevice::Ptr GenericLinuxDeviceConfigurationFactory::restore(const QVariantMap &map) const
{ {
QTC_ASSERT(canRestore(map), return LinuxDeviceConfiguration::Ptr()); QTC_ASSERT(canRestore(map), return IDevice::Ptr());
const LinuxDeviceConfiguration::Ptr device = LinuxDeviceConfiguration::create(); const IDevice::Ptr device = LinuxDeviceConfiguration::create();
device->fromMap(map); device->fromMap(map);
return device; return device;
} }

View File

@@ -36,14 +36,14 @@
#include <QTextStream> #include <QTextStream>
using namespace ProjectExplorer;
using namespace RemoteLinux; using namespace RemoteLinux;
using namespace QSsh; using namespace QSsh;
using namespace Utils; using namespace Utils;
GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget( GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget(
const LinuxDeviceConfiguration::Ptr &deviceConfig, const IDevice::Ptr &deviceConfig, QWidget *parent) :
QWidget *parent) : IDeviceWidget(deviceConfig, parent),
ProjectExplorer::IDeviceWidget(deviceConfig, parent),
m_ui(new Ui::GenericLinuxDeviceConfigurationWidget) m_ui(new Ui::GenericLinuxDeviceConfigurationWidget)
{ {
m_ui->setupUi(this); m_ui->setupUi(this);
@@ -72,12 +72,12 @@ GenericLinuxDeviceConfigurationWidget::~GenericLinuxDeviceConfigurationWidget()
void GenericLinuxDeviceConfigurationWidget::authenticationTypeChanged() void GenericLinuxDeviceConfigurationWidget::authenticationTypeChanged()
{ {
SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); SshConnectionParameters sshParams = device()->sshParameters();
const bool usePassword = m_ui->passwordButton->isChecked(); const bool usePassword = m_ui->passwordButton->isChecked();
sshParams.authenticationType = usePassword sshParams.authenticationType = usePassword
? SshConnectionParameters::AuthenticationByPassword ? SshConnectionParameters::AuthenticationByPassword
: SshConnectionParameters::AuthenticationByKey; : SshConnectionParameters::AuthenticationByKey;
deviceConfiguration()->setSshParameters(sshParams); device()->setSshParameters(sshParams);
m_ui->pwdLineEdit->setEnabled(usePassword); m_ui->pwdLineEdit->setEnabled(usePassword);
m_ui->passwordLabel->setEnabled(usePassword); m_ui->passwordLabel->setEnabled(usePassword);
m_ui->keyFileLineEdit->setEnabled(!usePassword); m_ui->keyFileLineEdit->setEnabled(!usePassword);
@@ -86,49 +86,49 @@ void GenericLinuxDeviceConfigurationWidget::authenticationTypeChanged()
void GenericLinuxDeviceConfigurationWidget::hostNameEditingFinished() void GenericLinuxDeviceConfigurationWidget::hostNameEditingFinished()
{ {
SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); SshConnectionParameters sshParams = device()->sshParameters();
sshParams.host = m_ui->hostLineEdit->text().trimmed(); sshParams.host = m_ui->hostLineEdit->text().trimmed();
deviceConfiguration()->setSshParameters(sshParams); device()->setSshParameters(sshParams);
} }
void GenericLinuxDeviceConfigurationWidget::sshPortEditingFinished() void GenericLinuxDeviceConfigurationWidget::sshPortEditingFinished()
{ {
SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); SshConnectionParameters sshParams = device()->sshParameters();
sshParams.port = m_ui->sshPortSpinBox->value(); sshParams.port = m_ui->sshPortSpinBox->value();
deviceConfiguration()->setSshParameters(sshParams); device()->setSshParameters(sshParams);
} }
void GenericLinuxDeviceConfigurationWidget::timeoutEditingFinished() void GenericLinuxDeviceConfigurationWidget::timeoutEditingFinished()
{ {
SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); SshConnectionParameters sshParams = device()->sshParameters();
sshParams.timeout = m_ui->timeoutSpinBox->value(); sshParams.timeout = m_ui->timeoutSpinBox->value();
deviceConfiguration()->setSshParameters(sshParams); device()->setSshParameters(sshParams);
} }
void GenericLinuxDeviceConfigurationWidget::userNameEditingFinished() void GenericLinuxDeviceConfigurationWidget::userNameEditingFinished()
{ {
SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); SshConnectionParameters sshParams = device()->sshParameters();
sshParams.userName = m_ui->userLineEdit->text(); sshParams.userName = m_ui->userLineEdit->text();
deviceConfiguration()->setSshParameters(sshParams); device()->setSshParameters(sshParams);
} }
void GenericLinuxDeviceConfigurationWidget::passwordEditingFinished() void GenericLinuxDeviceConfigurationWidget::passwordEditingFinished()
{ {
SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); SshConnectionParameters sshParams = device()->sshParameters();
sshParams.password = m_ui->pwdLineEdit->text(); sshParams.password = m_ui->pwdLineEdit->text();
deviceConfiguration()->setSshParameters(sshParams); device()->setSshParameters(sshParams);
} }
void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished() void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished()
{ {
SshConnectionParameters sshParams = deviceConfiguration()->sshParameters(); SshConnectionParameters sshParams = device()->sshParameters();
sshParams.privateKeyFile = m_ui->keyFileLineEdit->path(); sshParams.privateKeyFile = m_ui->keyFileLineEdit->path();
deviceConfiguration()->setSshParameters(sshParams); device()->setSshParameters(sshParams);
} }
void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged() void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged()
{ {
deviceConfiguration()->setFreePorts(PortList::fromString(m_ui->portsLineEdit->text())); device()->setFreePorts(PortList::fromString(m_ui->portsLineEdit->text()));
updatePortsWarningLabel(); updatePortsWarningLabel();
} }
@@ -153,12 +153,12 @@ void GenericLinuxDeviceConfigurationWidget::createNewKey()
void GenericLinuxDeviceConfigurationWidget::updatePortsWarningLabel() void GenericLinuxDeviceConfigurationWidget::updatePortsWarningLabel()
{ {
m_ui->portsWarningLabel->setVisible(!deviceConfiguration()->freePorts().hasMore()); m_ui->portsWarningLabel->setVisible(!device()->freePorts().hasMore());
} }
void GenericLinuxDeviceConfigurationWidget::initGui() void GenericLinuxDeviceConfigurationWidget::initGui()
{ {
if (deviceConfiguration()->machineType() == LinuxDeviceConfiguration::Hardware) if (device()->machineType() == IDevice::Hardware)
m_ui->machineTypeValueLabel->setText(tr("Physical Device")); m_ui->machineTypeValueLabel->setText(tr("Physical Device"));
else else
m_ui->machineTypeValueLabel->setText(tr("Emulator")); m_ui->machineTypeValueLabel->setText(tr("Emulator"));
@@ -171,19 +171,19 @@ void GenericLinuxDeviceConfigurationWidget::initGui()
= new QRegExpValidator(QRegExp(PortList::regularExpression()), this); = new QRegExpValidator(QRegExp(PortList::regularExpression()), this);
m_ui->portsLineEdit->setValidator(portsValidator); m_ui->portsLineEdit->setValidator(portsValidator);
const SshConnectionParameters &sshParams = deviceConfiguration()->sshParameters(); const SshConnectionParameters &sshParams = device()->sshParameters();
if (sshParams.authenticationType == SshConnectionParameters::AuthenticationByPassword) if (sshParams.authenticationType == SshConnectionParameters::AuthenticationByPassword)
m_ui->passwordButton->setChecked(true); m_ui->passwordButton->setChecked(true);
else else
m_ui->keyButton->setChecked(true); m_ui->keyButton->setChecked(true);
m_ui->timeoutSpinBox->setValue(sshParams.timeout); m_ui->timeoutSpinBox->setValue(sshParams.timeout);
m_ui->hostLineEdit->setEnabled(!deviceConfiguration()->isAutoDetected()); m_ui->hostLineEdit->setEnabled(!device()->isAutoDetected());
m_ui->sshPortSpinBox->setEnabled(!deviceConfiguration()->isAutoDetected()); m_ui->sshPortSpinBox->setEnabled(!device()->isAutoDetected());
m_ui->hostLineEdit->setText(sshParams.host); m_ui->hostLineEdit->setText(sshParams.host);
m_ui->sshPortSpinBox->setValue(sshParams.port); m_ui->sshPortSpinBox->setValue(sshParams.port);
m_ui->portsLineEdit->setText(deviceConfiguration()->freePorts().toString()); m_ui->portsLineEdit->setText(device()->freePorts().toString());
m_ui->timeoutSpinBox->setValue(sshParams.timeout); m_ui->timeoutSpinBox->setValue(sshParams.timeout);
m_ui->userLineEdit->setText(sshParams.userName); m_ui->userLineEdit->setText(sshParams.userName);
m_ui->pwdLineEdit->setText(sshParams.password); m_ui->pwdLineEdit->setText(sshParams.password);
@@ -191,8 +191,3 @@ void GenericLinuxDeviceConfigurationWidget::initGui()
m_ui->showPasswordCheckBox->setChecked(false); m_ui->showPasswordCheckBox->setChecked(false);
updatePortsWarningLabel(); updatePortsWarningLabel();
} }
LinuxDeviceConfiguration::Ptr GenericLinuxDeviceConfigurationWidget::deviceConfiguration() const
{
return device().staticCast<LinuxDeviceConfiguration>();
}

View File

@@ -32,7 +32,6 @@
#include <projectexplorer/devicesupport/idevicewidget.h> #include <projectexplorer/devicesupport/idevicewidget.h>
#include "linuxdeviceconfiguration.h"
#include "remotelinux_export.h" #include "remotelinux_export.h"
namespace RemoteLinux { namespace RemoteLinux {
@@ -48,7 +47,7 @@ class REMOTELINUX_EXPORT GenericLinuxDeviceConfigurationWidget
public: public:
explicit GenericLinuxDeviceConfigurationWidget( explicit GenericLinuxDeviceConfigurationWidget(
const LinuxDeviceConfiguration::Ptr &deviceConfig, QWidget *parent = 0); const ProjectExplorer::IDevice::Ptr &deviceConfig, QWidget *parent = 0);
~GenericLinuxDeviceConfigurationWidget(); ~GenericLinuxDeviceConfigurationWidget();
private slots: private slots:
@@ -67,7 +66,6 @@ private slots:
private: private:
void updatePortsWarningLabel(); void updatePortsWarningLabel();
void initGui(); void initGui();
LinuxDeviceConfiguration::Ptr deviceConfiguration() const;
Ui::GenericLinuxDeviceConfigurationWidget *m_ui; Ui::GenericLinuxDeviceConfigurationWidget *m_ui;
}; };

View File

@@ -84,8 +84,8 @@ IDevice::Ptr GenericLinuxDeviceConfigurationWizard::device()
sshParams.password = d->setupPage.password(); sshParams.password = d->setupPage.password();
else else
sshParams.privateKeyFile = d->setupPage.privateKeyFilePath(); sshParams.privateKeyFile = d->setupPage.privateKeyFilePath();
LinuxDeviceConfiguration::Ptr devConf = LinuxDeviceConfiguration::create(d->setupPage.configurationName(), IDevice::Ptr devConf = LinuxDeviceConfiguration::create(d->setupPage.configurationName(),
Core::Id(Constants::GenericLinuxOsType), LinuxDeviceConfiguration::Hardware); Core::Id(Constants::GenericLinuxOsType), IDevice::Hardware);
devConf->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100"))); devConf->setFreePorts(Utils::PortList::fromString(QLatin1String("10000-10100")));
devConf->setSshParameters(sshParams); devConf->setSshParameters(sshParams);
LinuxDeviceTestDialog dlg(devConf, new GenericLinuxDeviceTester(this), this); LinuxDeviceTestDialog dlg(devConf, new GenericLinuxDeviceTester(this), this);

View File

@@ -77,7 +77,7 @@ void GenericLinuxDeviceConfigurationWizardSetupPage::initializePage()
d->ui.userNameLineEdit->setText(defaultUserName()); d->ui.userNameLineEdit->setText(defaultUserName());
d->ui.passwordButton->setChecked(true); d->ui.passwordButton->setChecked(true);
d->ui.passwordLineEdit->setText(defaultPassWord()); d->ui.passwordLineEdit->setText(defaultPassWord());
d->ui.privateKeyPathChooser->setPath(LinuxDeviceConfiguration::defaultPrivateKeyFilePath()); d->ui.privateKeyPathChooser->setPath(ProjectExplorer::IDevice::defaultPrivateKeyFilePath());
handleAuthTypeChanged(); handleAuthTypeChanged();
} }

View File

@@ -45,9 +45,6 @@
namespace RemoteLinux { namespace RemoteLinux {
const QLatin1String MachineTypeKey("Type");
const LinuxDeviceConfiguration::MachineType DefaultMachineType = LinuxDeviceConfiguration::Hardware;
LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create(const QString &name, LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create(const QString &name,
Core::Id type, MachineType machineType, Origin origin, Core::Id id) Core::Id type, MachineType machineType, Origin origin, Core::Id id)
{ {
@@ -102,18 +99,16 @@ void LinuxDeviceConfiguration::executeAction(Core::Id actionId, QWidget *parent)
d->exec(); d->exec();
} }
LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QString &name, Core::Id type, LinuxDeviceConfiguration::LinuxDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType,
MachineType machineType, Origin origin, Core::Id id) Origin origin, Core::Id id)
: IDevice(type, origin, id) : IDevice(type, origin, machineType, id)
{ {
setDisplayName(name); setDisplayName(name);
m_machineType = machineType;
} }
LinuxDeviceConfiguration::LinuxDeviceConfiguration(const LinuxDeviceConfiguration &other) LinuxDeviceConfiguration::LinuxDeviceConfiguration(const LinuxDeviceConfiguration &other)
: IDevice(other) : IDevice(other)
{ {
m_machineType = other.machineType();
} }
LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create() LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create()
@@ -121,27 +116,9 @@ LinuxDeviceConfiguration::Ptr LinuxDeviceConfiguration::create()
return Ptr(new LinuxDeviceConfiguration); return Ptr(new LinuxDeviceConfiguration);
} }
void LinuxDeviceConfiguration::fromMap(const QVariantMap &map)
{
IDevice::fromMap(map);
m_machineType = static_cast<MachineType>(map.value(MachineTypeKey, DefaultMachineType).toInt());
}
QVariantMap LinuxDeviceConfiguration::toMap() const
{
QVariantMap map = IDevice::toMap();
map.insert(MachineTypeKey, m_machineType);
return map;
}
ProjectExplorer::IDevice::Ptr LinuxDeviceConfiguration::clone() const ProjectExplorer::IDevice::Ptr LinuxDeviceConfiguration::clone() const
{ {
return Ptr(new LinuxDeviceConfiguration(*this)); return Ptr(new LinuxDeviceConfiguration(*this));
} }
LinuxDeviceConfiguration::MachineType LinuxDeviceConfiguration::machineType() const
{
return m_machineType;
}
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -51,10 +51,6 @@ public:
typedef QSharedPointer<LinuxDeviceConfiguration> Ptr; typedef QSharedPointer<LinuxDeviceConfiguration> Ptr;
typedef QSharedPointer<const LinuxDeviceConfiguration> ConstPtr; typedef QSharedPointer<const LinuxDeviceConfiguration> ConstPtr;
enum MachineType { Hardware, Emulator };
MachineType machineType() const;
static Ptr create(); static Ptr create();
static Ptr create(const QString &name, Core::Id type, MachineType machineType, static Ptr create(const QString &name, Core::Id type, MachineType machineType,
Origin origin = ManuallyAdded, Core::Id id = Core::Id()); Origin origin = ManuallyAdded, Core::Id id = Core::Id());
@@ -64,20 +60,16 @@ public:
QList<Core::Id> actionIds() const; QList<Core::Id> actionIds() const;
QString displayNameForActionId(Core::Id actionId) const; QString displayNameForActionId(Core::Id actionId) const;
void executeAction(Core::Id actionId, QWidget *parent) const; void executeAction(Core::Id actionId, QWidget *parent) const;
void fromMap(const QVariantMap &map);
ProjectExplorer::IDevice::Ptr clone() const; ProjectExplorer::IDevice::Ptr clone() const;
protected: protected:
LinuxDeviceConfiguration() {} LinuxDeviceConfiguration() {}
LinuxDeviceConfiguration(const QString &name, Core::Id type, MachineType machineType, LinuxDeviceConfiguration(const QString &name, Core::Id type,
Origin origin, Core::Id id); MachineType machineType, Origin origin, Core::Id id);
LinuxDeviceConfiguration(const LinuxDeviceConfiguration &other); LinuxDeviceConfiguration(const LinuxDeviceConfiguration &other);
QVariantMap toMap() const;
private: private:
LinuxDeviceConfiguration &operator=(const LinuxDeviceConfiguration &); LinuxDeviceConfiguration &operator=(const LinuxDeviceConfiguration &);
LinuxDeviceConfiguration::MachineType m_machineType;
}; };
} // namespace RemoteLinux } // namespace RemoteLinux

View File

@@ -54,7 +54,7 @@ public:
using namespace Internal; using namespace Internal;
LinuxDeviceTestDialog::LinuxDeviceTestDialog(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfiguration, LinuxDeviceTestDialog::LinuxDeviceTestDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration,
AbstractLinuxDeviceTester *deviceTester, QWidget *parent) AbstractLinuxDeviceTester *deviceTester, QWidget *parent)
: QDialog(parent), d(new LinuxDeviceTestDialogPrivate(deviceTester)) : QDialog(parent), d(new LinuxDeviceTestDialogPrivate(deviceTester))
{ {

View File

@@ -43,10 +43,10 @@ class LinuxDeviceTestDialogPrivate;
class REMOTELINUX_EXPORT LinuxDeviceTestDialog : public QDialog class REMOTELINUX_EXPORT LinuxDeviceTestDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public:
public:
// Note: The dialog takes ownership of deviceTester // Note: The dialog takes ownership of deviceTester
explicit LinuxDeviceTestDialog(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfiguration, LinuxDeviceTestDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration,
AbstractLinuxDeviceTester * deviceTester, QWidget *parent = 0); AbstractLinuxDeviceTester * deviceTester, QWidget *parent = 0);
~LinuxDeviceTestDialog(); ~LinuxDeviceTestDialog();

View File

@@ -29,13 +29,13 @@
**************************************************************************/ **************************************************************************/
#include "linuxdevicetester.h" #include "linuxdevicetester.h"
#include "linuxdeviceconfiguration.h"
#include "remotelinuxusedportsgatherer.h" #include "remotelinuxusedportsgatherer.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <ssh/sshremoteprocess.h> #include <ssh/sshremoteprocess.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
using namespace ProjectExplorer;
using namespace QSsh; using namespace QSsh;
namespace RemoteLinux { namespace RemoteLinux {
@@ -51,7 +51,7 @@ class GenericLinuxDeviceTesterPrivate
public: public:
GenericLinuxDeviceTesterPrivate() : connection(0), state(Inactive) {} GenericLinuxDeviceTesterPrivate() : connection(0), state(Inactive) {}
LinuxDeviceConfiguration::ConstPtr deviceConfiguration; IDevice::ConstPtr deviceConfiguration;
SshConnection *connection; SshConnection *connection;
SshRemoteProcess::Ptr process; SshRemoteProcess::Ptr process;
RemoteLinuxUsedPortsGatherer portsGatherer; RemoteLinuxUsedPortsGatherer portsGatherer;
@@ -77,7 +77,7 @@ GenericLinuxDeviceTester::~GenericLinuxDeviceTester()
delete d; delete d;
} }
void GenericLinuxDeviceTester::testDevice(const LinuxDeviceConfiguration::ConstPtr &deviceConfiguration) void GenericLinuxDeviceTester::testDevice(const IDevice::ConstPtr &deviceConfiguration)
{ {
QTC_ASSERT(d->state == Inactive, return); QTC_ASSERT(d->state == Inactive, return);

View File

@@ -27,36 +27,33 @@
** **
** **
**************************************************************************/ **************************************************************************/
#ifndef LINUXDEVICETESTER_H #ifndef LINUXDEVICETESTER_H
#define LINUXDEVICETESTER_H #define LINUXDEVICETESTER_H
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <QObject> #include <projectexplorer/devicesupport/idevice.h>
#include <QSharedPointer>
QT_FORWARD_DECLARE_CLASS(QString)
namespace QSsh { namespace QSsh {
class SshConnection; class SshConnection;
} }
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration;
class RemoteLinuxUsedPortsGatherer; class RemoteLinuxUsedPortsGatherer;
namespace Internal { namespace Internal {
class GenericLinuxDeviceTesterPrivate; class GenericLinuxDeviceTesterPrivate;
} // namespace Internal }
class REMOTELINUX_EXPORT AbstractLinuxDeviceTester : public QObject class REMOTELINUX_EXPORT AbstractLinuxDeviceTester : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_DISABLE_COPY(AbstractLinuxDeviceTester)
public: public:
enum TestResult { TestSuccess, TestFailure }; enum TestResult { TestSuccess, TestFailure };
virtual void testDevice(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfiguration) = 0; virtual void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration) = 0;
virtual void stopTest() = 0; virtual void stopTest() = 0;
signals: signals:
@@ -72,11 +69,12 @@ protected:
class REMOTELINUX_EXPORT GenericLinuxDeviceTester : public AbstractLinuxDeviceTester class REMOTELINUX_EXPORT GenericLinuxDeviceTester : public AbstractLinuxDeviceTester
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit GenericLinuxDeviceTester(QObject *parent = 0); explicit GenericLinuxDeviceTester(QObject *parent = 0);
~GenericLinuxDeviceTester(); ~GenericLinuxDeviceTester();
void testDevice(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfiguration); void testDevice(const ProjectExplorer::IDevice::ConstPtr &deviceConfiguration);
void stopTest(); void stopTest();
RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const; RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const;

View File

@@ -28,7 +28,6 @@
**************************************************************************/ **************************************************************************/
#include "publickeydeploymentdialog.h" #include "publickeydeploymentdialog.h"
#include "linuxdeviceconfiguration.h"
#include "sshkeydeployer.h" #include "sshkeydeployer.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -37,6 +36,8 @@
#include <QTimer> #include <QTimer>
#include <QFileDialog> #include <QFileDialog>
using namespace ProjectExplorer;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
class PublicKeyDeploymentDialogPrivate class PublicKeyDeploymentDialogPrivate
@@ -49,7 +50,7 @@ public:
using namespace Internal; using namespace Internal;
PublicKeyDeploymentDialog *PublicKeyDeploymentDialog::createDialog(const LinuxDeviceConfiguration::ConstPtr &deviceConfig, PublicKeyDeploymentDialog *PublicKeyDeploymentDialog::createDialog(const IDevice::ConstPtr &deviceConfig,
QWidget *parent) QWidget *parent)
{ {
const QString &dir = QFileInfo(deviceConfig->sshParameters().privateKeyFile).path(); const QString &dir = QFileInfo(deviceConfig->sshParameters().privateKeyFile).path();
@@ -62,7 +63,7 @@ PublicKeyDeploymentDialog *PublicKeyDeploymentDialog::createDialog(const LinuxDe
return new PublicKeyDeploymentDialog(deviceConfig, publicKeyFileName, parent); return new PublicKeyDeploymentDialog(deviceConfig, publicKeyFileName, parent);
} }
PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const LinuxDeviceConfiguration::ConstPtr &deviceConfig, PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &deviceConfig,
const QString &publicKeyFileName, QWidget *parent) const QString &publicKeyFileName, QWidget *parent)
: QProgressDialog(parent), d(new PublicKeyDeploymentDialogPrivate) : QProgressDialog(parent), d(new PublicKeyDeploymentDialogPrivate)
{ {

View File

@@ -31,16 +31,11 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <QSharedPointer> #include <projectexplorer/devicesupport/idevice.h>
#include <QProgressDialog> #include <QProgressDialog>
QT_BEGIN_NAMESPACE
class QString;
QT_END_NAMESPACE
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration;
namespace Internal { namespace Internal {
class PublicKeyDeploymentDialogPrivate; class PublicKeyDeploymentDialogPrivate;
} // namespace Internal } // namespace Internal
@@ -50,7 +45,7 @@ class REMOTELINUX_EXPORT PublicKeyDeploymentDialog : public QProgressDialog
Q_OBJECT Q_OBJECT
public: public:
// Asks for public key and returns null if the file dialog is canceled. // Asks for public key and returns null if the file dialog is canceled.
static PublicKeyDeploymentDialog *createDialog(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfig, static PublicKeyDeploymentDialog *createDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfig,
QWidget *parent = 0); QWidget *parent = 0);
~PublicKeyDeploymentDialog(); ~PublicKeyDeploymentDialog();
@@ -61,7 +56,7 @@ private slots:
void handleCanceled(); void handleCanceled();
private: private:
explicit PublicKeyDeploymentDialog(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfig, explicit PublicKeyDeploymentDialog(const ProjectExplorer::IDevice::ConstPtr &deviceConfig,
const QString &publicKeyFileName, QWidget *parent = 0); const QString &publicKeyFileName, QWidget *parent = 0);
void handleDeploymentFinished(const QString &errorMsg); void handleDeploymentFinished(const QString &errorMsg);

View File

@@ -44,7 +44,7 @@
#include <limits> #include <limits>
using namespace Qt4ProjectManager; using namespace ProjectExplorer;
using namespace QSsh; using namespace QSsh;
using namespace Utils; using namespace Utils;
@@ -64,8 +64,7 @@ class AbstractRemoteLinuxApplicationRunnerPrivate
{ {
public: public:
AbstractRemoteLinuxApplicationRunnerPrivate(const RemoteLinuxRunConfiguration *runConfig) AbstractRemoteLinuxApplicationRunnerPrivate(const RemoteLinuxRunConfiguration *runConfig)
: devConfig(ProjectExplorer::DeviceProfileInformation::device(runConfig->target()->profile()) : devConfig(DeviceProfileInformation::device(runConfig->target()->profile())),
.dynamicCast<const LinuxDeviceConfiguration>()),
remoteExecutable(runConfig->remoteExecutableFilePath()), remoteExecutable(runConfig->remoteExecutableFilePath()),
appArguments(runConfig->arguments()), appArguments(runConfig->arguments()),
commandPrefix(runConfig->commandPrefix()), commandPrefix(runConfig->commandPrefix()),
@@ -76,7 +75,7 @@ public:
{ } { }
RemoteLinuxUsedPortsGatherer portsGatherer; RemoteLinuxUsedPortsGatherer portsGatherer;
LinuxDeviceConfiguration::ConstPtr devConfig; IDevice::ConstPtr devConfig;
const QString remoteExecutable; const QString remoteExecutable;
const QString appArguments; const QString appArguments;
const QString commandPrefix; const QString commandPrefix;
@@ -115,7 +114,7 @@ SshConnection *AbstractRemoteLinuxApplicationRunner::connection() const
return d->connection; return d->connection;
} }
LinuxDeviceConfiguration::ConstPtr AbstractRemoteLinuxApplicationRunner::devConfig() const IDevice::ConstPtr AbstractRemoteLinuxApplicationRunner::devConfig() const
{ {
return d->devConfig; return d->devConfig;
} }
@@ -383,11 +382,6 @@ bool AbstractRemoteLinuxApplicationRunner::canRun(QString &whyNot) const
return true; return true;
} }
void AbstractRemoteLinuxApplicationRunner::setDeviceConfiguration(const LinuxDeviceConfiguration::ConstPtr &deviceConfig)
{
d->devConfig = deviceConfig;
}
void AbstractRemoteLinuxApplicationRunner::handleDeviceSetupDone(bool success) void AbstractRemoteLinuxApplicationRunner::handleDeviceSetupDone(bool success)
{ {
QTC_ASSERT(d->state == SettingUpDevice, return); QTC_ASSERT(d->state == SettingUpDevice, return);

View File

@@ -31,6 +31,8 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <QObject> #include <QObject>
#include <QSharedPointer> #include <QSharedPointer>
@@ -38,7 +40,6 @@ namespace QSsh { class SshConnection; }
namespace Utils { class PortList; } namespace Utils { class PortList; }
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration;
class RemoteLinuxRunConfiguration; class RemoteLinuxRunConfiguration;
class RemoteLinuxUsedPortsGatherer; class RemoteLinuxUsedPortsGatherer;
@@ -60,7 +61,7 @@ public:
void startExecution(const QByteArray &remoteCall); void startExecution(const QByteArray &remoteCall);
QSharedPointer<const LinuxDeviceConfiguration> devConfig() const; ProjectExplorer::IDevice::ConstPtr devConfig() const;
QSsh::SshConnection *connection() const; QSsh::SshConnection *connection() const;
RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const; RemoteLinuxUsedPortsGatherer *usedPortsGatherer() const;
Utils::PortList *freePorts(); Utils::PortList *freePorts();
@@ -83,8 +84,6 @@ protected:
// Override to to additional checks. // Override to to additional checks.
virtual bool canRun(QString &whyNot) const; virtual bool canRun(QString &whyNot) const;
void setDeviceConfiguration(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfig);
void handleDeviceSetupDone(bool success); void handleDeviceSetupDone(bool success);
void handleInitialCleanupDone(bool success); void handleInitialCleanupDone(bool success);
void handleInitializationsDone(bool success); void handleInitializationsDone(bool success);

View File

@@ -26,9 +26,9 @@
** **
** **
**************************************************************************/ **************************************************************************/
#include "remotelinuxdebugsupport.h" #include "remotelinuxdebugsupport.h"
#include "linuxdeviceconfiguration.h"
#include "remotelinuxapplicationrunner.h" #include "remotelinuxapplicationrunner.h"
#include "remotelinuxrunconfiguration.h" #include "remotelinuxrunconfiguration.h"
#include "remotelinuxusedportsgatherer.h" #include "remotelinuxusedportsgatherer.h"
@@ -37,12 +37,11 @@
#include <debugger/debuggerstartparameters.h> #include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerprofileinformation.h> #include <debugger/debuggerprofileinformation.h>
#include <projectexplorer/abi.h> #include <projectexplorer/abi.h>
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/profile.h> #include <projectexplorer/profile.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h> #include <projectexplorer/toolchain.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qtsupport/qtprofileinformation.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QPointer> #include <QPointer>
@@ -97,9 +96,7 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
DebuggerStartParameters params; DebuggerStartParameters params;
Target *target = runConfig->target(); Target *target = runConfig->target();
Profile *profile = target->profile(); Profile *profile = target->profile();
const LinuxDeviceConfiguration::ConstPtr devConf const IDevice::ConstPtr devConf = DeviceProfileInformation::device(profile);
= DeviceProfileInformation::device(profile)
.dynamicCast<const RemoteLinux::LinuxDeviceConfiguration>();
params.sysRoot = SysRootProfileInformation::sysRoot(profile).toString(); params.sysRoot = SysRootProfileInformation::sysRoot(profile).toString();
params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString(); params.debuggerCommand = DebuggerProfileInformation::debuggerCommand(profile).toString();

View File

@@ -33,8 +33,8 @@
#include "remotelinuxdeployconfigurationwidget.h" #include "remotelinuxdeployconfigurationwidget.h"
#include "typespecificdeviceconfigurationlistmodel.h" #include "typespecificdeviceconfigurationlistmodel.h"
#include <coreplugin/id.h>
#include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4project.h>

View File

@@ -31,23 +31,18 @@
#ifndef REMOTELINUXDEPLOYCONFIGURATION_H #ifndef REMOTELINUXDEPLOYCONFIGURATION_H
#define REMOTELINUXDEPLOYCONFIGURATION_H #define REMOTELINUXDEPLOYCONFIGURATION_H
#include "linuxdeviceconfiguration.h"
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <coreplugin/id.h>
#include <projectexplorer/buildstep.h> #include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h> #include <projectexplorer/buildsteplist.h>
#include <projectexplorer/deployconfiguration.h> #include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/devicesupport/idevice.h>
namespace RemoteLinux { namespace RemoteLinux {
class AbstractEmbeddedLinuxTarget; class AbstractEmbeddedLinuxTarget;
class DeploymentInfo; class DeploymentInfo;
namespace Internal { namespace Internal { class RemoteLinuxDeployConfigurationFactory; }
class RemoteLinuxDeployConfigurationFactory;
class TypeSpecificDeviceConfigurationListModel;
} // namespace Internal
class REMOTELINUX_EXPORT RemoteLinuxDeployConfiguration class REMOTELINUX_EXPORT RemoteLinuxDeployConfiguration
: public ProjectExplorer::DeployConfiguration : public ProjectExplorer::DeployConfiguration

View File

@@ -29,34 +29,32 @@
#include "remotelinuxenvironmentreader.h" #include "remotelinuxenvironmentreader.h"
#include "linuxdeviceconfiguration.h" #include "linuxdeviceconfiguration.h"
#include "remotelinuxrunconfiguration.h"
#include <ssh/sshremoteprocessrunner.h> #include <ssh/sshremoteprocessrunner.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/profileinformation.h> #include <projectexplorer/profileinformation.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
using namespace ProjectExplorer;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(RemoteLinuxRunConfiguration *config, RemoteLinuxEnvironmentReader::RemoteLinuxEnvironmentReader(RunConfiguration *config, QObject *parent)
QObject *parent)
: QObject(parent) : QObject(parent)
, m_stop(false) , m_stop(false)
, m_devConfig(ProjectExplorer::DeviceProfileInformation::device(config->target()->profile())) , m_profile(config->target()->profile())
, m_runConfig(config)
, m_remoteProcessRunner(0) , m_remoteProcessRunner(0)
{ {
connect(config->target(), SIGNAL(profileChanged()), connect(config->target(), SIGNAL(profileChanged()),
this, SLOT(handleCurrentDeviceConfigChanged())); this, SLOT(handleCurrentDeviceConfigChanged()));
} }
RemoteLinuxEnvironmentReader::~RemoteLinuxEnvironmentReader()
{
}
void RemoteLinuxEnvironmentReader::start(const QString &environmentSetupCommand) void RemoteLinuxEnvironmentReader::start(const QString &environmentSetupCommand)
{ {
if (!m_devConfig) IDevice::ConstPtr devConfig = DeviceProfileInformation::device(m_profile);
if (!devConfig)
return; return;
m_stop = false; m_stop = false;
if (!m_remoteProcessRunner) if (!m_remoteProcessRunner)
@@ -65,7 +63,7 @@ void RemoteLinuxEnvironmentReader::start(const QString &environmentSetupCommand)
connect(m_remoteProcessRunner, SIGNAL(processClosed(int)), SLOT(remoteProcessFinished(int))); connect(m_remoteProcessRunner, SIGNAL(processClosed(int)), SLOT(remoteProcessFinished(int)));
const QByteArray remoteCall const QByteArray remoteCall
= QString(environmentSetupCommand + QLatin1String("; env")).toUtf8(); = QString(environmentSetupCommand + QLatin1String("; env")).toUtf8();
m_remoteProcessRunner->run(remoteCall, m_devConfig->sshParameters()); m_remoteProcessRunner->run(remoteCall, devConfig->sshParameters());
} }
void RemoteLinuxEnvironmentReader::stop() void RemoteLinuxEnvironmentReader::stop()
@@ -87,8 +85,6 @@ void RemoteLinuxEnvironmentReader::handleConnectionFailure()
void RemoteLinuxEnvironmentReader::handleCurrentDeviceConfigChanged() void RemoteLinuxEnvironmentReader::handleCurrentDeviceConfigChanged()
{ {
m_devConfig = ProjectExplorer::DeviceProfileInformation::device(m_runConfig->target()->profile());
if (m_remoteProcessRunner) if (m_remoteProcessRunner)
disconnect(m_remoteProcessRunner, 0, this, 0); disconnect(m_remoteProcessRunner, 0, this, 0);
m_env.clear(); m_env.clear();

View File

@@ -33,25 +33,22 @@
#include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/idevice.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <QObject> namespace ProjectExplorer {
class RunConfiguration;
class Profile;
namespace QSsh {
class SshRemoteProcessRunner;
} }
namespace RemoteLinux { namespace QSsh { class SshRemoteProcessRunner; }
class LinuxDeviceConfiguration;
class RemoteLinuxRunConfiguration;
namespace RemoteLinux {
namespace Internal { namespace Internal {
class RemoteLinuxEnvironmentReader : public QObject class RemoteLinuxEnvironmentReader : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
RemoteLinuxEnvironmentReader(RemoteLinuxRunConfiguration *config, QObject *parent = 0); RemoteLinuxEnvironmentReader(ProjectExplorer::RunConfiguration *config, QObject *parent = 0);
~RemoteLinuxEnvironmentReader();
void start(const QString &environmentSetupCommand); void start(const QString &environmentSetupCommand);
void stop(); void stop();
@@ -73,8 +70,7 @@ private:
bool m_stop; bool m_stop;
Utils::Environment m_env; Utils::Environment m_env;
ProjectExplorer::IDevice::ConstPtr m_devConfig; ProjectExplorer::Profile *m_profile;
RemoteLinuxRunConfiguration *m_runConfig;
QSsh::SshRemoteProcessRunner *m_remoteProcessRunner; QSsh::SshRemoteProcessRunner *m_remoteProcessRunner;
}; };

View File

@@ -29,13 +29,10 @@
**************************************************************************/ **************************************************************************/
#include "remotelinuxpackageinstaller.h" #include "remotelinuxpackageinstaller.h"
#include "linuxdeviceconfiguration.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <ssh/sshremoteprocessrunner.h> #include <ssh/sshremoteprocessrunner.h>
#include <QByteArray> using namespace ProjectExplorer;
using namespace QSsh; using namespace QSsh;
namespace RemoteLinux { namespace RemoteLinux {
@@ -47,7 +44,7 @@ public:
AbstractRemoteLinuxPackageInstallerPrivate() : isRunning(false), installer(0), killProcess(0) {} AbstractRemoteLinuxPackageInstallerPrivate() : isRunning(false), installer(0), killProcess(0) {}
bool isRunning; bool isRunning;
LinuxDeviceConfiguration::ConstPtr deviceConfig; IDevice::ConstPtr deviceConfig;
QSsh::SshRemoteProcessRunner *installer; QSsh::SshRemoteProcessRunner *installer;
QSsh::SshRemoteProcessRunner *killProcess; QSsh::SshRemoteProcessRunner *killProcess;
}; };
@@ -64,7 +61,7 @@ AbstractRemoteLinuxPackageInstaller::~AbstractRemoteLinuxPackageInstaller()
delete d; delete d;
} }
void AbstractRemoteLinuxPackageInstaller::installPackage(const LinuxDeviceConfiguration::ConstPtr &deviceConfig, void AbstractRemoteLinuxPackageInstaller::installPackage(const IDevice::ConstPtr &deviceConfig,
const QString &packageFilePath, bool removePackageFile) const QString &packageFilePath, bool removePackageFile)
{ {
QTC_ASSERT(!d->isRunning, return); QTC_ASSERT(!d->isRunning, return);

View File

@@ -27,17 +27,17 @@
** **
** **
**************************************************************************/ **************************************************************************/
#ifndef REMOTELINUXPACKAGEINSTALLER_H #ifndef REMOTELINUXPACKAGEINSTALLER_H
#define REMOTELINUXPACKAGEINSTALLER_H #define REMOTELINUXPACKAGEINSTALLER_H
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <QObject> #include <projectexplorer/devicesupport/idevice.h>
#include <QSharedPointer> #include <QSharedPointer>
#include <QString>
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration;
namespace Internal { namespace Internal {
class AbstractRemoteLinuxPackageInstallerPrivate; class AbstractRemoteLinuxPackageInstallerPrivate;
@@ -50,7 +50,7 @@ class REMOTELINUX_EXPORT AbstractRemoteLinuxPackageInstaller : public QObject
public: public:
~AbstractRemoteLinuxPackageInstaller(); ~AbstractRemoteLinuxPackageInstaller();
void installPackage(const QSharedPointer<const LinuxDeviceConfiguration> &deviceConfig, void installPackage(const ProjectExplorer::IDevice::ConstPtr &deviceConfig,
const QString &packageFilePath, bool removePackageFile); const QString &packageFilePath, bool removePackageFile);
void cancelInstallation(); void cancelInstallation();

View File

@@ -26,16 +26,13 @@
** **
** **
**************************************************************************/ **************************************************************************/
#include "remotelinuxprocesslist.h"
#include "linuxdeviceconfiguration.h" #include "remotelinuxprocesslist.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <ssh/sshremoteprocessrunner.h> #include <ssh/sshremoteprocessrunner.h>
#include <QByteArray> using namespace ProjectExplorer;
#include <QString>
using namespace QSsh; using namespace QSsh;
namespace RemoteLinux { namespace RemoteLinux {
@@ -55,14 +52,14 @@ static QString visualizeNull(QString s)
class AbstractRemoteLinuxProcessListPrivate class AbstractRemoteLinuxProcessListPrivate
{ {
public: public:
AbstractRemoteLinuxProcessListPrivate(const LinuxDeviceConfiguration::ConstPtr &devConf) AbstractRemoteLinuxProcessListPrivate(const IDevice::ConstPtr &devConf)
: deviceConfiguration(devConf), : deviceConfiguration(devConf),
state(Inactive) state(Inactive)
{ {
} }
const LinuxDeviceConfiguration::ConstPtr deviceConfiguration; const IDevice::ConstPtr deviceConfiguration;
SshRemoteProcessRunner process; SshRemoteProcessRunner process;
QList<RemoteProcess> remoteProcesses; QList<RemoteProcess> remoteProcesses;
QString errorMsg; QString errorMsg;
@@ -73,17 +70,12 @@ public:
using namespace Internal; using namespace Internal;
AbstractRemoteLinuxProcessList::AbstractRemoteLinuxProcessList(const LinuxDeviceConfiguration::ConstPtr &devConfig, AbstractRemoteLinuxProcessList::AbstractRemoteLinuxProcessList(const IDevice::ConstPtr &devConfig,
QObject *parent) QObject *parent)
: QAbstractTableModel(parent), d(new AbstractRemoteLinuxProcessListPrivate(devConfig)) : QAbstractTableModel(parent), d(new AbstractRemoteLinuxProcessListPrivate(devConfig))
{ {
} }
LinuxDeviceConfiguration::ConstPtr AbstractRemoteLinuxProcessList::deviceConfiguration() const
{
return d->deviceConfiguration;
}
AbstractRemoteLinuxProcessList::~AbstractRemoteLinuxProcessList() AbstractRemoteLinuxProcessList::~AbstractRemoteLinuxProcessList()
{ {
delete d; delete d;
@@ -224,7 +216,7 @@ void AbstractRemoteLinuxProcessList::setFinished()
} }
GenericRemoteLinuxProcessList::GenericRemoteLinuxProcessList(const LinuxDeviceConfiguration::ConstPtr &devConfig, GenericRemoteLinuxProcessList::GenericRemoteLinuxProcessList(const IDevice::ConstPtr &devConfig,
QObject *parent) QObject *parent)
: AbstractRemoteLinuxProcessList(devConfig, parent) : AbstractRemoteLinuxProcessList(devConfig, parent)
{ {

View File

@@ -31,12 +31,13 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <QAbstractTableModel> #include <QAbstractTableModel>
#include <QList> #include <QList>
#include <QSharedPointer> #include <QSharedPointer>
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration;
namespace Internal { namespace Internal {
class AbstractRemoteLinuxProcessListPrivate; class AbstractRemoteLinuxProcessListPrivate;
@@ -70,11 +71,9 @@ signals:
void processKilled(); void processKilled();
protected: protected:
AbstractRemoteLinuxProcessList(const QSharedPointer<const LinuxDeviceConfiguration> &devConfig, AbstractRemoteLinuxProcessList(const ProjectExplorer::IDevice::ConstPtr &devConfig,
QObject *parent = 0); QObject *parent = 0);
QSharedPointer<const LinuxDeviceConfiguration> deviceConfiguration() const;
private slots: private slots:
void handleConnectionError(); void handleConnectionError();
void handleRemoteProcessFinished(int exitStatus); void handleRemoteProcessFinished(int exitStatus);
@@ -101,7 +100,7 @@ class REMOTELINUX_EXPORT GenericRemoteLinuxProcessList : public AbstractRemoteLi
{ {
Q_OBJECT Q_OBJECT
public: public:
GenericRemoteLinuxProcessList(const QSharedPointer<const LinuxDeviceConfiguration> &devConfig, GenericRemoteLinuxProcessList(const ProjectExplorer::IDevice::ConstPtr &devConfig,
QObject *parent = 0); QObject *parent = 0);
protected: protected:

View File

@@ -40,7 +40,6 @@
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h> #include <projectexplorer/toolchain.h>
#include <qtsupport/qtoutputformatter.h> #include <qtsupport/qtoutputformatter.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4nodes.h> #include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qt4project.h> #include <qt4projectmanager/qt4project.h>
@@ -141,18 +140,13 @@ void RemoteLinuxRunConfiguration::init()
this, SLOT(handleDeployConfigChanged())); this, SLOT(handleDeployConfigChanged()));
handleDeployConfigChanged(); handleDeployConfigChanged();
Qt4Project *pro = static_cast<Qt4Project *>(target()->project()); Project *pro = target()->project();
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); this, SLOT(proFileUpdate(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
connect(target(), SIGNAL(profileChanged()), connect(target(), SIGNAL(profileChanged()),
this, SLOT(handleDeployablesUpdated())); // Handles device changes, etc. this, SLOT(handleDeployablesUpdated())); // Handles device changes, etc.
} }
Qt4BuildConfiguration *RemoteLinuxRunConfiguration::activeQt4BuildConfiguration() const
{
return static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration());
}
bool RemoteLinuxRunConfiguration::isEnabled() const bool RemoteLinuxRunConfiguration::isEnabled() const
{ {
if (d->parseInProgress) { if (d->parseInProgress) {
@@ -165,7 +159,7 @@ bool RemoteLinuxRunConfiguration::isEnabled() const
d->disabledReason = project->disabledReasonForRunConfiguration(d->proFilePath); d->disabledReason = project->disabledReasonForRunConfiguration(d->proFilePath);
return false; return false;
} }
if (!activeQt4BuildConfiguration()) { if (!activeBuildConfiguration()) {
d->disabledReason = tr("No active build configuration."); d->disabledReason = tr("No active build configuration.");
return false; return false;
} }

View File

@@ -33,13 +33,10 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include "linuxdeviceconfiguration.h"
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <utils/environment.h> #include <utils/environment.h>
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
class Qt4BuildConfiguration;
class Qt4ProFileNode; class Qt4ProFileNode;
} // namespace Qt4ProjectManager } // namespace Qt4ProjectManager
@@ -77,10 +74,8 @@ public:
QString disabledReason() const; QString disabledReason() const;
QWidget *createConfigurationWidget(); QWidget *createConfigurationWidget();
Utils::OutputFormatter *createOutputFormatter() const; Utils::OutputFormatter *createOutputFormatter() const;
Qt4ProjectManager::Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
RemoteLinuxDeployConfiguration *deployConfig() const; RemoteLinuxDeployConfiguration *deployConfig() const;
LinuxDeviceConfiguration::ConstPtr device() const;
virtual QString environmentPreparationCommand() const; virtual QString environmentPreparationCommand() const;
virtual QString commandPrefix() const; virtual QString commandPrefix() const;

View File

@@ -29,7 +29,6 @@
**************************************************************************/ **************************************************************************/
#include "remotelinuxrunconfigurationwidget.h" #include "remotelinuxrunconfigurationwidget.h"
#include "linuxdeviceconfiguration.h"
#include "remotelinuxrunconfiguration.h" #include "remotelinuxrunconfiguration.h"
#include "remotelinuxenvironmentreader.h" #include "remotelinuxenvironmentreader.h"
#include "remotelinuxutils.h" #include "remotelinuxutils.h"
@@ -38,7 +37,6 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <projectexplorer/environmentwidget.h> #include <projectexplorer/environmentwidget.h>
#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/projectexplorerconstants.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <utils/detailswidget.h> #include <utils/detailswidget.h>
#include <QCoreApplication> #include <QCoreApplication>
@@ -53,8 +51,6 @@
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
using namespace Qt4ProjectManager;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
namespace { namespace {

View File

@@ -72,9 +72,7 @@ bool RemoteLinuxRunControlFactory::canRun(RunConfiguration *runConfiguration, Ru
const RemoteLinuxRunConfiguration * const remoteRunConfig const RemoteLinuxRunConfiguration * const remoteRunConfig
= qobject_cast<RemoteLinuxRunConfiguration *>(runConfiguration); = qobject_cast<RemoteLinuxRunConfiguration *>(runConfiguration);
if (mode == DebugRunMode) { if (mode == DebugRunMode) {
LinuxDeviceConfiguration::ConstPtr dev = IDevice::ConstPtr dev = DeviceProfileInformation::device(runConfiguration->target()->profile());
ProjectExplorer::DeviceProfileInformation::device(runConfiguration->target()->profile())
.dynamicCast<const LinuxDeviceConfiguration>();
if (dev.isNull()) if (dev.isNull())
return false; return false;
return remoteRunConfig->portsUsedByDebuggers() <= dev->freePorts().count(); return remoteRunConfig->portsUsedByDebuggers() <= dev->freePorts().count();

View File

@@ -26,9 +26,8 @@
** **
** **
**************************************************************************/ **************************************************************************/
#include "remotelinuxusedportsgatherer.h"
#include "linuxdeviceconfiguration.h" #include "remotelinuxusedportsgatherer.h"
#include <utils/portlist.h> #include <utils/portlist.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -38,6 +37,7 @@
#include <QString> #include <QString>
using namespace ProjectExplorer;
using namespace QSsh; using namespace QSsh;
using namespace Utils; using namespace Utils;
@@ -72,7 +72,7 @@ RemoteLinuxUsedPortsGatherer::~RemoteLinuxUsedPortsGatherer()
delete d; delete d;
} }
void RemoteLinuxUsedPortsGatherer::start(const LinuxDeviceConfiguration::ConstPtr &devConf) void RemoteLinuxUsedPortsGatherer::start(const IDevice::ConstPtr &devConf)
{ {
QTC_ASSERT(!d->connection, return); QTC_ASSERT(!d->connection, return);
d->portsToCheck = devConf->freePorts(); d->portsToCheck = devConf->freePorts();

View File

@@ -31,6 +31,8 @@
#include "remotelinux_export.h" #include "remotelinux_export.h"
#include <projectexplorer/devicesupport/idevice.h>
#include <QList> #include <QList>
#include <QObject> #include <QObject>
#include <QSharedPointer> #include <QSharedPointer>
@@ -40,7 +42,6 @@ QT_FORWARD_DECLARE_CLASS(QString)
namespace Utils { class PortList; } namespace Utils { class PortList; }
namespace RemoteLinux { namespace RemoteLinux {
class LinuxDeviceConfiguration;
namespace Internal { namespace Internal {
class RemoteLinuxUsedPortsGathererPrivate; class RemoteLinuxUsedPortsGathererPrivate;
@@ -53,7 +54,7 @@ class REMOTELINUX_EXPORT RemoteLinuxUsedPortsGatherer : public QObject
public: public:
explicit RemoteLinuxUsedPortsGatherer(QObject *parent = 0); explicit RemoteLinuxUsedPortsGatherer(QObject *parent = 0);
~RemoteLinuxUsedPortsGatherer(); ~RemoteLinuxUsedPortsGatherer();
void start(const QSharedPointer<const LinuxDeviceConfiguration> &devConf); void start(const ProjectExplorer::IDevice::ConstPtr &devConf);
void stop(); void stop();
int getNextFreePort(Utils::PortList *freePorts) const; // returns -1 if no more are left int getNextFreePort(Utils::PortList *freePorts) const; // returns -1 if no more are left
QList<int> usedPorts() const; QList<int> usedPorts() const;

View File

@@ -31,7 +31,6 @@
#include "startgdbserverdialog.h" #include "startgdbserverdialog.h"
#include "remotelinuxprocesslist.h" #include "remotelinuxprocesslist.h"
#include "linuxdeviceconfiguration.h"
#include "remotelinuxusedportsgatherer.h" #include "remotelinuxusedportsgatherer.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
@@ -84,11 +83,10 @@ class StartGdbServerDialogPrivate
public: public:
StartGdbServerDialogPrivate(StartGdbServerDialog *q); StartGdbServerDialogPrivate(StartGdbServerDialog *q);
LinuxDeviceConfiguration::ConstPtr currentDevice() const IDevice::ConstPtr currentDevice() const
{ {
Profile *profile = profileChooser->currentProfile(); Profile *profile = profileChooser->currentProfile();
IDevice::ConstPtr device = DeviceProfileInformation::device(profile); return DeviceProfileInformation::device(profile);
return device.dynamicCast<const LinuxDeviceConfiguration>();
} }
StartGdbServerDialog *q; StartGdbServerDialog *q;
@@ -203,7 +201,7 @@ StartGdbServerDialog::~StartGdbServerDialog()
void StartGdbServerDialog::attachToDevice() void StartGdbServerDialog::attachToDevice()
{ {
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice(); IDevice::ConstPtr device = d->currentDevice();
// TODO: display error on non-matching device. // TODO: display error on non-matching device.
if (!device) if (!device)
return; return;
@@ -248,7 +246,7 @@ void StartGdbServerDialog::attachToProcess()
return; return;
d->attachProcessButton->setEnabled(false); d->attachProcessButton->setEnabled(false);
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice(); IDevice::ConstPtr device = d->currentDevice();
if (!device) if (!device)
return; return;
PortList ports = device->freePorts(); PortList ports = device->freePorts();
@@ -352,7 +350,7 @@ void StartGdbServerDialog::handleProcessErrorOutput()
void StartGdbServerDialog::reportOpenPort(int port) void StartGdbServerDialog::reportOpenPort(int port)
{ {
logMessage(tr("Port %1 is now accessible.").arg(port)); logMessage(tr("Port %1 is now accessible.").arg(port));
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice(); IDevice::ConstPtr device = d->currentDevice();
QString channel = QString("%1:%2").arg(device->sshParameters().host).arg(port); QString channel = QString("%1:%2").arg(device->sshParameters().host).arg(port);
logMessage(tr("Server started on %1").arg(channel)); logMessage(tr("Server started on %1").arg(channel));
@@ -375,7 +373,7 @@ void StartGdbServerDialog::handleProcessClosed(int status)
void StartGdbServerDialog::startGdbServerOnPort(int port, int pid) void StartGdbServerDialog::startGdbServerOnPort(int port, int pid)
{ {
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice(); IDevice::ConstPtr device = d->currentDevice();
connect(&d->runner, SIGNAL(connectionError()), SLOT(handleConnectionError())); connect(&d->runner, SIGNAL(connectionError()), SLOT(handleConnectionError()));
connect(&d->runner, SIGNAL(processStarted()), SLOT(handleProcessStarted())); connect(&d->runner, SIGNAL(processStarted()), SLOT(handleProcessStarted()));
connect(&d->runner, SIGNAL(readyReadStandardOutput()), SLOT(handleProcessOutputAvailable())); connect(&d->runner, SIGNAL(readyReadStandardOutput()), SLOT(handleProcessOutputAvailable()));

View File

@@ -39,7 +39,7 @@ using namespace ProjectExplorer;
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
TypeSpecificDeviceConfigurationListModel::TypeSpecificDeviceConfigurationListModel(ProjectExplorer::Target *target) TypeSpecificDeviceConfigurationListModel::TypeSpecificDeviceConfigurationListModel(Target *target)
: QAbstractListModel(target) : QAbstractListModel(target)
{ {
const DeviceManager * const devConfs = DeviceManager::instance(); const DeviceManager * const devConfs = DeviceManager::instance();
@@ -47,10 +47,6 @@ TypeSpecificDeviceConfigurationListModel::TypeSpecificDeviceConfigurationListMod
connect(target, SIGNAL(profileChanged()), this, SIGNAL(modelReset())); connect(target, SIGNAL(profileChanged()), this, SIGNAL(modelReset()));
} }
TypeSpecificDeviceConfigurationListModel::~TypeSpecificDeviceConfigurationListModel()
{
}
int TypeSpecificDeviceConfigurationListModel::rowCount(const QModelIndex &parent) const int TypeSpecificDeviceConfigurationListModel::rowCount(const QModelIndex &parent) const
{ {
if (parent.isValid()) if (parent.isValid())
@@ -70,7 +66,7 @@ QVariant TypeSpecificDeviceConfigurationListModel::data(const QModelIndex &index
{ {
if (!index.isValid() || index.row() >= rowCount() || role != Qt::DisplayRole) if (!index.isValid() || index.row() >= rowCount() || role != Qt::DisplayRole)
return QVariant(); return QVariant();
const LinuxDeviceConfiguration::ConstPtr &devConf = deviceAt(index.row()); const IDevice::ConstPtr &devConf = deviceAt(index.row());
Q_ASSERT(devConf); Q_ASSERT(devConf);
QString displayedName = devConf->displayName(); QString displayedName = devConf->displayName();
if (deviceMatches(devConf) if (deviceMatches(devConf)
@@ -80,7 +76,7 @@ QVariant TypeSpecificDeviceConfigurationListModel::data(const QModelIndex &index
return displayedName; return displayedName;
} }
LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::deviceAt(int idx) const IDevice::ConstPtr TypeSpecificDeviceConfigurationListModel::deviceAt(int idx) const
{ {
int currentRow = -1; int currentRow = -1;
const DeviceManager * const devConfs = DeviceManager::instance(); const DeviceManager * const devConfs = DeviceManager::instance();
@@ -88,13 +84,13 @@ LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::dev
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 (deviceMatches(device) && ++currentRow == idx) if (deviceMatches(device) && ++currentRow == idx)
return device.staticCast<const LinuxDeviceConfiguration>(); return device;
} }
QTC_CHECK(false); QTC_CHECK(false);
return LinuxDeviceConfiguration::ConstPtr(); return IDevice::ConstPtr();
} }
LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::defaultDeviceConfig() const IDevice::ConstPtr TypeSpecificDeviceConfigurationListModel::defaultDeviceConfig() const
{ {
const DeviceManager * const deviceManager = DeviceManager::instance(); const DeviceManager * const deviceManager = DeviceManager::instance();
const int deviceCount = deviceManager->deviceCount(); const int deviceCount = deviceManager->deviceCount();
@@ -102,17 +98,17 @@ LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::def
const IDevice::ConstPtr device = deviceManager->deviceAt(i); const IDevice::ConstPtr device = deviceManager->deviceAt(i);
if (deviceMatches(device) if (deviceMatches(device)
&& deviceManager->defaultDevice(device->type()) == device) { && deviceManager->defaultDevice(device->type()) == device) {
return device.staticCast<const LinuxDeviceConfiguration>(); return device;
} }
} }
return LinuxDeviceConfiguration::ConstPtr(); return IDevice::ConstPtr();
} }
LinuxDeviceConfiguration::ConstPtr TypeSpecificDeviceConfigurationListModel::find(Core::Id id) const IDevice::ConstPtr TypeSpecificDeviceConfigurationListModel::find(Core::Id id) const
{ {
const IDevice::ConstPtr &devConf = DeviceManager::instance()->find(id); const IDevice::ConstPtr &devConf = DeviceManager::instance()->find(id);
if (deviceMatches(devConf)) if (deviceMatches(devConf))
return devConf.staticCast<const LinuxDeviceConfiguration>(); return devConf;
return defaultDeviceConfig(); return defaultDeviceConfig();
} }
@@ -126,12 +122,12 @@ int TypeSpecificDeviceConfigurationListModel::indexForId(Core::Id id) const
return -1; return -1;
} }
ProjectExplorer::Target *TypeSpecificDeviceConfigurationListModel::target() const Target *TypeSpecificDeviceConfigurationListModel::target() const
{ {
return qobject_cast<ProjectExplorer::Target *>(QObject::parent()); return qobject_cast<Target *>(QObject::parent());
} }
bool TypeSpecificDeviceConfigurationListModel::deviceMatches(ProjectExplorer::IDevice::ConstPtr dev) const bool TypeSpecificDeviceConfigurationListModel::deviceMatches(IDevice::ConstPtr dev) const
{ {
if (dev.isNull()) if (dev.isNull())
return false; return false;

View File

@@ -30,10 +30,9 @@
#ifndef TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H #ifndef TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H
#define TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H #define TYPESPECIFICDEVICECONFIGURATIONLISTMODEL_H
#include "linuxdeviceconfiguration.h" #include <projectexplorer/devicesupport/idevice.h>
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QSharedPointer>
namespace ProjectExplorer { class Target; } namespace ProjectExplorer { class Target; }
@@ -43,20 +42,18 @@ namespace Internal {
class TypeSpecificDeviceConfigurationListModel : public QAbstractListModel class TypeSpecificDeviceConfigurationListModel : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit TypeSpecificDeviceConfigurationListModel(ProjectExplorer::Target *target); explicit TypeSpecificDeviceConfigurationListModel(ProjectExplorer::Target *target);
~TypeSpecificDeviceConfigurationListModel();
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
int role = Qt::DisplayRole) const;
QSharedPointer<const LinuxDeviceConfiguration> deviceAt(int idx) const;
QSharedPointer<const LinuxDeviceConfiguration> defaultDeviceConfig() const;
QSharedPointer<const LinuxDeviceConfiguration> find(Core::Id id) const;
int indexForId(Core::Id id) const;
private: private:
int indexForId(Core::Id id) const;
ProjectExplorer::IDevice::ConstPtr deviceAt(int idx) const;
ProjectExplorer::IDevice::ConstPtr defaultDeviceConfig() const;
ProjectExplorer::IDevice::ConstPtr find(Core::Id id) const;
ProjectExplorer::Target *target() const; ProjectExplorer::Target *target() const;
bool deviceMatches(ProjectExplorer::IDevice::ConstPtr dev) const; bool deviceMatches(ProjectExplorer::IDevice::ConstPtr dev) const;
}; };