aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/gitclient.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <[email protected]>2009-02-19 17:47:44 +0100
committerunknown <Thomas@.(none)>2009-02-19 17:47:44 +0100
commit90b094e832125b4ad441f982473c2ff26ac5cac8 (patch)
tree9a12cd00c5de5fddc476e74df14daef63dd658b5 /src/plugins/git/gitclient.cpp
parent890220d5b4bfeebdea1218ba03e0ae9e445e9359 (diff)
Make the git plugin look for the binary in the path specified in the settings. Previously, the environment was passed to the process, but that did not affect the location of the binary.
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
-rw-r--r--src/plugins/git/gitclient.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 87f06931200..a3ad3ba84ff 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -102,8 +102,10 @@ GitClient::GitClient(GitPlugin* plugin)
m_plugin(plugin),
m_core(Core::ICore::instance())
{
- if (QSettings *s = m_core->settings())
+ if (QSettings *s = m_core->settings()) {
m_settings.fromSettings(s);
+ m_binaryPath = m_settings.gitBinaryPath();
+ }
}
GitClient::~GitClient()
@@ -478,7 +480,7 @@ GitCommand *GitClient::createCommand(const QString &workingDirectory,
if (m_settings.adoptPath)
environment.set(QLatin1String("PATH"), m_settings.path);
- GitCommand* command = new GitCommand(workingDirectory, environment);
+ GitCommand* command = new GitCommand(m_binaryPath, workingDirectory, environment);
if (outputToWindow) {
if (!editor) { // assume that the commands output is the important thing
connect(command, SIGNAL(outputData(QByteArray)), this, SLOT(appendDataAndPopup(QByteArray)));
@@ -527,10 +529,9 @@ bool GitClient::synchronousGit(const QString &workingDirectory,
{
if (Git::Constants::debug)
qDebug() << "synchronousGit" << workingDirectory << arguments;
- const QString binary = QLatin1String(Constants::GIT_BINARY);
if (logCommandToWindow)
- m_plugin->outputWindow()->append(formatCommand(binary, arguments));
+ m_plugin->outputWindow()->append(formatCommand(m_binaryPath, arguments));
QProcess process;
process.setWorkingDirectory(workingDirectory);
@@ -540,7 +541,7 @@ bool GitClient::synchronousGit(const QString &workingDirectory,
environment.set(QLatin1String("PATH"), m_settings.path);
process.setEnvironment(environment.toStringList());
- process.start(binary, arguments);
+ process.start(m_binaryPath, arguments);
if (!process.waitForFinished()) {
if (errorText)
*errorText = "Error: Git timed out";
@@ -1000,6 +1001,6 @@ void GitClient::setSettings(const GitSettings &s)
m_settings = s;
if (QSettings *s = m_core->settings())
m_settings.toSettings(s);
+ m_binaryPath = m_settings.gitBinaryPath();
}
}
-