Fix warnings about connects on adding makestep to deploysteps

By actually fixing the underling problem

Change-Id: I3ee41ba9238f63f8a645c5d29e6627c6d4f4f7f9
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Daniel Teske
2012-01-13 16:29:38 +01:00
parent 0a5d41cbea
commit 334dc84072
2 changed files with 49 additions and 7 deletions

View File

@@ -305,7 +305,7 @@ void MakeStep::setUserArguments(const QString &arguments)
}
MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
: BuildStepConfigWidget(), m_ui(new Internal::Ui::MakeStep), m_makeStep(makeStep), m_ignoreChange(false)
: BuildStepConfigWidget(), m_ui(new Internal::Ui::MakeStep), m_makeStep(makeStep), m_bc(0), m_ignoreChange(false)
{
m_ui->setupUi(this);
@@ -327,13 +327,26 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
connect(makeStep, SIGNAL(userArgumentsChanged()),
this, SLOT(userArgumentsChanged()));
connect(makeStep->buildConfiguration(), SIGNAL(buildDirectoryChanged()),
this, SLOT(updateDetails()));
connect(makeStep->buildConfiguration(), SIGNAL(toolChainChanged()),
this, SLOT(updateDetails()));
connect(makeStep->qt4BuildConfiguration(), SIGNAL(qtVersionChanged()),
this, SLOT(qtVersionChanged()));
ProjectExplorer::BuildConfiguration *bc = makeStep->buildConfiguration();
if (!bc) {
// That means the step is in the deploylist, so we listen to the active build config
// changed signal and update various things in return
bc = makeStep->target()->activeBuildConfiguration();
m_bc = bc;
connect (makeStep->target(), SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
this, SLOT(activeBuildConfigurationChanged()));
}
if (bc) {
connect(bc, SIGNAL(buildDirectoryChanged()),
this, SLOT(updateDetails()));
connect(bc, SIGNAL(toolChainChanged()),
this, SLOT(updateDetails()));
connect(bc, SIGNAL(qtVersionChanged()),
this, SLOT(qtVersionChanged()));
}
connect(ProjectExplorer::ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
this, SLOT(updateMakeOverrideLabel()));
@@ -341,6 +354,33 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
this, SLOT(updateDetails()));
}
void MakeStepConfigWidget::activeBuildConfigurationChanged()
{
if (m_bc) {
disconnect(m_bc, SIGNAL(buildDirectoryChanged()),
this, SLOT(updateDetails()));
disconnect(m_bc, SIGNAL(toolChainChanged()),
this, SLOT(updateDetails()));
disconnect(m_bc, SIGNAL(qtVersionChanged()),
this, SLOT(qtVersionChanged()));
}
m_bc = m_makeStep->target()->activeBuildConfiguration();
updateMakeOverrideLabel();
updateDetails();
if (m_bc) {
connect(m_bc, SIGNAL(buildDirectoryChanged()),
this, SLOT(updateDetails()));
connect(m_bc, SIGNAL(toolChainChanged()),
this, SLOT(updateDetails()));
connect(m_bc, SIGNAL(qtVersionChanged()),
this, SLOT(qtVersionChanged()));
}
}
MakeStepConfigWidget::~MakeStepConfigWidget()
{
delete m_ui;

View File

@@ -138,10 +138,12 @@ private slots:
void updateDetails();
void userArgumentsChanged();
void qtVersionChanged();
void activeBuildConfigurationChanged();
private:
Internal::Ui::MakeStep *m_ui;
MakeStep *m_makeStep;
QString m_summaryText;
ProjectExplorer::BuildConfiguration *m_bc;
bool m_ignoreChange;
};