aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git/settingspage.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/settingspage.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/settingspage.cpp')
-rw-r--r--src/plugins/git/settingspage.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/plugins/git/settingspage.cpp b/src/plugins/git/settingspage.cpp
index 121c7cd889b..4fdd672eac4 100644
--- a/src/plugins/git/settingspage.cpp
+++ b/src/plugins/git/settingspage.cpp
@@ -36,8 +36,10 @@
#include "gitplugin.h"
#include <QtCore/QDebug>
+#include <QtGui/QMessageBox>
-using namespace Git::Internal;
+namespace Git {
+namespace Internal {
SettingsPageWidget::SettingsPageWidget(QWidget *parent) :
QWidget(parent)
@@ -101,6 +103,17 @@ void SettingsPage::apply()
{
if (!m_widget)
return;
+ const GitSettings newSettings = m_widget->settings();
+ // Warn if git cannot be found in path if the widget is on top
+ if (m_widget->isVisible()) {
+ bool gitFoundOk;
+ QString errorMessage;
+ newSettings.gitBinaryPath(&gitFoundOk, &errorMessage);
+ if (!gitFoundOk)
+ QMessageBox::warning(m_widget, tr("Git Settings"), errorMessage);
+ }
- GitPlugin::instance()->setSettings(m_widget->settings());
+ GitPlugin::instance()->setSettings(newSettings);
+}
+}
}