Commit 31799cc3 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Vcs: Use additional tools paths from VCS systems



Use the additional tools installed by VCS tools in the generic
Vcs settings to find patch and ssh-askpass.

Task-number: QTCREATORBUG-11637
Change-Id: Icfd297af56710861316efbe2fec1f4dc440370b2
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 28feeca1
...@@ -33,8 +33,11 @@ ...@@ -33,8 +33,11 @@
#include "ui_commonsettingspage.h" #include "ui_commonsettingspage.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/vcsmanager.h>
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <QDebug>
#include <QCoreApplication> #include <QCoreApplication>
namespace VcsBase { namespace VcsBase {
...@@ -60,6 +63,11 @@ CommonSettingsWidget::CommonSettingsWidget(QWidget *parent) : ...@@ -60,6 +63,11 @@ CommonSettingsWidget::CommonSettingsWidget(QWidget *parent) :
m_ui->patchChooser->setToolTip(patchToolTip); m_ui->patchChooser->setToolTip(patchToolTip);
m_ui->patchChooser->setExpectedKind(Utils::PathChooser::ExistingCommand); m_ui->patchChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_ui->patchChooser->setHistoryCompleter(QLatin1String("Vcs.PatchCommand.History")); m_ui->patchChooser->setHistoryCompleter(QLatin1String("Vcs.PatchCommand.History"));
updatePath();
connect(Core::VcsManager::instance(), SIGNAL(configurationChanged(const IVersionControl*)),
this, SLOT(updatePath()));
} }
CommonSettingsWidget::~CommonSettingsWidget() CommonSettingsWidget::~CommonSettingsWidget()
...@@ -105,6 +113,15 @@ QString CommonSettingsWidget::searchKeyWordMatchString() const ...@@ -105,6 +113,15 @@ QString CommonSettingsWidget::searchKeyWordMatchString() const
return rc; return rc;
} }
void CommonSettingsWidget::updatePath()
{
Utils::Environment env = Utils::Environment::systemEnvironment();
QStringList toAdd = Core::VcsManager::additionalToolsPath();
env.appendOrSetPath(toAdd.join(QString(Utils::HostOsInfo::pathListSeparator())));
m_ui->patchChooser->setEnvironment(env);
m_ui->sshPromptChooser->setEnvironment(env);
}
// --------------- VcsBaseSettingsPage // --------------- VcsBaseSettingsPage
CommonOptionsPage::CommonOptionsPage(QObject *parent) : CommonOptionsPage::CommonOptionsPage(QObject *parent) :
VcsBaseOptionsPage(parent) VcsBaseOptionsPage(parent)
......
...@@ -55,6 +55,9 @@ public: ...@@ -55,6 +55,9 @@ public:
QString searchKeyWordMatchString() const; QString searchKeyWordMatchString() const;
private slots:
void updatePath();
private: private:
Ui::CommonSettingsPage *m_ui; Ui::CommonSettingsPage *m_ui;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment