Maemo: Device configurations now have a list of free ports.

The device configuration widget is now the only place the user
ever has to specify ports.
This commit is contained in:
ck
2010-08-13 15:25:22 +02:00
parent c2da3f682e
commit 378ad4de3d
30 changed files with 223 additions and 266 deletions

View File

@@ -194,16 +194,21 @@ void MaemoSshRunner::handleUnmounted()
if (m_stop)
return;
MaemoPortList portList = m_devConfig.freePorts();
if (m_debugging && !m_runConfig->useRemoteGdb())
portList.getNext(); // One has already been used for gdbserver.
m_mounter->setPortList(portList);
const MaemoRemoteMountsModel * const remoteMounts
= m_runConfig->remoteMounts();
for (int i = 0; i < remoteMounts->mountSpecificationCount(); ++i)
m_mounter->addMountSpecification(remoteMounts->mountSpecificationAt(i),
false);
for (int i = 0; i < remoteMounts->mountSpecificationCount(); ++i) {
if (!addMountSpecification(remoteMounts->mountSpecificationAt(i)))
return;
}
if (m_debugging && m_runConfig->useRemoteGdb()) {
m_mounter->addMountSpecification(MaemoMountSpecification(
if (!addMountSpecification(MaemoMountSpecification(
m_runConfig->localDirToMountForRemoteGdb(),
MaemoGlobal::remoteProjectSourcesMountPoint(),
m_devConfig.debuggingPort), false);
MaemoGlobal::remoteProjectSourcesMountPoint())))
return;
}
m_mounter->mount();
}
@@ -250,6 +255,16 @@ void MaemoSshRunner::handleRemoteProcessFinished(int exitStatus)
cleanup(false);
}
bool MaemoSshRunner::addMountSpecification(const MaemoMountSpecification &mountSpec)
{
if (!m_mounter->addMountSpecification(mountSpec, false)) {
emit error(tr("The device does not have enough free ports "
"for this run configuration."));
return false;
}
return true;
}
} // namespace Internal
} // namespace Qt4ProjectManager