Update run configuration after device change

The run configuration name defaults to "<executable> (on <device>)".
When another device is selected e.g. using the MiniProjectTargetSelector
or Kits->Device option, the <device> part in run configuration name is
not updated and keeps referring to the initially selected device.

Change-Id: Idda828b7f33b754d3b50268d7417c9a2790db30e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Sergey Levin
2020-02-10 13:48:05 +03:00
parent 5c1cbf6b3f
commit 4d1b7d4c3d
5 changed files with 12 additions and 6 deletions

View File

@@ -429,10 +429,10 @@ QString RunConfigurationFactory::decoratedTargetName(const QString &targetName,
if (IDevice::ConstPtr dev = DeviceKitAspect::device(target->kit())) {
if (displayName.isEmpty()) {
//: Shown in Run configuration if no executable is given, %1 is device name
displayName = RunConfiguration::tr("Run on %1").arg(dev->displayName());
displayName = RunConfiguration::tr("Run on %{Device:Name}");
} else {
//: Shown in Run configuration, Add menu: "name of runnable (on device name)"
displayName = RunConfiguration::tr("%1 (on %2)").arg(displayName, dev->displayName());
displayName = RunConfiguration::tr("%1 (on %{Device:Name})").arg(displayName);
}
}
}