diff options
Diffstat (limited to 'src/plugins')
4 files changed, 18 insertions, 19 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index 8ea2db675e..b721a606ac 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -59,15 +59,8 @@ AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, Core::I // /<foobar> is used so the un-changed check in setBuildDirectory() works correctly. // The leading / is to avoid the relative the path expansion in BuildConfiguration::buildDirectory. setBuildDirectory(Utils::FileName::fromString("/<foobar>")); + setBuildDirectoryHistoryCompleter("AutoTools.BuildDir.History"); setConfigWidgetDisplayName(tr("Autotools Manager")); - - BaseStringAspect *bd = buildDirectoryAspect(); - bd->setLabelText(tr("Build directory:")); - bd->setDisplayStyle(BaseStringAspect::PathChooserDisplay); - bd->setExpectedKind(PathChooser::Directory); - bd->setBaseFileName(parent->project()->projectDirectory()); - bd->setEnvironment(environment()); - bd->setHistoryCompleter("AutoTools.BuildDir.History"); } void AutotoolsBuildConfiguration::initialize(const BuildInfo &info) diff --git a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp index e3283c27e9..764799f8da 100644 --- a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp +++ b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp @@ -53,14 +53,7 @@ GenericBuildConfiguration::GenericBuildConfiguration(Target *parent, Core::Id id : BuildConfiguration(parent, id) { setConfigWidgetDisplayName(tr("Generic Manager")); - - BaseStringAspect *bd = buildDirectoryAspect(); - bd->setDisplayStyle(BaseStringAspect::PathChooserDisplay); - bd->setExpectedKind(PathChooser::Directory); - bd->setHistoryCompleter("Generic.BuildDir.History"); - bd->setLabelText(tr("Build directory:")); - bd->setBaseFileName(parent->project()->projectDirectory()); - bd->setEnvironment(environment()); + setBuildDirectoryHistoryCompleter("Generic.BuildDir.History"); updateCacheAndEmitEnvironmentChanged(); } diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 87bcc0d700..df6bee1384 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -42,11 +42,11 @@ #include <coreplugin/idocument.h> -#include <utils/qtcassert.h> -#include <utils/macroexpander.h> #include <utils/algorithm.h> -#include <utils/mimetypes/mimetype.h> +#include <utils/macroexpander.h> #include <utils/mimetypes/mimedatabase.h> +#include <utils/mimetypes/mimetype.h> +#include <utils/qtcassert.h> #include <QDebug> #include <QFormLayout> @@ -88,6 +88,13 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id) m_buildDirectoryAspect = addAspect<BaseStringAspect>(); m_buildDirectoryAspect->setSettingsKey(BUILDDIRECTORY_KEY); + m_buildDirectoryAspect->setLabelText(tr("Build directory:")); + m_buildDirectoryAspect->setDisplayStyle(BaseStringAspect::PathChooserDisplay); + m_buildDirectoryAspect->setExpectedKind(Utils::PathChooser::Directory); + m_buildDirectoryAspect->setBaseFileName(target->project()->projectDirectory()); + m_buildDirectoryAspect->setEnvironment(environment()); + connect(m_buildDirectoryAspect, &BaseStringAspect::changed, + this, &BuildConfiguration::buildDirectoryChanged); connect(this, &BuildConfiguration::environmentChanged, this, [this] { m_buildDirectoryAspect->setEnvironment(environment()); @@ -230,6 +237,11 @@ void BuildConfiguration::setConfigWidgetDisplayName(const QString &display) m_configWidgetDisplayName = display; } +void BuildConfiguration::setBuildDirectoryHistoryCompleter(const QString &history) +{ + m_buildDirectoryAspect->setHistoryCompleter(history); +} + Target *BuildConfiguration::target() const { return static_cast<Target *>(parent()); diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index 93db3a3139..7739cd5304 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -101,6 +101,7 @@ public: ProjectExplorer::BaseStringAspect *buildDirectoryAspect() const; void setConfigWidgetDisplayName(const QString &display); + void setBuildDirectoryHistoryCompleter(const QString &history); signals: void environmentChanged(); |