Vcs: Use a FilePathAspect for VcsBaseSettings::path

Change-Id: Ic92ef43514f7f4004774ebbd9bb49c026dc735ba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2023-06-29 16:27:46 +02:00
parent 32dc43693f
commit b98a08587e
3 changed files with 6 additions and 6 deletions

View File

@@ -2108,8 +2108,8 @@ bool GitClient::synchronousApplyPatch(const FilePath &workingDirectory,
Environment GitClient::processEnvironment() const
{
Environment environment = VcsBaseClientImpl::processEnvironment();
const QString gitPath = settings().path.value();
environment.prependOrSetPath(FilePath::fromUserInput(gitPath));
const FilePath gitPath = settings().path();
environment.prependOrSetPath(gitPath);
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value()) {
QString homePath;
if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) {
@@ -2457,7 +2457,7 @@ void GitClient::tryLaunchingGitK(const Environment &env,
// This should always use Process::startDetached (as not to kill
// the child), but that does not have an environment parameter.
if (!settings().path.value().isEmpty()) {
if (!settings().path().isEmpty()) {
auto process = new Process(const_cast<GitClient*>(this));
process->setWorkingDirectory(workingDirectory);
process->setEnvironment(env);

View File

@@ -161,7 +161,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
if (tryResolve) {
resolvedBinPath = binaryPath();
if (!resolvedBinPath.isAbsolutePath())
resolvedBinPath = resolvedBinPath.searchInPath({path.filePath()}, FilePath::PrependToPath);
resolvedBinPath = resolvedBinPath.searchInPath({path()}, FilePath::PrependToPath);
tryResolve = false;
}
@@ -170,7 +170,7 @@ FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
*ok = false;
if (errorMessage)
*errorMessage = Tr::tr("The binary \"%1\" could not be located in the path \"%2\"")
.arg(binaryPath.value(), path.value());
.arg(binaryPath.value(), path().toUserOutput());
}
return resolvedBinPath;
}

View File

@@ -20,7 +20,7 @@ public:
Utils::StringAspect userEmail{this};
Utils::IntegerAspect logCount{this};
Utils::IntegerAspect timeout{this}; // Seconds
Utils::StringAspect path{this};
Utils::FilePathAspect path{this};
Utils::FilePaths searchPathList() const;
};