Commit 486eae67 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Fix issue with cached device configuration.

External functions need to access the real device config,
internal ones need the cached one during deployment.

Task-number: QTCREATORBUG-4514
parent 855582de
......@@ -507,7 +507,7 @@ void MaemoDeployStep::handleUnmounted()
break;
case UnmountingCurrentDirs:
setState(GatheringPorts);
m_portsGatherer->start(m_connection, freePorts());
m_portsGatherer->start(m_connection, freePorts(m_cachedDeviceConfig));
break;
case UnmountingCurrentMounts:
if (m_hasError)
......@@ -932,7 +932,7 @@ void MaemoDeployStep::handlePortListReady()
if (m_state == GatheringPorts) {
setState(Mounting);
m_freePorts = freePorts();
m_freePorts = freePorts(m_cachedDeviceConfig);
m_mounter->mount(&m_freePorts, m_portsGatherer);
} else {
setState(Inactive);
......@@ -956,6 +956,7 @@ void MaemoDeployStep::setState(State newState)
}
if (m_deviceInstaller)
disconnect(m_deviceInstaller.data(), 0, this, 0);
m_cachedDeviceConfig.clear();
emit done();
}
}
......@@ -1000,10 +1001,13 @@ void MaemoDeployStep::handleDeviceInstallerErrorOutput(const QByteArray &output)
}
MaemoPortList MaemoDeployStep::freePorts() const
{
return freePorts(m_deviceConfig);
}
MaemoPortList MaemoDeployStep::freePorts(const MaemoDeviceConfig::ConstPtr &devConf) const
{
const Qt4BuildConfiguration * const qt4bc = qt4BuildConfiguration();
const MaemoDeviceConfig::ConstPtr &devConf
= m_cachedDeviceConfig ? m_cachedDeviceConfig : m_deviceConfig;
if (!devConf)
return MaemoPortList();
if (devConf->type() == MaemoDeviceConfig::Emulator && qt4bc) {
......
......@@ -157,6 +157,7 @@ private:
void unmount();
void setDeviceConfig(MaemoDeviceConfig::Id internalId);
const Qt4BuildConfiguration *qt4BuildConfiguration() const;
MaemoPortList freePorts(const QSharedPointer<const MaemoDeviceConfig> &devConfig) const;
static const QLatin1String Id;
......
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