Commit 67c31159 authored by Christian Kandeler's avatar Christian Kandeler

Maemo: Parse actual Qemu port specification for deployment as well.

parent dcd6f4c0
......@@ -505,7 +505,7 @@ void MaemoDeployStep::handleUnmounted()
break;
case UnmountingCurrentDirs:
setState(GatheringPorts);
m_portsGatherer->start(m_connection, m_cachedDeviceConfig->freePorts());
m_portsGatherer->start(m_connection, freePorts());
break;
case UnmountingCurrentMounts:
if (m_hasError)
......@@ -925,7 +925,7 @@ void MaemoDeployStep::handlePortListReady()
if (m_state == GatheringPorts) {
setState(Mounting);
m_freePorts = m_cachedDeviceConfig->freePorts();
m_freePorts = freePorts();
m_mounter->mount(&m_freePorts, m_portsGatherer);
} else {
setState(Inactive);
......@@ -990,6 +990,20 @@ void MaemoDeployStep::handleDeviceInstallerErrorOutput(const QByteArray &output)
}
}
MaemoPortList MaemoDeployStep::freePorts() const
{
const Qt4BuildConfiguration * const qt4bc = qt4BuildConfiguration();
if (!m_cachedDeviceConfig)
return MaemoPortList();
if (m_cachedDeviceConfig->type() == MaemoDeviceConfig::Simulator && qt4bc) {
MaemoQemuRuntime rt;
const int id = qt4bc->qtVersion()->uniqueId();
if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt))
return rt.m_freePorts;
}
return m_cachedDeviceConfig->freePorts();
}
const Qt4BuildConfiguration *MaemoDeployStep::qt4BuildConfiguration() const
{
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
......
......@@ -85,6 +85,7 @@ public:
void setDeployed(const QString &host, const MaemoDeployable &deployable);
QSharedPointer<MaemoDeployables> deployables() const { return m_deployables; }
QSharedPointer<Core::SshConnection> sshConnection() const { return m_connection; }
MaemoPortList freePorts() const;
bool isDeployToSysrootEnabled() const { return m_deployToSysroot; }
void setDeployToSysrootEnabled(bool deploy) { m_deployToSysroot = deploy; }
......
......@@ -308,16 +308,7 @@ QString MaemoRunConfiguration::remoteExecutableFilePath() const
// TODO: Move to deploy step
MaemoPortList MaemoRunConfiguration::freePorts() const
{
const Qt4BuildConfiguration * const qt4bc = activeQt4BuildConfiguration();
if (!deviceConfig())
return MaemoPortList();
if (deviceConfig()->type() == MaemoDeviceConfig::Simulator && qt4bc) {
MaemoQemuRuntime rt;
const int id = qt4bc->qtVersion()->uniqueId();
if (MaemoQemuManager::instance().runtimeForQtVersion(id, &rt))
return rt.m_freePorts;
}
return deviceConfig()->freePorts();
return deployStep()->freePorts();
}
bool MaemoRunConfiguration::useRemoteGdb() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment