forked from qt-creator/qt-creator
ProjectExplorer: Fix assert
The build key is legitimately empty for CustomExecutableRunConfig.
Amends 07df45cdeb
.
Change-Id: Iadc992b772913599e5af0d5ea5104188707fad45
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -66,6 +66,7 @@ public:
|
|||||||
|
|
||||||
setDefaultDisplayName(RunConfigurationFactory::decoratedTargetName(
|
setDefaultDisplayName(RunConfigurationFactory::decoratedTargetName(
|
||||||
Tr::tr("Custom Executable"), target));
|
Tr::tr("Custom Executable"), target));
|
||||||
|
setUsesEmptyBuildKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -42,6 +42,7 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Target *targe
|
|||||||
});
|
});
|
||||||
|
|
||||||
setDefaultDisplayName(defaultDisplayName());
|
setDefaultDisplayName(defaultDisplayName());
|
||||||
|
setUsesEmptyBuildKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CustomExecutableRunConfiguration::isEnabled(Id) const
|
bool CustomExecutableRunConfiguration::isEnabled(Id) const
|
||||||
|
@@ -311,7 +311,13 @@ void RunConfiguration::toMap(Store &map) const
|
|||||||
void RunConfiguration::toMapSimple(Store &map) const
|
void RunConfiguration::toMapSimple(Store &map) const
|
||||||
{
|
{
|
||||||
ProjectConfiguration::toMap(map);
|
ProjectConfiguration::toMap(map);
|
||||||
|
|
||||||
|
if (m_usesEmptyBuildKeys) {
|
||||||
|
QTC_CHECK(m_buildKey.isEmpty());
|
||||||
|
} else {
|
||||||
QTC_CHECK(!m_buildKey.isEmpty());
|
QTC_CHECK(!m_buildKey.isEmpty());
|
||||||
|
}
|
||||||
|
|
||||||
map.insert(BUILD_KEY, m_buildKey);
|
map.insert(BUILD_KEY, m_buildKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,7 +378,12 @@ void RunConfiguration::fromMap(const Store &map)
|
|||||||
|
|
||||||
m_customized = m_customized || map.value(CUSTOMIZED_KEY, false).toBool();
|
m_customized = m_customized || map.value(CUSTOMIZED_KEY, false).toBool();
|
||||||
m_buildKey = map.value(BUILD_KEY).toString();
|
m_buildKey = map.value(BUILD_KEY).toString();
|
||||||
|
|
||||||
|
if (m_usesEmptyBuildKeys) {
|
||||||
|
QTC_CHECK(m_buildKey.isEmpty());
|
||||||
|
} else {
|
||||||
QTC_CHECK(!m_buildKey.isEmpty());
|
QTC_CHECK(!m_buildKey.isEmpty());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@@ -185,6 +185,8 @@ protected:
|
|||||||
|
|
||||||
Task createConfigurationIssue(const QString &description) const;
|
Task createConfigurationIssue(const QString &description) const;
|
||||||
|
|
||||||
|
void setUsesEmptyBuildKeys() { m_usesEmptyBuildKeys = true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Any additional data should be handled by aspects.
|
// Any additional data should be handled by aspects.
|
||||||
void fromMap(const Utils::Store &map) final;
|
void fromMap(const Utils::Store &map) final;
|
||||||
@@ -204,6 +206,7 @@ private:
|
|||||||
Utils::MacroExpander m_expander;
|
Utils::MacroExpander m_expander;
|
||||||
Utils::Store m_pristineState;
|
Utils::Store m_pristineState;
|
||||||
bool m_customized = false;
|
bool m_customized = false;
|
||||||
|
bool m_usesEmptyBuildKeys = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RunConfigurationCreationInfo
|
class RunConfigurationCreationInfo
|
||||||
|
@@ -61,6 +61,7 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar
|
|||||||
x11Forwarding.setMacroExpander(macroExpander());
|
x11Forwarding.setMacroExpander(macroExpander());
|
||||||
|
|
||||||
setDefaultDisplayName(runConfigDefaultDisplayName());
|
setDefaultDisplayName(runConfigDefaultDisplayName());
|
||||||
|
setUsesEmptyBuildKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString RemoteLinuxCustomRunConfiguration::runConfigDefaultDisplayName()
|
QString RemoteLinuxCustomRunConfiguration::runConfigDefaultDisplayName()
|
||||||
|
Reference in New Issue
Block a user