Commit b906360a authored by hjk's avatar hjk Committed by Christian Kandeler
Browse files

madde/qnx/remotelinux: adjust after profile changes



More Profile use, less dependency on QtSupport,
Derive qtVersionId from profile instead of qt build configuration.
Replace qt4BuildConfiguration with buildConfiguration.
Use IDevice base class in AbstractRemoteLinuxApplicationRunner
and in other places.  Simplify remote linux runconfiguration

Change-Id: I6414d3d8146d16c360b3a0465c57a052ea71f899
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent 0fcd30cc
...@@ -38,19 +38,14 @@ ...@@ -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 ...@@ -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() ...@@ -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
......
...@@ -34,19 +34,8 @@ ...@@ -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: ...@@ -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: ...@@ -95,7 +82,6 @@ private:
void init(); void init();
QString m_proFilePath; QString m_proFilePath;
}; };
} // namespace Internal } // namespace Internal
......
...@@ -59,7 +59,7 @@ MaddeDeviceTester::~MaddeDeviceTester() ...@@ -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);
......
...@@ -32,8 +32,6 @@ ...@@ -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 { ...@@ -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: ...@@ -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
......
...@@ -33,16 +33,15 @@ ...@@ -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: ...@@ -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: ...@@ -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. "
......
...@@ -156,7 +156,7 @@ void AbstractMaemoDeployByMountService::doDeviceSetup() ...@@ -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() ...@@ -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,14 +191,14 @@ void AbstractMaemoDeployByMountService::doDeploy() ...@@ -192,14 +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(), profile()); m_mounter->setupMounts(connection(), mountSpecifications(), profile());
} }
void AbstractMaemoDeployByMountService::stopDeployment() void AbstractMaemoDeployByMountService::stopDeployment()
...@@ -279,7 +278,7 @@ QString AbstractMaemoDeployByMountService::deployMountPoint() const ...@@ -279,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();
} }
......
...@@ -34,8 +34,7 @@ ...@@ -34,8 +34,7 @@
#include "maemoremotemounter.h" #include "maemoremotemounter.h"
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
#include <qtsupport/qtprofileinformation.h> #include <projectexplorer/profileinformation.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>
...@@ -70,7 +69,6 @@ MaemoDeploymentMounter::MaemoDeploymentMounter(QObject *parent) ...@@ -70,7 +69,6 @@ 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 Profile *profile) const Profile *profile)
{ {
...@@ -78,9 +76,9 @@ void MaemoDeploymentMounter::setupMounts(SshConnection *connection, ...@@ -78,9 +76,9 @@ void MaemoDeploymentMounter::setupMounts(SshConnection *connection,
m_mountSpecs = mountSpecs; m_mountSpecs = mountSpecs;
m_connection = connection; m_connection = connection;
m_devConf = devConf;
m_mounter->setConnection(m_connection, m_devConf);
m_profile = profile; m_profile = profile;
m_devConf = DeviceProfileInformation::device(profile);
m_mounter->setConnection(m_connection, m_devConf);
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError())); connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError()));
setState(UnmountingOldDirs); setState(UnmountingOldDirs);
unmount(); unmount();
...@@ -172,7 +170,7 @@ void MaemoDeploymentMounter::handlePortListReady() ...@@ -172,7 +170,7 @@ void MaemoDeploymentMounter::handlePortListReady()
return; return;
setState(Mounting); setState(Mounting);
m_freePorts = MaemoGlobal::freePorts(m_devConf, QtSupport::QtProfileInformation::qtVersion(m_profile)); m_freePorts = MaemoGlobal::freePorts(m_profile);
m_mounter->mount(&m_freePorts, m_portsGatherer); m_mounter->mount(&m_freePorts, m_portsGatherer);
} }
......
...@@ -33,19 +33,14 @@ ...@@ -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 QSsh { class SshConnection; }
namespace ProjectExplorer { class Profile; } namespace ProjectExplorer { class Profile; }
namespace QSsh { class SshConnection; }
namespace RemoteLinux { namespace RemoteLinux { class RemoteLinuxUsedPortsGatherer; }
class LinuxDeviceConfiguration;
class RemoteLinuxUsedPortsGatherer;
}
namespace Madde { namespace Madde {
namespace Internal { namespace Internal {
...@@ -60,7 +55,6 @@ public: ...@@ -60,7 +55,6 @@ 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 ProjectExplorer::Profile *profile); const ProjectExplorer::Profile *profile);
void tearDownMounts(); void tearDownMounts();
...@@ -92,7 +86,7 @@ private: ...@@ -92,7 +86,7 @@ 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;
......
...@@ -68,9 +68,9 @@ QString defaultUser(Core::Id deviceType) ...@@ -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 ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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() ...@@ -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 ...@@ -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;