diff options
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakebuildstep.cpp | 1 | ||||
-rw-r--r-- | src/plugins/projectexplorer/project.cpp | 8 | ||||
-rw-r--r-- | src/plugins/projectexplorer/project.h | 3 | ||||
-rw-r--r-- | src/plugins/projectexplorer/target.cpp | 10 | ||||
-rw-r--r-- | src/plugins/projectexplorer/target.h | 6 | ||||
-rw-r--r-- | src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 7 | ||||
-rw-r--r-- | src/plugins/qbsprojectmanager/qbsproject.cpp | 5 |
7 files changed, 9 insertions, 31 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index a1ba19182e..9a456cb8ce 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -484,7 +484,6 @@ CMakeBuildStepConfigWidget::CMakeBuildStepConfigWidget(CMakeBuildStep *buildStep if (pc->isActive()) updateDetails(); }); - } void CMakeBuildStepConfigWidget::toolArgumentsEdited() diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index ef5fb47599..1ab555a35e 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -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 diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 2d6ee34401..ba33b56524 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -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; diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index a62df23562..179b0edd5d 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -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(); } } diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index 5484710939..ff2ef08899 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -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(); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index a229d05397..063e6bf203 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -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); diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 46e79f4d5d..bd9f93ed2a 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -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) |