forked from qt-creator/qt-creator
Git: Use Qt Creator as an editor for Git
Qt Creator runs Git in a "dumb" terminal which does not allow opening an editor. Use Qt Creator itself as an editor when needed. Change-Id: Ide073299964803d02479dade24ddee0283ebd83b Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
db29090b05
commit
8705862786
@@ -63,12 +63,13 @@
|
|||||||
#include <vcsbase/vcsbaseoutputwindow.h>
|
#include <vcsbase/vcsbaseoutputwindow.h>
|
||||||
#include <vcsbase/vcsbaseplugin.h>
|
#include <vcsbase/vcsbaseplugin.h>
|
||||||
|
|
||||||
#include <QRegExp>
|
#include <QCoreApplication>
|
||||||
#include <QTime>
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
#include <QRegExp>
|
||||||
#include <QSignalMapper>
|
#include <QSignalMapper>
|
||||||
|
#include <QTime>
|
||||||
|
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -401,6 +402,9 @@ GitClient::GitClient(GitSettings *settings) :
|
|||||||
{
|
{
|
||||||
QTC_CHECK(settings);
|
QTC_CHECK(settings);
|
||||||
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()), this, SLOT(saveSettings()));
|
connect(Core::ICore::instance(), SIGNAL(saveSettingsRequested()), this, SLOT(saveSettings()));
|
||||||
|
m_gitQtcEditor = QString::fromLatin1("\"%1\" -client -block -pid %2")
|
||||||
|
.arg(QCoreApplication::applicationFilePath())
|
||||||
|
.arg(QCoreApplication::applicationPid());
|
||||||
}
|
}
|
||||||
|
|
||||||
GitClient::~GitClient()
|
GitClient::~GitClient()
|
||||||
@@ -1538,6 +1542,7 @@ QProcessEnvironment GitClient::processEnvironment() const
|
|||||||
&& settings()->boolValue(GitSettings::winSetHomeEnvironmentKey)) {
|
&& settings()->boolValue(GitSettings::winSetHomeEnvironmentKey)) {
|
||||||
environment.insert(QLatin1String("HOME"), QDir::toNativeSeparators(QDir::homePath()));
|
environment.insert(QLatin1String("HOME"), QDir::toNativeSeparators(QDir::homePath()));
|
||||||
}
|
}
|
||||||
|
environment.insert(QLatin1String("GIT_EDITOR"), m_gitQtcEditor);
|
||||||
// Set up SSH and C locale (required by git using perl).
|
// Set up SSH and C locale (required by git using perl).
|
||||||
VcsBase::VcsBasePlugin::setProcessEnvironment(&environment, false);
|
VcsBase::VcsBasePlugin::setProcessEnvironment(&environment, false);
|
||||||
return environment;
|
return environment;
|
||||||
|
|||||||
@@ -341,6 +341,7 @@ private:
|
|||||||
const QString m_msgWait;
|
const QString m_msgWait;
|
||||||
QSignalMapper *m_repositoryChangedSignalMapper;
|
QSignalMapper *m_repositoryChangedSignalMapper;
|
||||||
GitSettings *m_settings;
|
GitSettings *m_settings;
|
||||||
|
QString m_gitQtcEditor;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user