forked from qt-creator/qt-creator
RemoteLinux: Also decorate empty/invalid targets with device name
Change-Id: Iff9f80490ba3a59e0c17b28acd2376cfc0bf9d87 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -450,13 +450,21 @@ const QList<IRunConfigurationFactory *> IRunConfigurationFactory::allRunConfigur
|
||||
|
||||
QString IRunConfigurationFactory::decoratedTargetName(const QString targetName, Target *target)
|
||||
{
|
||||
QString displayName = QFileInfo(targetName).completeBaseName();
|
||||
QString displayName;
|
||||
if (!targetName.isEmpty())
|
||||
displayName = QFileInfo(targetName).completeBaseName();
|
||||
Core::Id devType = DeviceTypeKitInformation::deviceTypeId(target->kit());
|
||||
if (devType != Constants::DESKTOP_DEVICE_TYPE) {
|
||||
if (IDevice::ConstPtr dev = DeviceKitInformation::device(target->kit()))
|
||||
if (IDevice::ConstPtr dev = DeviceKitInformation::device(target->kit())) {
|
||||
if (displayName.isEmpty()) {
|
||||
//: Shown in Run configuration if no executable is given, %1 is device name
|
||||
displayName = tr("Run on %1").arg(dev->displayName());
|
||||
} else {
|
||||
//: Shown in Run configuration, Add menu: "name of runnable (on device name)"
|
||||
displayName = tr("%1 (on %2)").arg(displayName, dev->displayName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return displayName;
|
||||
}
|
||||
|
||||
|
@@ -155,12 +155,9 @@ bool RemoteLinuxRunConfiguration::fromMap(const QVariantMap &map)
|
||||
return true;
|
||||
}
|
||||
|
||||
QString RemoteLinuxRunConfiguration::defaultDisplayName()
|
||||
QString RemoteLinuxRunConfiguration::defaultDisplayName() const
|
||||
{
|
||||
if (!d->targetName.isEmpty())
|
||||
return IRunConfigurationFactory::decoratedTargetName(d->targetName, target());
|
||||
//: Remote Linux run configuration default display name
|
||||
return tr("Run on Remote Device");
|
||||
}
|
||||
|
||||
QString RemoteLinuxRunConfiguration::arguments() const
|
||||
|
@@ -80,7 +80,7 @@ protected:
|
||||
QString extraId() const override;
|
||||
|
||||
private:
|
||||
QString defaultDisplayName();
|
||||
QString defaultDisplayName() const;
|
||||
void handleBuildSystemDataUpdated();
|
||||
|
||||
Internal::RemoteLinuxRunConfigurationPrivate * const d;
|
||||
|
Reference in New Issue
Block a user