forked from qt-creator/qt-creator
ProjectExplorer: Run Settings: Move environment settings further up
Adding the global aspects last, not first, more or less accidentally does the right thing. Fixes: QTCREATORBUG-22669 Change-Id: Iaf3eb4382974335471fff2f409ea4df7ef8f81b3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -49,7 +49,7 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid
|
|||||||
|
|
||||||
setContentsMargins(0, 0, 0, 0);
|
setContentsMargins(0, 0, 0, 0);
|
||||||
auto topLayout = new QVBoxLayout(this);
|
auto topLayout = new QVBoxLayout(this);
|
||||||
topLayout->setContentsMargins(0, 0, 0, 0);
|
topLayout->setContentsMargins(0, 0, 0, 25);
|
||||||
|
|
||||||
auto baseEnvironmentWidget = new QWidget;
|
auto baseEnvironmentWidget = new QWidget;
|
||||||
auto baseLayout = new QHBoxLayout(baseEnvironmentWidget);
|
auto baseLayout = new QHBoxLayout(baseEnvironmentWidget);
|
||||||
|
|||||||
@@ -206,9 +206,6 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id)
|
|||||||
QCoreApplication::translate("ProjectExplorer", "The currently active run configuration's name."),
|
QCoreApplication::translate("ProjectExplorer", "The currently active run configuration's name."),
|
||||||
[this] { return displayName(); }, false);
|
[this] { return displayName(); }, false);
|
||||||
|
|
||||||
for (const AspectFactory &factory : theAspectFactories)
|
|
||||||
m_aspects.append(factory(target));
|
|
||||||
|
|
||||||
m_commandLineGetter = [this] {
|
m_commandLineGetter = [this] {
|
||||||
FilePath executable;
|
FilePath executable;
|
||||||
if (const auto executableAspect = aspect<ExecutableAspect>())
|
if (const auto executableAspect = aspect<ExecutableAspect>())
|
||||||
@@ -547,17 +544,29 @@ bool RunConfigurationFactory::canHandle(Target *target) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RunConfiguration *RunConfigurationFactory::create(Target *target) const
|
||||||
|
{
|
||||||
|
QTC_ASSERT(m_creator, return nullptr);
|
||||||
|
RunConfiguration *rc = m_creator(target);
|
||||||
|
QTC_ASSERT(rc, return nullptr);
|
||||||
|
|
||||||
|
// Add the universal aspects.
|
||||||
|
for (const RunConfiguration::AspectFactory &factory : theAspectFactories)
|
||||||
|
rc->m_aspects.append(factory(target));
|
||||||
|
|
||||||
|
rc->acquaintAspects();
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
RunConfiguration *RunConfigurationCreationInfo::create(Target *target) const
|
RunConfiguration *RunConfigurationCreationInfo::create(Target *target) const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(factory->canHandle(target), return nullptr);
|
QTC_ASSERT(factory->canHandle(target), return nullptr);
|
||||||
QTC_ASSERT(id == factory->runConfigurationBaseId(), return nullptr);
|
QTC_ASSERT(id == factory->runConfigurationBaseId(), return nullptr);
|
||||||
QTC_ASSERT(factory->m_creator, return nullptr);
|
|
||||||
|
|
||||||
RunConfiguration *rc = factory->m_creator(target);
|
RunConfiguration *rc = factory->create(target);
|
||||||
if (!rc)
|
if (!rc)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
rc->acquaintAspects();
|
|
||||||
rc->m_buildKey = buildKey;
|
rc->m_buildKey = buildKey;
|
||||||
rc->doAdditionalSetup(*this);
|
rc->doAdditionalSetup(*this);
|
||||||
rc->setDisplayName(displayName);
|
rc->setDisplayName(displayName);
|
||||||
@@ -571,9 +580,7 @@ RunConfiguration *RunConfigurationFactory::restore(Target *parent, const QVarian
|
|||||||
if (factory->canHandle(parent)) {
|
if (factory->canHandle(parent)) {
|
||||||
const Core::Id id = idFromMap(map);
|
const Core::Id id = idFromMap(map);
|
||||||
if (id.name().startsWith(factory->m_runConfigBaseId.name())) {
|
if (id.name().startsWith(factory->m_runConfigBaseId.name())) {
|
||||||
QTC_ASSERT(factory->m_creator, continue);
|
RunConfiguration *rc = factory->create(parent);
|
||||||
RunConfiguration *rc = factory->m_creator(parent);
|
|
||||||
rc->acquaintAspects();
|
|
||||||
if (rc->fromMap(map))
|
if (rc->fromMap(map))
|
||||||
return rc;
|
return rc;
|
||||||
delete rc;
|
delete rc;
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ private:
|
|||||||
static void addAspectFactory(const AspectFactory &aspectFactory);
|
static void addAspectFactory(const AspectFactory &aspectFactory);
|
||||||
|
|
||||||
friend class RunConfigurationCreationInfo;
|
friend class RunConfigurationCreationInfo;
|
||||||
|
friend class RunConfigurationFactory;
|
||||||
|
|
||||||
QString m_buildKey;
|
QString m_buildKey;
|
||||||
bool m_isEnabled = false;
|
bool m_isEnabled = false;
|
||||||
@@ -249,6 +250,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool canHandle(Target *target) const;
|
bool canHandle(Target *target) const;
|
||||||
|
RunConfiguration *create(Target *target) const;
|
||||||
|
|
||||||
friend class RunConfigurationCreationInfo;
|
friend class RunConfigurationCreationInfo;
|
||||||
RunConfigurationCreator m_creator;
|
RunConfigurationCreator m_creator;
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ RunSettingsWidget::RunSettingsWidget(Target *target) :
|
|||||||
this, &RunSettingsWidget::activeDeployConfigurationChanged);
|
this, &RunSettingsWidget::activeDeployConfigurationChanged);
|
||||||
|
|
||||||
// run part
|
// run part
|
||||||
runWidget->setContentsMargins(0, 10, 0, 25);
|
runWidget->setContentsMargins(0, 10, 0, 0);
|
||||||
m_runLayout = new QVBoxLayout(runWidget);
|
m_runLayout = new QVBoxLayout(runWidget);
|
||||||
m_runLayout->setContentsMargins(0, 0, 0, 0);
|
m_runLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
m_runLayout->setSpacing(5);
|
m_runLayout->setSpacing(5);
|
||||||
|
|||||||
Reference in New Issue
Block a user