Commit f119eec4 authored by Tobias Hunger's avatar Tobias Hunger

Project: Get rid of builddirectoryChanged signal

Get rid of Project::buildDirectoryChanged signal as well as
Target::buildDirectoryChanged (and the infrastructure).

Change-Id: Ia749e62eec7e182e558d81115dc2a3d07b72b346
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 4a40a18c
......@@ -484,7 +484,6 @@ CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep
if (pc->isActive())
updateDetails();
});
}
void CMakeBuildStepConfigWidget::toolArgumentsEdited()
......
......@@ -242,7 +242,6 @@ void Project::addTarget(Target *t)
d->m_targets.push_back(t);
connect(t, &Target::buildConfigurationEnabledChanged,
this, &Project::changeBuildConfigurationEnabled);
connect(t, &Target::buildDirectoryChanged, this, &Project::onBuildDirectoryChanged);
connect(t, &Target::addedProjectConfiguration, this, &Project::addedProjectConfiguration);
connect(t, &Target::aboutToRemoveProjectConfiguration, this, &Project::aboutToRemoveProjectConfiguration);
connect(t, &Target::removedProjectConfiguration, this, &Project::removedProjectConfiguration);
......@@ -867,11 +866,4 @@ void Project::setPreferredKitPredicate(const Kit::Predicate &predicate)
d->m_preferredKitPredicate = predicate;
}
void Project::onBuildDirectoryChanged()
{
auto target = qobject_cast<Target *>(sender());
if (target && target == activeTarget())
emit buildDirectoryChanged();
}
} // namespace ProjectExplorer
......@@ -209,8 +209,6 @@ signals:
void buildConfigurationEnabledChanged();
void buildDirectoryChanged();
void settingsLoaded();
void aboutToSaveSettings();
......@@ -245,7 +243,6 @@ protected:
private:
void changeBuildConfigurationEnabled();
void onBuildDirectoryChanged();
void setActiveTarget(Target *target);
ProjectPrivate *d;
......
......@@ -174,13 +174,6 @@ void Target::changeRunConfigurationEnabled()
emit runConfigurationEnabledChanged();
}
void Target::onBuildDirectoryChanged()
{
auto bc = qobject_cast<BuildConfiguration *>(sender());
if (bc && activeBuildConfiguration() == bc)
emit buildDirectoryChanged();
}
void Target::handleKitUpdates(Kit *k)
{
if (k != d->m_kit)
......@@ -241,8 +234,6 @@ void Target::addBuildConfiguration(BuildConfiguration *bc)
connect(bc, &BuildConfiguration::enabledChanged,
this, &Target::changeBuildConfigurationEnabled);
connect(bc, &BuildConfiguration::buildDirectoryChanged,
this, &Target::onBuildDirectoryChanged);
if (!activeBuildConfiguration())
setActiveBuildConfiguration(bc);
......@@ -295,7 +286,6 @@ void Target::setActiveBuildConfiguration(BuildConfiguration *bc)
emit activeProjectConfigurationChanged(d->m_activeBuildConfiguration);
emit activeBuildConfigurationChanged(d->m_activeBuildConfiguration);
emit buildConfigurationEnabledChanged();
emit buildDirectoryChanged();
}
}
......
......@@ -169,11 +169,6 @@ signals:
void deploymentDataChanged();
void applicationTargetsChanged();
// Remove all the signals below, they are stupid
/// Emitted whenever the current build configuartion changed or the build directory of the current
/// build configuration was changed.
void buildDirectoryChanged();
private:
Target(Project *parent, Kit *k);
void setEnabled(bool);
......@@ -181,7 +176,6 @@ private:
bool fromMap(const QVariantMap &map) override;
void updateDeviceState();
void onBuildDirectoryChanged();
void changeBuildConfigurationEnabled();
void changeDeployConfigurationEnabled();
......
......@@ -553,8 +553,11 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
this, &QbsBuildStepConfigWidget::updateState);
connect(&QbsProjectManagerSettings::instance(), &QbsProjectManagerSettings::settingsBaseChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(step->buildConfiguration()->target(), &ProjectExplorer::Target::buildDirectoryChanged,
this, &QbsBuildStepConfigWidget::updateState);
step->target()->subscribeSignal(&ProjectExplorer::BuildConfiguration::buildDirectoryChanged,
this, [this]() {
if (m_step->target()->activeBuildConfiguration() == sender())
updateState();
});
setContentsMargins(0, 0, 0, 0);
......
......@@ -544,7 +544,10 @@ void QbsProject::targetWasAdded(Target *t)
{
m_qbsProjects.insert(t, qbs::Project());
connect(t, &Target::activeBuildConfigurationChanged, this, &QbsProject::delayParsing);
connect(t, &Target::buildDirectoryChanged, this, &QbsProject::delayParsing);
t->subscribeSignal(&BuildConfiguration::buildDirectoryChanged, this, [this]() {
if (static_cast<BuildConfiguration *>(sender())->isActive())
delayParsing();
});
}
void QbsProject::targetWasRemoved(Target *t)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment