diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp index 5c93bd5dcad..7636a8837eb 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp @@ -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) { diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h index 42ff66f7afc..06815c61a6e 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h @@ -157,6 +157,7 @@ private: void unmount(); void setDeviceConfig(MaemoDeviceConfig::Id internalId); const Qt4BuildConfiguration *qt4BuildConfiguration() const; + MaemoPortList freePorts(const QSharedPointer &devConfig) const; static const QLatin1String Id;