diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2012-09-27 11:25:58 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2012-09-27 12:09:13 +0200 |
commit | 69e022d112a674b92bdd6096cc0f407e0ae6d099 (patch) | |
tree | 6c0536ee85a835a2a78534580431661053940592 /src/plugins/git/gitsettings.cpp | |
parent | 6c436988ff76398df61090cb6de180d7228871a1 (diff) |
Git: Fix binary lookup with path setting
Task-number: QTCREATORBUG-7889
Change-Id: I251ef68e8dbb0a70565708053e368db89d5999e5
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/gitsettings.cpp')
-rw-r--r-- | src/plugins/git/gitsettings.cpp | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 53810909683..60e994ad485 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -30,14 +30,11 @@ #include "gitsettings.h" -#include <utils/synchronousprocess.h> - #include <QCoreApplication> namespace Git { namespace Internal { -const QLatin1String GitSettings::pathKey("Path"); const QLatin1String GitSettings::pullRebaseKey("PullRebase"); const QLatin1String GitSettings::omitAnnotationDateKey("OmitAnnotationDate"); const QLatin1String GitSettings::ignoreSpaceChangesInDiffKey("SpaceIgnorantDiff"); @@ -59,7 +56,6 @@ GitSettings::GitSettings() #else declareKey(timeoutKey, 30); #endif - declareKey(pathKey, QString()); declareKey(pullRebaseKey, false); declareKey(omitAnnotationDateKey, false); declareKey(ignoreSpaceChangesInDiffKey, true); @@ -81,33 +77,21 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const if (errorMessage) errorMessage->clear(); - if (m_binaryPath.isEmpty()) { - const QString binary = binaryPath(); - QString currentPath = stringValue(pathKey); - QString systemPath = QString::fromLocal8Bit(qgetenv("PATH")); - if (!systemPath.isEmpty()) { - if (!currentPath.isEmpty()) - currentPath.append(Utils::SynchronousProcess::pathSeparator()); - currentPath.append(systemPath); - } - // Search in path? - m_binaryPath = Utils::SynchronousProcess::locateBinary(currentPath, binary); - if (m_binaryPath.isEmpty()) { - if (ok) - *ok = false; - if (errorMessage) - *errorMessage = QCoreApplication::translate("Git::Internal::GitSettings", - "The binary '%1' could not be located in the path '%2'") - .arg(binary, currentPath); - } + QString binPath = binaryPath(); + if (binPath.isEmpty()) { + if (ok) + *ok = false; + if (errorMessage) + *errorMessage = QCoreApplication::translate("Git::Internal::GitSettings", + "The binary '%1' could not be located in the path '%2'") + .arg(stringValue(binaryPathKey), stringValue(pathKey)); } - return m_binaryPath; + return binPath; } GitSettings &GitSettings::operator = (const GitSettings &s) { VcsBaseClientSettings::operator =(s); - m_binaryPath.clear(); return *this; } |