forked from qt-creator/qt-creator
ProjectExplorer: Use RunConfigCreationInfo struct for rc creation
The struct will likely gain qtcrunnanable/terminal members, better pass all to where it is needed. Change-Id: Ieb0dae8b56ce5c0992955dbfc0cd89cdd7bfe848 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -535,13 +535,14 @@ bool IRunConfigurationFactory::canCreateHelper(Target *, const QString &) const
|
||||
return true;
|
||||
}
|
||||
|
||||
RunConfiguration *IRunConfigurationFactory::create(Target *parent, Core::Id id, const QString &extra) const
|
||||
RunConfiguration *IRunConfigurationFactory::create(Target *parent,
|
||||
const RunConfigurationCreationInfo &info) const
|
||||
{
|
||||
if (!canHandle(parent))
|
||||
return nullptr;
|
||||
if (id != m_runConfigBaseId)
|
||||
if (info.id != m_runConfigBaseId)
|
||||
return nullptr;
|
||||
if (!canCreateHelper(parent, extra))
|
||||
if (!canCreateHelper(parent, info.extra))
|
||||
return nullptr;
|
||||
|
||||
QTC_ASSERT(m_creator, return nullptr);
|
||||
@@ -551,9 +552,9 @@ RunConfiguration *IRunConfigurationFactory::create(Target *parent, Core::Id id,
|
||||
|
||||
// "FIX" ids by mangling in the extra data (build system target etc)
|
||||
// for compatibility for the current format used in settings.
|
||||
if (!extra.isEmpty()) {
|
||||
if (!info.extra.isEmpty()) {
|
||||
QVariantMap data = rc->toMap();
|
||||
data[ProjectConfiguration::settingsIdKey()] = id.withSuffix(extra).toString();
|
||||
data[ProjectConfiguration::settingsIdKey()] = info.id.withSuffix(info.extra).toString();
|
||||
rc->fromMap(data);
|
||||
QVariantMap data2 = rc->toMap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user