forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.2'
Conflicts: src/plugins/git/changeselectiondialog.cpp src/plugins/git/changeselectiondialog.h src/plugins/git/gerrit/gerritplugin.cpp src/plugins/git/gitclient.cpp src/plugins/git/gitclient.h src/plugins/git/gitsettings.cpp src/plugins/git/gitsettings.h src/plugins/git/mergetool.cpp Change-Id: Icd1b2741da96395ed1b41903f453049a303e4791
This commit is contained in:
@@ -58,7 +58,7 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
|
||||
, m_command(NoCommand)
|
||||
{
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
m_gitBinaryPath = GitPlugin::instance()->gitClient()->gitBinaryPath();
|
||||
m_gitExecutable = GitPlugin::instance()->gitClient()->gitExecutable();
|
||||
m_ui->setupUi(this);
|
||||
m_ui->workingDirectoryEdit->setText(workingDirectory);
|
||||
m_gitEnvironment = GitPlugin::instance()->gitClient()->processEnvironment();
|
||||
@@ -257,7 +257,7 @@ void ChangeSelectionDialog::recalculateDetails()
|
||||
|
||||
connect(m_process, SIGNAL(finished(int)), this, SLOT(setDetails(int)));
|
||||
|
||||
m_process->start(m_gitBinaryPath.toString(), args);
|
||||
m_process->start(m_gitExecutable.toString(), args);
|
||||
m_process->closeWriteChannel();
|
||||
if (!m_process->waitForStarted())
|
||||
m_ui->detailsText->setPlainText(tr("Error: Could not start Git."));
|
||||
|
||||
@@ -89,7 +89,7 @@ private:
|
||||
Ui::ChangeSelectionDialog *m_ui;
|
||||
|
||||
QProcess *m_process;
|
||||
Utils::FileName m_gitBinaryPath;
|
||||
Utils::FileName m_gitExecutable;
|
||||
QProcessEnvironment m_gitEnvironment;
|
||||
ChangeCommand m_command;
|
||||
QStringListModel *m_changeModel;
|
||||
|
||||
@@ -119,7 +119,7 @@ VcsBase::Command *CloneWizardPage::createCheckoutJob(Utils::FileName *checkoutPa
|
||||
if (d->recursiveCheckBox->isChecked())
|
||||
args << QLatin1String("--recursive");
|
||||
args << QLatin1String("--progress") << repository() << checkoutDir;
|
||||
VcsBase::Command *command = new VcsBase::Command(client->gitBinaryPath(), workingDirectory,
|
||||
VcsBase::Command *command = new VcsBase::Command(client->gitExecutable(), workingDirectory,
|
||||
client->processEnvironment());
|
||||
command->addFlags(VcsBase::VcsBasePlugin::MergeOutputChannels);
|
||||
command->addJob(args, -1);
|
||||
|
||||
@@ -391,7 +391,7 @@ void GerritPlugin::push()
|
||||
Utils::FileName GerritPlugin::gitBinary()
|
||||
{
|
||||
bool ok;
|
||||
const Utils::FileName git = gitClient()->gitBinaryPath(&ok);
|
||||
const Utils::FileName git = gitClient()->gitExecutable(&ok);
|
||||
if (!ok) {
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendError(tr("Git is not available."));
|
||||
return Utils::FileName();
|
||||
|
||||
@@ -305,7 +305,7 @@ QProcessEnvironment GitDiffHandler::processEnvironment() const
|
||||
|
||||
Utils::FileName GitDiffHandler::gitPath() const
|
||||
{
|
||||
return m_gitClient->gitBinaryPath();
|
||||
return m_gitClient->gitExecutable();
|
||||
}
|
||||
|
||||
/////////////////////////////////////
|
||||
@@ -1753,7 +1753,7 @@ void GitClient::branchesForCommit(const QString &revision)
|
||||
DiffEditor::DiffEditorController *controller
|
||||
= qobject_cast<DiffEditor::DiffEditorController *>(sender());
|
||||
QString workingDirectory = controller->workingDirectory();
|
||||
VcsBase::Command *command = new VcsBase::Command(gitBinaryPath(), workingDirectory,
|
||||
VcsBase::Command *command = new VcsBase::Command(gitExecutable(), workingDirectory,
|
||||
processEnvironment());
|
||||
command->setCodec(getSourceCodec(currentDocumentPath()));
|
||||
|
||||
@@ -2157,7 +2157,7 @@ VcsBase::Command *GitClient::createCommand(const QString &workingDirectory,
|
||||
bool useOutputToWindow,
|
||||
int editorLineNumber)
|
||||
{
|
||||
VcsBase::Command *command = new VcsBase::Command(gitBinaryPath(), workingDirectory, processEnvironment());
|
||||
VcsBase::Command *command = new VcsBase::Command(gitExecutable(), workingDirectory, processEnvironment());
|
||||
command->setCodec(getSourceCodec(currentDocumentPath()));
|
||||
command->setCookie(QVariant(editorLineNumber));
|
||||
if (editor) {
|
||||
@@ -2254,7 +2254,7 @@ Utils::SynchronousProcessResponse GitClient::synchronousGit(const QString &worki
|
||||
unsigned flags,
|
||||
QTextCodec *outputCodec)
|
||||
{
|
||||
return VcsBasePlugin::runVcs(workingDirectory, gitBinaryPath(), gitArguments,
|
||||
return VcsBasePlugin::runVcs(workingDirectory, gitExecutable(), gitArguments,
|
||||
settings()->intValue(GitSettings::timeoutKey) * 1000,
|
||||
flags, outputCodec, processEnvironment());
|
||||
}
|
||||
@@ -2265,7 +2265,7 @@ bool GitClient::fullySynchronousGit(const QString &workingDirectory,
|
||||
QByteArray* errorText,
|
||||
unsigned flags) const
|
||||
{
|
||||
VcsBase::Command command(gitBinaryPath(), workingDirectory, processEnvironment());
|
||||
VcsBase::Command command(gitExecutable(), workingDirectory, processEnvironment());
|
||||
command.addFlags(flags);
|
||||
return command.runFullySynchronous(gitArguments,
|
||||
settings()->intValue(GitSettings::timeoutKey) * 1000,
|
||||
@@ -2545,7 +2545,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
||||
|
||||
void GitClient::launchGitK(const QString &workingDirectory, const QString &fileName)
|
||||
{
|
||||
const QFileInfo binaryInfo = gitBinaryPath().toFileInfo();
|
||||
const QFileInfo binaryInfo = gitExecutable().toFileInfo();
|
||||
QDir foundBinDir(binaryInfo.dir());
|
||||
const bool foundBinDirIsCmdDir = foundBinDir.dirName() == QLatin1String("cmd");
|
||||
QProcessEnvironment env = processEnvironment();
|
||||
@@ -2627,7 +2627,7 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
||||
|
||||
bool GitClient::launchGitGui(const QString &workingDirectory) {
|
||||
bool success;
|
||||
Utils::FileName gitBinary = gitBinaryPath(&success);
|
||||
Utils::FileName gitBinary = gitExecutable(&success);
|
||||
if (success) {
|
||||
success = QProcess::startDetached(gitBinary.toString(), QStringList(QLatin1String("gui")),
|
||||
workingDirectory);
|
||||
@@ -2641,7 +2641,7 @@ bool GitClient::launchGitGui(const QString &workingDirectory) {
|
||||
|
||||
Utils::FileName GitClient::gitBinDirectory()
|
||||
{
|
||||
const QString git = gitBinaryPath().toString();
|
||||
const QString git = gitExecutable().toString();
|
||||
if (git.isEmpty())
|
||||
return Utils::FileName();
|
||||
|
||||
@@ -2657,9 +2657,9 @@ Utils::FileName GitClient::gitBinDirectory()
|
||||
return Utils::FileName::fromString(path);
|
||||
}
|
||||
|
||||
Utils::FileName GitClient::gitBinaryPath(bool *ok, QString *errorMessage) const
|
||||
Utils::FileName GitClient::gitExecutable(bool *ok, QString *errorMessage) const
|
||||
{
|
||||
return settings()->gitBinaryPath(ok, errorMessage);
|
||||
return settings()->gitExecutable(ok, errorMessage);
|
||||
}
|
||||
|
||||
QTextCodec *GitClient::encoding(const QString &workingDirectory, const QByteArray &configVar) const
|
||||
@@ -3525,7 +3525,7 @@ GitSettings *GitClient::settings() const
|
||||
// determine version as '(major << 16) + (minor << 8) + patch' or 0.
|
||||
unsigned GitClient::gitVersion(QString *errorMessage) const
|
||||
{
|
||||
const Utils::FileName newGitBinary = gitBinaryPath();
|
||||
const Utils::FileName newGitBinary = gitExecutable();
|
||||
if (m_gitVersionForBinary != newGitBinary && !newGitBinary.isEmpty()) {
|
||||
// Do not execute repeatedly if that fails (due to git
|
||||
// not being installed) until settings are changed.
|
||||
@@ -3538,7 +3538,7 @@ unsigned GitClient::gitVersion(QString *errorMessage) const
|
||||
// determine version as '(major << 16) + (minor << 8) + patch' or 0.
|
||||
unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
|
||||
{
|
||||
if (gitBinaryPath().isEmpty())
|
||||
if (gitExecutable().isEmpty())
|
||||
return 0;
|
||||
|
||||
// run git --version
|
||||
|
||||
@@ -136,7 +136,7 @@ public:
|
||||
explicit GitClient(GitSettings *settings);
|
||||
~GitClient();
|
||||
|
||||
Utils::FileName gitBinaryPath(bool *ok = 0, QString *errorMessage = 0) const;
|
||||
Utils::FileName gitExecutable(bool *ok = 0, QString *errorMessage = 0) const;
|
||||
unsigned gitVersion(QString *errorMessage = 0) const;
|
||||
|
||||
QString findRepositoryForDirectory(const QString &dir);
|
||||
|
||||
@@ -70,7 +70,7 @@ GitSettings::GitSettings()
|
||||
declareKey(lastResetIndexKey, 0);
|
||||
}
|
||||
|
||||
Utils::FileName GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const
|
||||
Utils::FileName GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
|
||||
{
|
||||
// Locate binary in path if one is specified, otherwise default
|
||||
// to pathless binary
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
static const QLatin1String graphLogKey;
|
||||
static const QLatin1String lastResetIndexKey;
|
||||
|
||||
Utils::FileName gitBinaryPath(bool *ok = 0, QString *errorMessage = 0) const;
|
||||
Utils::FileName gitExecutable(bool *ok = 0, QString *errorMessage = 0) const;
|
||||
|
||||
GitSettings &operator = (const GitSettings &s);
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ Core::Id GitVersionControl::id() const
|
||||
bool GitVersionControl::isConfigured() const
|
||||
{
|
||||
bool ok = false;
|
||||
m_client->gitBinaryPath(&ok);
|
||||
m_client->gitExecutable(&ok);
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
|
||||
}
|
||||
m_process = new MergeToolProcess(this);
|
||||
m_process->setWorkingDirectory(workingDirectory);
|
||||
const Utils::FileName binary = m_gitClient->gitBinaryPath();
|
||||
const Utils::FileName binary = m_gitClient->gitExecutable();
|
||||
VcsBase::VcsBaseOutputWindow::instance()->appendCommand(workingDirectory, binary, arguments);
|
||||
m_process->start(binary.toString(), arguments);
|
||||
if (m_process->waitForStarted()) {
|
||||
|
||||
@@ -144,7 +144,7 @@ QVariant RemoteModel::headerData(int section, Qt::Orientation orientation, int r
|
||||
if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
|
||||
return QVariant();
|
||||
|
||||
return (section == 0) ? tr("Name") : tr("Url");
|
||||
return (section == 0) ? tr("Name") : tr("URL");
|
||||
}
|
||||
|
||||
bool RemoteModel::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
|
||||
@@ -115,7 +115,7 @@ void SettingsPage::apply()
|
||||
if (m_widget->isVisible()) {
|
||||
bool gitFoundOk;
|
||||
QString errorMessage;
|
||||
newSettings.gitBinaryPath(&gitFoundOk, &errorMessage);
|
||||
newSettings.gitExecutable(&gitFoundOk, &errorMessage);
|
||||
if (!gitFoundOk)
|
||||
QMessageBox::warning(m_widget, tr("Git Settings"), errorMessage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user