Maemo: Prepare for possibility of our deploy step disappearing.

Could happen e.g. when RDA is used.
This commit is contained in:
Christian Kandeler
2011-01-11 16:08:51 +01:00
parent d8d038daf4
commit e79f6031da
8 changed files with 52 additions and 36 deletions

View File

@@ -79,7 +79,8 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
: QWidget(parent),
m_runConfiguration(runConfiguration),
m_ignoreChange(false),
m_deviceEnvReader(new MaemoDeviceEnvReader(this, runConfiguration))
m_deviceEnvReader(new MaemoDeviceEnvReader(this, runConfiguration)),
m_deployablesConnected(false)
{
m_lastActiveBuildConfig = m_runConfiguration->activeQt4BuildConfiguration();
QVBoxLayout *mainLayout = new QVBoxLayout;
@@ -172,9 +173,10 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
SLOT(handleDebuggingTypeChanged()));
connect(m_runConfiguration, SIGNAL(targetInformationChanged()), this,
SLOT(updateTargetInformation()));
connect(m_runConfiguration->deployStep()->deployables().data(),
SIGNAL(modelReset()), this, SLOT(handleDeploySpecsChanged()));
handleDeploySpecsChanged();
connect(m_runConfiguration->target(),
SIGNAL(activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration*)),
SLOT(handleActiveDeployConfigurationChanged()));
handleActiveDeployConfigurationChanged();
}
void MaemoRunConfigurationWidget::addDebuggingWidgets(QVBoxLayout *mainLayout)
@@ -302,6 +304,24 @@ void MaemoRunConfigurationWidget::updateTargetInformation()
->setText(QDir::toNativeSeparators(m_runConfiguration->localExecutableFilePath()));
}
void MaemoRunConfigurationWidget::handleActiveDeployConfigurationChanged()
{
if (m_deployablesConnected)
return;
MaemoDeployStep * const deployStep = m_runConfiguration->deployStep();
if (!deployStep)
return;
connect(deployStep->deployables().data(), SIGNAL(modelReset()),
SLOT(handleDeploySpecsChanged()));
handleDeploySpecsChanged();
m_deployablesConnected = true;
disconnect(m_runConfiguration->target(),
SIGNAL(activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration*)),
this,
SLOT(handleActiveDeployConfigurationChanged()));
}
void MaemoRunConfigurationWidget::handleDeploySpecsChanged()
{
m_remoteExecutableLabel->setText(m_runConfiguration->remoteExecutableFilePath());