forked from qt-creator/qt-creator
ProjectExplorer: Introduce DeviceKitAspect::deviceFilePath()
A convenience method redirecting to IDevice::filePath. Change-Id: I1bd4a6500fa051641873020244d97e307f579e72 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -131,11 +131,8 @@ void StartRemoteDialog::validate()
|
|||||||
|
|
||||||
Runnable StartRemoteDialog::runnable() const
|
Runnable StartRemoteDialog::runnable() const
|
||||||
{
|
{
|
||||||
Kit *kit = d->kitChooser->currentKit();
|
const Kit *kit = d->kitChooser->currentKit();
|
||||||
IDevice::ConstPtr device = DeviceKitAspect::device(kit);
|
const FilePath filePath = DeviceKitAspect::deviceFilePath(kit, d->executable->text());
|
||||||
FilePath filePath = FilePath::fromString(d->executable->text());
|
|
||||||
if (device)
|
|
||||||
filePath = device->filePath(d->arguments->text());
|
|
||||||
|
|
||||||
Runnable r;
|
Runnable r;
|
||||||
r.command = {filePath, d->arguments->text(), CommandLine::Raw};
|
r.command = {filePath, d->arguments->text(), CommandLine::Raw};
|
||||||
|
@@ -1110,6 +1110,13 @@ void DeviceKitAspect::setDeviceId(Kit *k, Utils::Id id)
|
|||||||
k->setValue(DeviceKitAspect::id(), id.toSetting());
|
k->setValue(DeviceKitAspect::id(), id.toSetting());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilePath DeviceKitAspect::deviceFilePath(const Kit *k, const QString &pathOnDevice)
|
||||||
|
{
|
||||||
|
if (IDevice::ConstPtr dev = device(k))
|
||||||
|
return dev->filePath(pathOnDevice);
|
||||||
|
return FilePath::fromString(pathOnDevice);
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceKitAspect::kitsWereLoaded()
|
void DeviceKitAspect::kitsWereLoaded()
|
||||||
{
|
{
|
||||||
const QList<Kit *> kits = KitManager::kits();
|
const QList<Kit *> kits = KitManager::kits();
|
||||||
|
@@ -161,6 +161,7 @@ public:
|
|||||||
static Utils::Id deviceId(const Kit *k);
|
static Utils::Id deviceId(const Kit *k);
|
||||||
static void setDevice(Kit *k, IDeviceConstPtr dev);
|
static void setDevice(Kit *k, IDeviceConstPtr dev);
|
||||||
static void setDeviceId(Kit *k, Utils::Id dataId);
|
static void setDeviceId(Kit *k, Utils::Id dataId);
|
||||||
|
static Utils::FilePath deviceFilePath(const Kit *k, const QString &pathOnDevice);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariant defaultValue(const Kit *k) const;
|
QVariant defaultValue(const Kit *k) const;
|
||||||
|
Reference in New Issue
Block a user