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

@@ -36,6 +36,7 @@
#include "maemoconstants.h"
#include "maemodebugsupport.h"
#include "maemoremotemountsmodel.h"
#include "maemorunconfiguration.h"
#include "maemoruncontrol.h"
@@ -158,9 +159,20 @@ MaemoRunControlFactory::~MaemoRunControlFactory()
bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration,
const QString &mode) const
{
return qobject_cast<MaemoRunConfiguration *>(runConfiguration)
&& (mode == ProjectExplorer::Constants::RUNMODE
|| mode == ProjectExplorer::Constants::DEBUGMODE);
const MaemoRunConfiguration * const maemoRunConfig
= qobject_cast<MaemoRunConfiguration *>(runConfiguration);
if (!maemoRunConfig || !maemoRunConfig->deviceConfig().isValid())
return false;
const int freePortCount = maemoRunConfig->freePorts().count();
if (freePortCount == 0)
return false;
const int mountDirCount
= maemoRunConfig->remoteMounts()->validMountSpecificationCount();
if (mode == ProjectExplorer::Constants::DEBUGMODE)
return freePortCount > mountDirCount;
if (mode == ProjectExplorer::Constants::RUNMODE)
return freePortCount >= mountDirCount;
return false;
}
RunControl* MaemoRunControlFactory::create(RunConfiguration *runConfig,