Commit 890c1906 authored by hjk's avatar hjk

ProjectExplorer: Re-organize RunConfiguration constructors

The idea is to massage the setup in a way to make implementation
of new configurations less error prone by identifying recurring patterns
and sharing repetitive code that tends to be forgotten (see Android cloning).

The former two lines of constructors (owner-and-id, owner-and-source)
are split into a simple, shared, constructor and new setId() and
copyFrom() functions.

The change is mostly mechanical, some multiple calls to fromMap
have been removed, though, some consts added.

Otherwise, to keep the patch small it temporarily introduces two
helper templates in IRunConfigurationFactory. Also, setId() signatures
have not been unified yet. These won't be needed in the final setup.

Change-Id: I8c0734496caae744a9883fe6d92c1d8f8e0234ea
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 4710e6b4
......@@ -45,13 +45,8 @@ const char amStartArgsKey[] = "Android.AmStartArgsKey";
const char preStartShellCmdsKey[] = "Android.PreStartShellCmdListKey";
const char postFinishShellCmdsKey[] = "Android.PostFinishShellCmdListKey";
AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, Core::Id id)
: RunConfiguration(parent, id)
{
}
AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, AndroidRunConfiguration *source)
: RunConfiguration(parent, source)
AndroidRunConfiguration::AndroidRunConfiguration(Target *target)
: RunConfiguration(target)
{
}
......
......@@ -29,17 +29,13 @@
#include <projectexplorer/runconfiguration.h>
QT_BEGIN_NAMESPACE
class QToolButton;
QT_END_NAMESPACE
namespace Android {
class ANDROID_EXPORT AndroidRunConfiguration : public ProjectExplorer::RunConfiguration
{
Q_OBJECT
public:
AndroidRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
explicit AndroidRunConfiguration(ProjectExplorer::Target *target);
QWidget *createConfigurationWidget() override;
Utils::OutputFormatter *createOutputFormatter() const override;
......@@ -51,15 +47,12 @@ public:
const QStringList &preStartShellCommands() const;
const QStringList &postFinishShellCommands() const;
protected:
AndroidRunConfiguration(ProjectExplorer::Target *parent, AndroidRunConfiguration *source);
private:
// FIXME: This appears to miss a copyFrom() implementation.
void setPreStartShellCommands(const QStringList &cmdList);
void setPostFinishShellCommands(const QStringList &cmdList);
void setAmStartExtraArgs(const QStringList &args);
private:
QStringList m_amStartExtraArgs;
QStringList m_preStartShellCommands;
QStringList m_postFinishShellCommands;
......
......@@ -47,8 +47,9 @@ class TestRunConfiguration : public ProjectExplorer::RunConfiguration
public:
TestRunConfiguration(ProjectExplorer::Target *parent, TestConfiguration *config)
: ProjectExplorer::RunConfiguration(parent, "AutoTest.TestRunConfig")
: ProjectExplorer::RunConfiguration(parent)
{
initialize("AutoTest.TestRunConfig");
setDefaultDisplayName(tr("AutoTest Debug"));
// disable QmlDebugger that is enabled by default
......
......@@ -113,15 +113,19 @@ private:
};
BareMetalCustomRunConfiguration::BareMetalCustomRunConfiguration(ProjectExplorer::Target *parent)
: BareMetalRunConfiguration(parent, runConfigId(), QString())
: BareMetalRunConfiguration(parent)
{
}
BareMetalCustomRunConfiguration::BareMetalCustomRunConfiguration(ProjectExplorer::Target *parent,
BareMetalCustomRunConfiguration *source)
: BareMetalRunConfiguration(parent, source)
, m_localExecutable(source->m_localExecutable)
void BareMetalCustomRunConfiguration::initialize()
{
BareMetalRunConfiguration::initialize(runConfigId(), QString());
}
void BareMetalCustomRunConfiguration::copyFrom(const BareMetalCustomRunConfiguration *source)
{
BareMetalRunConfiguration::copyFrom(source);
m_localExecutable = source->m_localExecutable;
}
bool BareMetalCustomRunConfiguration::isConfigured() const
......
......@@ -36,9 +36,10 @@ class BareMetalCustomRunConfiguration : public BareMetalRunConfiguration
{
Q_OBJECT
public:
BareMetalCustomRunConfiguration(ProjectExplorer::Target *parent);
BareMetalCustomRunConfiguration(ProjectExplorer::Target *parent,
BareMetalCustomRunConfiguration *source);
explicit BareMetalCustomRunConfiguration(ProjectExplorer::Target *parent);
void initialize();
void copyFrom(const BareMetalCustomRunConfiguration *source);
bool isConfigured() const override;
ConfigurationState ensureConfigured(QString *errorMessage) override;
......
......@@ -45,34 +45,33 @@ const char ProFileKey[] = "Qt4ProjectManager.MaemoRunConfiguration.ProFile";
const char WorkingDirectoryKey[] = "BareMetal.RunConfig.WorkingDirectory";
BareMetalRunConfiguration::BareMetalRunConfiguration(Target *parent, BareMetalRunConfiguration *other)
: RunConfiguration(parent, other),
m_projectFilePath(other->m_projectFilePath),
m_workingDirectory(other->m_workingDirectory)
BareMetalRunConfiguration::BareMetalRunConfiguration(Target *target)
: RunConfiguration(target)
{
init();
addExtraAspect(new ArgumentsAspect(this, "Qt4ProjectManager.MaemoRunConfiguration.Arguments"));
connect(target, &Target::deploymentDataChanged,
this, &BareMetalRunConfiguration::handleBuildSystemDataUpdated);
connect(target, &Target::applicationTargetsChanged,
this, &BareMetalRunConfiguration::handleBuildSystemDataUpdated);
connect(target, &Target::kitChanged,
this, &BareMetalRunConfiguration::handleBuildSystemDataUpdated); // Handles device changes, etc.
}
BareMetalRunConfiguration::BareMetalRunConfiguration(Target *parent,
const Core::Id id,
const QString &projectFilePath)
: RunConfiguration(parent, id),
m_projectFilePath(projectFilePath)
void BareMetalRunConfiguration::copyFrom(const BareMetalRunConfiguration *other)
{
addExtraAspect(new ArgumentsAspect(this, QLatin1String("Qt4ProjectManager.MaemoRunConfiguration.Arguments")));
init();
RunConfiguration::copyFrom(other);
m_projectFilePath = other->m_projectFilePath;
m_workingDirectory = other->m_workingDirectory;
setDefaultDisplayName(defaultDisplayName());
}
void BareMetalRunConfiguration::init()
void BareMetalRunConfiguration::initialize(const Core::Id id, const QString &projectFilePath)
{
setDefaultDisplayName(defaultDisplayName());
RunConfiguration::initialize(id);
m_projectFilePath = projectFilePath;
connect(target(), &Target::deploymentDataChanged,
this, &BareMetalRunConfiguration::handleBuildSystemDataUpdated);
connect(target(), &Target::applicationTargetsChanged,
this, &BareMetalRunConfiguration::handleBuildSystemDataUpdated);
connect(target(), &Target::kitChanged,
this, &BareMetalRunConfiguration::handleBuildSystemDataUpdated); // Handles device changes, etc.
setDefaultDisplayName(defaultDisplayName());
}
QWidget *BareMetalRunConfiguration::createConfigurationWidget()
......
......@@ -37,12 +37,11 @@ class BareMetalRunConfiguration : public ProjectExplorer::RunConfiguration
Q_OBJECT
Q_DISABLE_COPY(BareMetalRunConfiguration)
friend class BareMetalRunConfigurationFactory;
friend class ProjectExplorer::IRunConfigurationFactory;
friend class BareMetalRunConfigurationWidget;
public:
explicit BareMetalRunConfiguration(ProjectExplorer::Target *parent, Core::Id id,
const QString &projectFilePath);
explicit BareMetalRunConfiguration(ProjectExplorer::Target *target);
QWidget *createConfigurationWidget() override;
Utils::OutputFormatter *createOutputFormatter() const override;
......@@ -65,13 +64,13 @@ signals:
void targetInformationChanged() const;
protected:
BareMetalRunConfiguration(ProjectExplorer::Target *parent, BareMetalRunConfiguration *source);
bool fromMap(const QVariantMap &map) override;
QString defaultDisplayName();
void initialize(Core::Id id, const QString &projectFilePath);
void copyFrom(const BareMetalRunConfiguration *source);
private:
void handleBuildSystemDataUpdated();
void init();
QString m_projectFilePath;
QString m_workingDirectory;
......
......@@ -107,7 +107,7 @@ RunConfiguration *BareMetalRunConfigurationFactory::doCreate(Target *parent, Cor
{
if (id == BareMetalCustomRunConfiguration::runConfigId())
return new BareMetalCustomRunConfiguration(parent);
return new BareMetalRunConfiguration(parent, id, pathFromId(id));
return createHelper<BareMetalRunConfiguration>(parent, id, pathFromId(id));
}
RunConfiguration *BareMetalRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
......@@ -120,10 +120,9 @@ RunConfiguration *BareMetalRunConfigurationFactory::doRestore(Target *parent, co
RunConfiguration *BareMetalRunConfigurationFactory::clone(Target *parent, RunConfiguration *source)
{
QTC_ASSERT(canClone(parent, source), return 0);
if (BareMetalCustomRunConfiguration *old = qobject_cast<BareMetalCustomRunConfiguration *>(source))
return new BareMetalCustomRunConfiguration(parent, old);
BareMetalRunConfiguration *old = static_cast<BareMetalRunConfiguration*>(source);
return new BareMetalRunConfiguration(parent,old);
if (qobject_cast<BareMetalCustomRunConfiguration *>(source))
return cloneHelper<BareMetalCustomRunConfiguration>(parent, source);
return cloneHelper<BareMetalRunConfiguration>(parent, source);
}
bool BareMetalRunConfigurationFactory::canHandle(const Target *target) const
......
......@@ -71,8 +71,9 @@ class DummyRunConfiguration : public RunConfiguration
public:
DummyRunConfiguration(Target *parent)
: RunConfiguration(parent, "ClangStaticAnalyzer.DummyRunConfig")
: RunConfiguration(parent)
{
initialize("ClangStaticAnalyzer.DummyRunConfig");
setDefaultDisplayName(tr("Clang Static Analyzer"));
}
......
......@@ -60,35 +60,36 @@ const char CMAKE_RC_PREFIX[] = "CMakeProjectManager.CMakeRunConfiguration.";
const char TITLE_KEY[] = "CMakeProjectManager.CMakeRunConfiguation.Title";
} // namespace
CMakeRunConfiguration::CMakeRunConfiguration(Target *parent, Core::Id id, const QString &target,
const Utils::FileName &workingDirectory, const QString &title) :
RunConfiguration(parent, id),
m_buildSystemTarget(target),
m_executable(target),
m_title(title)
CMakeRunConfiguration::CMakeRunConfiguration(Target *target)
: RunConfiguration(target)
{
addExtraAspect(new LocalEnvironmentAspect(this, LocalEnvironmentAspect::BaseEnvironmentModifier()));
addExtraAspect(new ArgumentsAspect(this, QStringLiteral("CMakeProjectManager.CMakeRunConfiguration.Arguments")));
addExtraAspect(new TerminalAspect(this, QStringLiteral("CMakeProjectManager.CMakeRunConfiguration.UseTerminal")));
auto wd = new WorkingDirectoryAspect(this, QStringLiteral("CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"));
wd->setDefaultWorkingDirectory(workingDirectory);
addExtraAspect(wd);
ctor();
addExtraAspect(new ArgumentsAspect(this, "CMakeProjectManager.CMakeRunConfiguration.Arguments"));
addExtraAspect(new TerminalAspect(this, "CMakeProjectManager.CMakeRunConfiguration.UseTerminal"));
addExtraAspect(new WorkingDirectoryAspect(this, "CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"));
}
CMakeRunConfiguration::CMakeRunConfiguration(Target *parent, CMakeRunConfiguration *source) :
RunConfiguration(parent, source),
m_buildSystemTarget(source->m_buildSystemTarget),
m_executable(source->m_executable),
m_title(source->m_title)
void CMakeRunConfiguration::initialize(Core::Id id, const QString &target,
const Utils::FileName &workingDirectory, const QString &title)
{
ctor();
RunConfiguration::initialize(id);
m_buildSystemTarget = target;
m_executable = target;
m_title = title;
extraAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(workingDirectory);
setDefaultDisplayName(defaultDisplayName());
}
void CMakeRunConfiguration::ctor()
void CMakeRunConfiguration::copyFrom(const CMakeRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_buildSystemTarget = source->m_buildSystemTarget;
m_executable = source->m_executable;
m_title = source->m_title;
setDefaultDisplayName(defaultDisplayName());
}
......@@ -256,7 +257,7 @@ RunConfiguration *CMakeRunConfigurationFactory::doCreate(Target *parent, Core::I
CMakeProject *project = static_cast<CMakeProject *>(parent->project());
const QString title(buildTargetFromId(id));
const CMakeBuildTarget &ct = project->buildTargetForTitle(title);
return new CMakeRunConfiguration(parent, id, title, ct.workingDirectory, ct.title);
return createHelper<CMakeRunConfiguration>(parent, id, title, ct.workingDirectory, ct.title);
}
bool CMakeRunConfigurationFactory::canClone(Target *parent, RunConfiguration *source) const
......@@ -270,8 +271,7 @@ RunConfiguration *CMakeRunConfigurationFactory::clone(Target *parent, RunConfigu
{
if (!canClone(parent, source))
return 0;
CMakeRunConfiguration *crc(static_cast<CMakeRunConfiguration *>(source));
return new CMakeRunConfiguration(parent, crc);
return cloneHelper<CMakeRunConfiguration>(parent, source);
}
bool CMakeRunConfigurationFactory::canRestore(Target *parent, const QVariantMap &map) const
......@@ -284,7 +284,7 @@ bool CMakeRunConfigurationFactory::canRestore(Target *parent, const QVariantMap
RunConfiguration *CMakeRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
{
const Core::Id id = idFromMap(map);
return new CMakeRunConfiguration(parent, id, buildTargetFromId(id), Utils::FileName(), QString());
return createHelper<CMakeRunConfiguration>(parent, id, buildTargetFromId(id), Utils::FileName(), QString());
}
QString CMakeRunConfigurationFactory::buildTargetFromId(Core::Id id)
......
......@@ -35,11 +35,10 @@ class CMakeRunConfiguration : public ProjectExplorer::RunConfiguration
{
Q_OBJECT
friend class CMakeRunConfigurationWidget;
friend class CMakeRunConfigurationFactory;
friend class ProjectExplorer::IRunConfigurationFactory;
public:
CMakeRunConfiguration(ProjectExplorer::Target *parent, Core::Id id, const QString &target,
const Utils::FileName &workingDirectory, const QString &title);
explicit CMakeRunConfiguration(ProjectExplorer::Target *target);
ProjectExplorer::Runnable runnable() const override;
QWidget *createConfigurationWidget() override;
......@@ -55,18 +54,19 @@ public:
QString buildSystemTarget() const final { return m_buildSystemTarget; }
protected:
CMakeRunConfiguration(ProjectExplorer::Target *parent, CMakeRunConfiguration *source);
private:
void initialize(Core::Id id, const QString &target,
const Utils::FileName &workingDirectory, const QString &title);
void copyFrom(const CMakeRunConfiguration *source);
bool fromMap(const QVariantMap &map) override;
QString defaultDisplayName() const;
void updateEnabledState() final;
private:
QString baseWorkingDirectory() const;
void ctor();
const QString m_buildSystemTarget;
QString m_buildSystemTarget;
QString m_executable;
QString m_title;
};
......
......@@ -502,7 +502,7 @@ Project::RestoreResult GenericProject::fromMap(const QVariantMap &map, QString *
continue;
}
if (!t->activeRunConfiguration())
t->addRunConfiguration(new CustomExecutableRunConfiguration(t));
t->addRunConfiguration(IRunConfigurationFactory::createHelper<CustomExecutableRunConfiguration>(t));
}
m_activeTarget = activeTarget();
......
......@@ -94,28 +94,32 @@ private:
QComboBox *m_deviceTypeComboBox;
};
IosRunConfiguration::IosRunConfiguration(Target *parent, Core::Id id, const FileName &path)
: RunConfiguration(parent, id)
, m_profilePath(path)
IosRunConfiguration::IosRunConfiguration(Target *target)
: RunConfiguration(target)
{
addExtraAspect(new ArgumentsAspect(this, QLatin1String("Ios.run_arguments")));
init();
addExtraAspect(new ArgumentsAspect(this, "Ios.run_arguments"));
connect(DeviceManager::instance(), &DeviceManager::updated,
this, &IosRunConfiguration::deviceChanges);
connect(KitManager::instance(), &KitManager::kitsChanged,
this, &IosRunConfiguration::deviceChanges);
}
IosRunConfiguration::IosRunConfiguration(Target *parent, IosRunConfiguration *source)
: RunConfiguration(parent, source)
, m_profilePath(source->m_profilePath)
void IosRunConfiguration::initialize(Core::Id id, const FileName &path)
{
init();
RunConfiguration::initialize(id);
m_profilePath = path;
updateDisplayNames();
}
void IosRunConfiguration::init()
void IosRunConfiguration::copyFrom(const IosRunConfiguration *source)
{
RunConfiguration::copyFrom(source);
m_profilePath = source->m_profilePath;
updateDisplayNames();
connect(DeviceManager::instance(), &DeviceManager::updated,
this, &IosRunConfiguration::deviceChanges);
connect(KitManager::instance(), &KitManager::kitsChanged,
this, &IosRunConfiguration::deviceChanges);
}
void IosRunConfiguration::deviceChanges() {
......
......@@ -44,10 +44,9 @@ class IosRunConfigurationWidget;
class IosRunConfiguration : public ProjectExplorer::RunConfiguration
{
Q_OBJECT
friend class IosRunConfigurationFactory;
public:
IosRunConfiguration(ProjectExplorer::Target *parent, Core::Id id, const Utils::FileName &path);
explicit IosRunConfiguration(ProjectExplorer::Target *target);
QWidget *createConfigurationWidget() override;
Utils::OutputFormatter *createOutputFormatter() const override;
......@@ -67,15 +66,15 @@ public:
QString buildSystemTarget() const final;
protected:
IosRunConfiguration(ProjectExplorer::Target *parent, IosRunConfiguration *source);
signals:
void localExecutableChanged();
private:
friend class ProjectExplorer::IRunConfigurationFactory;
void initialize(Core::Id id, const Utils::FileName &path);
void copyFrom(const IosRunConfiguration *source);
void deviceChanges();
void init();
friend class IosRunConfigurationWidget;
void updateDisplayNames();
void updateEnabledState() final;
......
......@@ -108,8 +108,7 @@ RunConfiguration *IosRunConfigurationFactory::clone(Target *parent, RunConfigura
if (!canClone(parent, source))
return 0;
IosRunConfiguration *old = qobject_cast<IosRunConfiguration *>(source);
return new IosRunConfiguration(parent, old);
return cloneHelper<IosRunConfiguration>(parent, source);
}
bool IosRunConfigurationFactory::canHandle(Target *t) const
......@@ -133,13 +132,13 @@ QList<RunConfiguration *> IosRunConfigurationFactory::runConfigurationsForNode(T
RunConfiguration *IosRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
{
return new IosRunConfiguration(parent, id, pathFromId(id));
return createHelper<IosRunConfiguration>(parent, id, pathFromId(id));
}
RunConfiguration *IosRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
{
Core::Id id = ProjectExplorer::idFromMap(map);
return new IosRunConfiguration(parent, id, pathFromId(id));
return createHelper<IosRunConfiguration>(parent, id, pathFromId(id));
}
} // namespace Internal
......
......@@ -44,9 +44,8 @@ using namespace Utils;
namespace Nim {
NimRunConfiguration::NimRunConfiguration(Target *parent, Core::Id id)
: RunConfiguration(parent, id)
, m_buildConfiguration(nullptr)
NimRunConfiguration::NimRunConfiguration(Target *target)
: RunConfiguration(target)
, m_workingDirectoryAspect(new WorkingDirectoryAspect(this, Nim::Constants::C_NIMRUNCONFIGURATION_WORKINGDIRECTORYASPECT_ID))
, m_argumentAspect(new ArgumentsAspect(this, Nim::Constants::C_NIMRUNCONFIGURATION_ARGUMENTASPECT_ID))
, m_terminalAspect(new TerminalAspect(this, Nim::Constants::C_NIMRUNCONFIGURATION_TERMINALASPECT_ID))
......@@ -62,9 +61,8 @@ NimRunConfiguration::NimRunConfiguration(Target *parent, Core::Id id)
setDefaultDisplayName(tr(Constants::C_NIMRUNCONFIGURATION_DEFAULT_DISPLAY));
// Connect target signals
connect(this->target(), &Target::activeBuildConfigurationChanged,
connect(target, &Target::activeBuildConfigurationChanged,
this, &NimRunConfiguration::updateConfiguration);
updateConfiguration();
}
......
......@@ -43,7 +43,7 @@ class NimRunConfiguration : public ProjectExplorer::RunConfiguration
Q_OBJECT
public:
NimRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
explicit NimRunConfiguration(ProjectExplorer::Target *target);
QWidget *createConfigurationWidget() override;
ProjectExplorer::Runnable runnable() const override;
......@@ -65,7 +65,7 @@ private:
void setActiveBuildConfiguration(NimBuildConfiguration *activeBuildConfiguration);
QString m_executable;
NimBuildConfiguration *m_buildConfiguration;
NimBuildConfiguration *m_buildConfiguration = nullptr;
ProjectExplorer::WorkingDirectoryAspect* m_workingDirectoryAspect;
ProjectExplorer::ArgumentsAspect* m_argumentAspect;
ProjectExplorer::TerminalAspect* m_terminalAspect;
......
......@@ -80,7 +80,8 @@ RunConfiguration *NimRunConfigurationFactory::clone(Target *parent, RunConfigura
{
QTC_ASSERT(parent, return nullptr);
QTC_ASSERT(product, return nullptr);
std::unique_ptr<NimRunConfiguration> result(new NimRunConfiguration(parent, Constants::C_NIMRUNCONFIGURATION_ID));
std::unique_ptr<NimRunConfiguration> result(
createHelper<NimRunConfiguration>(parent, Constants::C_NIMRUNCONFIGURATION_ID));
return result->fromMap(product->toMap()) ? result.release() : nullptr;
}
......@@ -94,14 +95,13 @@ bool NimRunConfigurationFactory::canHandle(Target *parent) const
RunConfiguration *NimRunConfigurationFactory::doCreate(Target *parent, Core::Id id)
{
Q_UNUSED(id);
return new NimRunConfiguration(parent, id);
return createHelper<NimRunConfiguration>(parent, id);
}
RunConfiguration *NimRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map)
{
Q_UNUSED(map);
auto result = new NimRunConfiguration(parent, idFromMap(map));
auto result = createHelper<NimRunConfiguration>(parent, idFromMap(map));
result->fromMap(map);
return result;
}
......
......@@ -52,9 +52,10 @@ static const char BUILDDIRECTORY_KEY[] = "ProjectExplorer.BuildConfiguration.Bui
namespace ProjectExplorer {
BuildConfiguration::BuildConfiguration(Target *target, Core::Id id) :
ProjectConfiguration(target, id),
ProjectConfiguration(target),
m_clearSystemEnvironment(false)
{
initialize(id);
Q_ASSERT(target);
auto bsl = new BuildStepList(this, Core::Id(Constants::BUILDSTEPS_BUILD));
//: Display name of the build build step list. Used as part of the labels in the project window.
......@@ -76,11 +77,12 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id) :
}
BuildConfiguration::BuildConfiguration(Target *target, BuildConfiguration *source) :
ProjectConfiguration(target, source),
ProjectConfiguration(target),
m_clearSystemEnvironment(source->m_clearSystemEnvironment),
m_userEnvironmentChanges(source->m_userEnvironmentChanges),
m_buildDirectory(source->m_buildDirectory)
{
copyFrom(source);
Q_ASSERT(target);
// Do not clone stepLists here, do that in the derived constructor instead
// otherwise BuildStepFactories might reject to set up a BuildStep for us
......
......@@ -112,15 +112,17 @@ static const char buildStepEnabledKey[] = "ProjectExplorer.BuildStep.Enabled";
using namespace ProjectExplorer;
BuildStep::BuildStep(BuildStepList *bsl, Core::Id id) :
ProjectConfiguration(bsl, id), m_enabled(true)
ProjectConfiguration(bsl), m_enabled(true)
{
initialize(id);
Q_ASSERT(bsl);
ctor();
}
BuildStep::BuildStep(BuildStepList *bsl, BuildStep *bs) :
ProjectConfiguration(bsl, bs), m_enabled(bs->m_enabled)
ProjectConfiguration(bsl), m_enabled(bs->m_enabled)
{
copyFrom(bs);
Q_ASSERT(bsl);
setDisplayName(bs->displayName());
ctor();
......
......@@ -99,7 +99,7 @@ signals:
private:
void ctor();
bool m_enabled;
bool m_enabled = true;
};
class PROJECTEXPLORER_EXPORT BuildStepInfo
......
......@@ -45,14 +45,16 @@ const char STEPS_PREFIX[] = "ProjectExplorer.BuildStepList.Step.";
} // namespace
BuildStepList::BuildStepList(QObject *parent, Core::Id id) :
ProjectConfiguration(parent, id)
ProjectConfiguration(parent)