Vcs: Use a StringAspect again for settings().path()

This holds a path list, i.e. possibly several directories, separated
by ';' or ':'. PathChooser can't handle that. Long term this could
be something more sophisticate, but for now it's more a "string" than
one FilePath.

Change-Id: I6665c131e698db3afd268d6ab9bcf3d76a7c7289
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2023-07-26 12:07:11 +02:00
parent 79e839b29f
commit b880525e68
4 changed files with 5 additions and 6 deletions

View File

@@ -2108,8 +2108,7 @@ bool GitClient::synchronousApplyPatch(const FilePath &workingDirectory,
Environment GitClient::processEnvironment() const Environment GitClient::processEnvironment() const
{ {
Environment environment = VcsBaseClientImpl::processEnvironment(); Environment environment = VcsBaseClientImpl::processEnvironment();
const FilePath gitPath = settings().path(); environment.prependOrSetPath(settings().path());
environment.prependOrSetPath(gitPath);
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment()) { if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment()) {
QString homePath; QString homePath;
if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) { if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) {

View File

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

View File

@@ -39,7 +39,7 @@ VcsBaseSettings::~VcsBaseSettings() = default;
FilePaths VcsBaseSettings::searchPathList() const FilePaths VcsBaseSettings::searchPathList() const
{ {
// FIXME: Filepathify // FIXME: Filepathify
return Utils::transform(path.value().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts), return Utils::transform(path().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts),
&FilePath::fromUserInput); &FilePath::fromUserInput);
} }

View File

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