forked from qt-creator/qt-creator
AppMan: Use FilePathAspect::setDefaultPathValue(FilePath)
Change-Id: Ia8025bc707fd1d87b4066fcee98b8566f13726d6 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -40,7 +40,7 @@ public:
|
||||
setDisplayName(Tr::tr("Create Application Manager package"));
|
||||
|
||||
packager.setSettingsKey(SETTINGSPREFIX "Executable");
|
||||
packager.setDefaultValue(getToolFilePath(Constants::APPMAN_PACKAGER, kit()));
|
||||
packager.setDefaultPathValue(getToolFilePath(Constants::APPMAN_PACKAGER, kit()));
|
||||
|
||||
arguments.setSettingsKey(SETTINGSPREFIX "Arguments");
|
||||
arguments.setResetter([] { return QLatin1String(ArgumentsDefault); });
|
||||
|
@@ -54,9 +54,9 @@ AppManagerInstallPackageStep::AppManagerInstallPackageStep(BuildStepList *bsl, I
|
||||
{
|
||||
setDisplayName(tr("Install Application Manager package"));
|
||||
|
||||
controller.setDefaultValue(getToolFilePath(Constants::APPMAN_CONTROLLER,
|
||||
target()->kit(),
|
||||
DeviceKitAspect::device(target()->kit())));
|
||||
controller.setDefaultPathValue(getToolFilePath(Constants::APPMAN_CONTROLLER,
|
||||
target()->kit(),
|
||||
DeviceKitAspect::device(target()->kit())));
|
||||
|
||||
arguments.setSettingsKey(SETTINGSPREFIX "Arguments");
|
||||
arguments.setResetter([] { return QLatin1String(ArgumentsDefault); });
|
||||
@@ -75,11 +75,11 @@ AppManagerInstallPackageStep::AppManagerInstallPackageStep(BuildStepList *bsl, I
|
||||
const TargetInformation targetInformation(target());
|
||||
|
||||
if (DeviceKitAspect::device(kit())->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
|
||||
packageFile.setDefaultValue(targetInformation.packageFilePath.toUserOutput());
|
||||
packageFile.setDefaultPathValue(targetInformation.packageFilePath);
|
||||
} else {
|
||||
const Utils::FilePath packageFilePath = targetInformation.runDirectory.pathAppended(
|
||||
targetInformation.packageFilePath.fileName());
|
||||
packageFile.setDefaultValue(packageFilePath.toUserOutput());
|
||||
packageFile.setDefaultPathValue(packageFilePath);
|
||||
}
|
||||
|
||||
setEnabled(!targetInformation.isBuiltin);
|
||||
|
@@ -41,8 +41,8 @@ public:
|
||||
return;
|
||||
const TargetInformation targetInformation = tis.at(0);
|
||||
|
||||
controller.setValue(FilePath::fromString(getToolFilePath(Constants::APPMAN_CONTROLLER, kit(),
|
||||
DeviceKitAspect::device(kit()))));
|
||||
controller.setValue(getToolFilePath(Constants::APPMAN_CONTROLLER, kit(),
|
||||
DeviceKitAspect::device(kit())));
|
||||
|
||||
appId.setValue(targetInformation.manifest.id);
|
||||
appId.setReadOnly(true);
|
||||
|
@@ -38,14 +38,14 @@ static FilePath getToolPathByQtVersion(const QtVersion *qtVersion,
|
||||
return {};
|
||||
}
|
||||
|
||||
QString getToolFilePath(const QString &toolname, const Kit *kit, const IDevice::ConstPtr &device)
|
||||
FilePath getToolFilePath(const QString &toolname, const Kit *kit, const IDevice::ConstPtr &device)
|
||||
{
|
||||
const bool local = !device || device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE;
|
||||
const FilePath path = local ? getToolPathByQtVersion(QtKitAspect::qtVersion(kit))
|
||||
: FilePath(Constants::REMOTE_DEFAULT_BIN_PATH);
|
||||
const QString name = getToolNameByDevice(toolname, device);
|
||||
const QString filePath = !path.isEmpty() ? path.pathAppended(name).toString() : name;
|
||||
return !device ? filePath : device->filePath(filePath).toUserOutput();
|
||||
return !device ? FilePath::fromString(filePath) : device->filePath(filePath);
|
||||
}
|
||||
|
||||
QString getToolNameByDevice(const QString &baseName, const QSharedPointer<const IDevice> &device)
|
||||
|
@@ -10,6 +10,6 @@
|
||||
namespace AppManager::Internal {
|
||||
|
||||
QString getToolNameByDevice(const QString &baseName, const QSharedPointer<const ProjectExplorer::IDevice> &device = nullptr);
|
||||
QString getToolFilePath(const QString &toolname, const ProjectExplorer::Kit *kit, const ProjectExplorer::IDevice::ConstPtr &device = nullptr);
|
||||
Utils::FilePath getToolFilePath(const QString &toolname, const ProjectExplorer::Kit *kit, const ProjectExplorer::IDevice::ConstPtr &device = nullptr);
|
||||
|
||||
} // AppManager::Internal
|
||||
|
Reference in New Issue
Block a user