forked from qt-creator/qt-creator
ProjectExplorer: Always set a RunControl's macro expander
In some cases (e.g. "Attach to running application") there is no
proper RunConfiguration, so fall back to Target or Kit.
Amends e78f456083
Change-Id: I0093d5f573fc259fd2a72bbc1aaa22dcb8adbaee
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -349,7 +349,7 @@ public:
|
|||||||
IDevice::ConstPtr device;
|
IDevice::ConstPtr device;
|
||||||
Utils::Id runMode;
|
Utils::Id runMode;
|
||||||
Utils::Icon icon;
|
Utils::Icon icon;
|
||||||
const MacroExpander *macroExpander;
|
const MacroExpander *macroExpander = nullptr;
|
||||||
QPointer<RunConfiguration> runConfiguration; // Not owned. Avoid use.
|
QPointer<RunConfiguration> runConfiguration; // Not owned. Avoid use.
|
||||||
QString buildKey;
|
QString buildKey;
|
||||||
QMap<Utils::Id, QVariantMap> settingsData;
|
QMap<Utils::Id, QVariantMap> settingsData;
|
||||||
@@ -389,11 +389,12 @@ void RunControl::setRunConfiguration(RunConfiguration *runConfig)
|
|||||||
d->runConfigId = runConfig->id();
|
d->runConfigId = runConfig->id();
|
||||||
d->runnable = runConfig->runnable();
|
d->runnable = runConfig->runnable();
|
||||||
d->displayName = runConfig->expandedDisplayName();
|
d->displayName = runConfig->expandedDisplayName();
|
||||||
d->macroExpander = runConfig->macroExpander();
|
|
||||||
d->buildKey = runConfig->buildKey();
|
d->buildKey = runConfig->buildKey();
|
||||||
d->settingsData = runConfig->aspectData();
|
d->settingsData = runConfig->aspectData();
|
||||||
|
|
||||||
setTarget(runConfig->target());
|
setTarget(runConfig->target());
|
||||||
|
|
||||||
|
d->macroExpander = runConfig->macroExpander();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunControl::setTarget(Target *target)
|
void RunControl::setTarget(Target *target)
|
||||||
@@ -412,6 +413,7 @@ void RunControl::setTarget(Target *target)
|
|||||||
}
|
}
|
||||||
|
|
||||||
setKit(target->kit());
|
setKit(target->kit());
|
||||||
|
d->macroExpander = target->macroExpander();
|
||||||
d->project = target->project();
|
d->project = target->project();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,6 +422,7 @@ void RunControl::setKit(Kit *kit)
|
|||||||
QTC_ASSERT(kit, return);
|
QTC_ASSERT(kit, return);
|
||||||
QTC_CHECK(!d->kit);
|
QTC_CHECK(!d->kit);
|
||||||
d->kit = kit;
|
d->kit = kit;
|
||||||
|
d->macroExpander = kit->macroExpander();
|
||||||
|
|
||||||
if (d->runnable.device)
|
if (d->runnable.device)
|
||||||
setDevice(d->runnable.device);
|
setDevice(d->runnable.device);
|
||||||
|
Reference in New Issue
Block a user