diff options
author | Friedemann Kleint <[email protected]> | 2010-08-26 13:41:33 +0200 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2010-08-26 13:45:01 +0200 |
commit | 56e800927e7255f471cb14ebc776a12d3b0f2245 (patch) | |
tree | 9bd7de9fcc8f1697146156137970da59f67131ad /src/plugins/git/settingspage.cpp | |
parent | 12feb86975e6616b50a13bee8fc4b9c5a9e1c9df (diff) |
VCS[git]: Environment settings.
Make GitClient::synchronousGit use the process environment.
Windows: Add a setting to fake a 'HOME' environment variable
(%HOMEDRIVE%%HOMEPATH%) to make msysgit look for its SSH-keys
there not only when run from git bash, but also from Qt Creator.
Useful in MinGw-setups, where git must not be in the path.
Diffstat (limited to 'src/plugins/git/settingspage.cpp')
-rw-r--r-- | src/plugins/git/settingspage.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/git/settingspage.cpp b/src/plugins/git/settingspage.cpp index 06d80bfd799..e311239092a 100644 --- a/src/plugins/git/settingspage.cpp +++ b/src/plugins/git/settingspage.cpp @@ -30,6 +30,7 @@ #include "settingspage.h" #include "gitsettings.h" #include "gitplugin.h" +#include "gitclient.h" #include <vcsbase/vcsbaseconstants.h> @@ -37,6 +38,7 @@ #include <QtCore/QFileInfo> #include <QtCore/QDebug> #include <QtCore/QTextStream> +#include <QtCore/QProcessEnvironment> #include <QtGui/QMessageBox> namespace Git { @@ -47,6 +49,19 @@ SettingsPageWidget::SettingsPageWidget(QWidget *parent) : { m_ui.setupUi(this); connect(m_ui.adoptButton, SIGNAL(clicked()), this, SLOT(setSystemPath())); +#ifdef Q_OS_WIN + const QByteArray currentHome = qgetenv("HOME"); + const QString toolTip + = tr("Set the environment variable HOME to '%1'\n(%2).\n" + "This causes msysgit to look for the SSH-keys in that location\n" + "instead of its installation directory when run outside git bash."). + arg(GitClient::fakeWinHome(QProcessEnvironment::systemEnvironment()), + currentHome.isEmpty() ? tr("not currently set") : + tr("currently set to '%1'").arg(QString::fromLocal8Bit(currentHome))); + m_ui.winHomeCheckBox->setToolTip(toolTip); +#else + m_ui.winHomeCheckBox->setVisible(false); +#endif } GitSettings SettingsPageWidget::settings() const @@ -61,6 +76,7 @@ GitSettings SettingsPageWidget::settings() const rc.omitAnnotationDate = m_ui.omitAnnotationDataCheckBox->isChecked(); rc.spaceIgnorantBlame = m_ui.spaceIgnorantBlameCheckBox->isChecked(); rc.diffPatience = m_ui.diffPatienceCheckBox->isChecked(); + rc.winSetHomeEnvironment = m_ui.winHomeCheckBox->isChecked(); rc.gitkOptions = m_ui.gitkOptionsLineEdit->text().trimmed(); return rc; } @@ -76,6 +92,7 @@ void SettingsPageWidget::setSettings(const GitSettings &s) m_ui.omitAnnotationDataCheckBox->setChecked(s.omitAnnotationDate); m_ui.spaceIgnorantBlameCheckBox->setChecked(s.spaceIgnorantBlame); m_ui.diffPatienceCheckBox->setChecked(s.diffPatience); + m_ui.winHomeCheckBox->setChecked(s.winSetHomeEnvironment); m_ui.gitkOptionsLineEdit->setText(s.gitkOptions); } |