forked from qt-creator/qt-creator
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:
@@ -2108,8 +2108,8 @@ bool GitClient::synchronousApplyPatch(const FilePath &workingDirectory,
|
|||||||
Environment GitClient::processEnvironment() const
|
Environment GitClient::processEnvironment() const
|
||||||
{
|
{
|
||||||
Environment environment = VcsBaseClientImpl::processEnvironment();
|
Environment environment = VcsBaseClientImpl::processEnvironment();
|
||||||
const QString gitPath = settings().path.value();
|
const FilePath gitPath = settings().path();
|
||||||
environment.prependOrSetPath(FilePath::fromUserInput(gitPath));
|
environment.prependOrSetPath(gitPath);
|
||||||
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value()) {
|
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value()) {
|
||||||
QString homePath;
|
QString homePath;
|
||||||
if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) {
|
if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) {
|
||||||
@@ -2457,7 +2457,7 @@ void GitClient::tryLaunchingGitK(const Environment &env,
|
|||||||
|
|
||||||
// This should always use Process::startDetached (as not to kill
|
// This should always use Process::startDetached (as not to kill
|
||||||
// the child), but that does not have an environment parameter.
|
// 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));
|
auto process = new Process(const_cast<GitClient*>(this));
|
||||||
process->setWorkingDirectory(workingDirectory);
|
process->setWorkingDirectory(workingDirectory);
|
||||||
process->setEnvironment(env);
|
process->setEnvironment(env);
|
||||||
|
@@ -161,7 +161,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()}, FilePath::PrependToPath);
|
resolvedBinPath = resolvedBinPath.searchInPath({path()}, FilePath::PrependToPath);
|
||||||
tryResolve = false;
|
tryResolve = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +170,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.value(), path.value());
|
.arg(binaryPath.value(), path().toUserOutput());
|
||||||
}
|
}
|
||||||
return resolvedBinPath;
|
return resolvedBinPath;
|
||||||
}
|
}
|
||||||
|
@@ -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::StringAspect path{this};
|
Utils::FilePathAspect path{this};
|
||||||
|
|
||||||
Utils::FilePaths searchPathList() const;
|
Utils::FilePaths searchPathList() const;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user