OSDN Git Service

Maemo: Fix free ports calculation.
authorChristian Kandeler <christian.kandeler@nokia.com>
Thu, 10 Feb 2011 15:07:56 +0000 (16:07 +0100)
committerChristian Kandeler <christian.kandeler@nokia.com>
Fri, 11 Feb 2011 13:21:04 +0000 (14:21 +0100)
This was always zero before the first deployment.

src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp

index 9b67b44..af4a34a 100644 (file)
@@ -993,15 +993,17 @@ void MaemoDeployStep::handleDeviceInstallerErrorOutput(const QByteArray &output)
 MaemoPortList MaemoDeployStep::freePorts() const
 {
     const Qt4BuildConfiguration * const qt4bc = qt4BuildConfiguration();
-    if (!m_cachedDeviceConfig)
+    const MaemoDeviceConfig::ConstPtr &devConf
+        = m_cachedDeviceConfig ? m_cachedDeviceConfig : m_deviceConfig;
+    if (!devConf)
         return MaemoPortList();
-    if (m_cachedDeviceConfig->type() == MaemoDeviceConfig::Simulator && qt4bc) {
+    if (devConf->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();
+    return devConf->freePorts();
 }
 
 const Qt4BuildConfiguration *MaemoDeployStep::qt4BuildConfiguration() const