Commit 71b56d2b authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Some QString -> FileName transformation

Change-Id: I4a8a8f68bb1e52750380218793ec3029b488c01f
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent f8dfa03d
......@@ -182,13 +182,13 @@ bool BuildableHelperLibrary::copyFiles(const QString &sourcePath,
// Helper: Run a build process with merged stdout/stderr
static inline bool runBuildProcessI(QProcess &proc,
const QString &binary,
const FileName &binary,
const QStringList &args,
int timeoutMS,
bool ignoreNonNullExitCode,
QString *output, QString *errorMessage)
{
proc.start(binary, args);
proc.start(binary.toString(), args);
if (!proc.waitForStarted()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
"Cannot start process: %1").
......@@ -223,7 +223,7 @@ static inline bool runBuildProcessI(QProcess &proc,
// Run a build process with merged stdout/stderr and qWarn about errors.
static bool runBuildProcess(QProcess &proc,
const QString &binary,
const FileName &binary,
const QStringList &args,
int timeoutMS,
bool ignoreNonNullExitCode,
......@@ -232,7 +232,7 @@ static bool runBuildProcess(QProcess &proc,
const bool rc = runBuildProcessI(proc, binary, args, timeoutMS, ignoreNonNullExitCode, output, errorMessage);
if (!rc) {
// Fail - reformat error.
QString cmd = binary;
QString cmd = binary.toString();
if (!args.isEmpty()) {
cmd += QLatin1Char(' ');
cmd += args.join(QString(QLatin1Char(' ')));
......@@ -262,7 +262,7 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
arguments.directory));
log->append(newline);
const QString makeFullPath = arguments.environment.searchInPath(arguments.makeCommand);
const FileName makeFullPath = arguments.environment.searchInPath(arguments.makeCommand);
if (QFileInfo(arguments.directory + QLatin1String("/Makefile")).exists()) {
if (makeFullPath.isEmpty()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary",
......@@ -271,7 +271,8 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
}
const QString cleanTarget = QLatin1String("distclean");
log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
"Running %1 %2...\n").arg(makeFullPath, cleanTarget));
"Running %1 %2...\n")
.arg(makeFullPath.toUserOutput(), cleanTarget));
if (!runBuildProcess(proc, makeFullPath, QStringList(cleanTarget), 30000, true, log, errorMessage))
return false;
}
......@@ -288,7 +289,7 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
"Running %1 %2 ...\n").arg(arguments.qmakeCommand.toUserOutput(),
qmakeArgs.join(QLatin1String(" "))));
if (!runBuildProcess(proc, arguments.qmakeCommand.toString(), qmakeArgs, 30000, false, log, errorMessage))
if (!runBuildProcess(proc, arguments.qmakeCommand, qmakeArgs, 30000, false, log, errorMessage))
return false;
log->append(newline);
if (makeFullPath.isEmpty()) {
......@@ -297,7 +298,8 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments,
return false;
}
log->append(QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
"Running %1 %2 ...\n").arg(makeFullPath, arguments.makeArguments.join(QLatin1String(" "))));
"Running %1 %2 ...\n")
.arg(makeFullPath.toUserOutput(), arguments.makeArguments.join(QLatin1String(" "))));
if (!runBuildProcess(proc, makeFullPath, arguments.makeArguments, 120000, false, log, errorMessage))
return false;
return true;
......
......@@ -372,7 +372,7 @@ QString ConsoleProcess::defaultTerminalEmulator()
const Environment env = Environment::systemEnvironment();
const int terminalCount = int(sizeof(knownTerminals) / sizeof(knownTerminals[0]));
for (int i = 0; i < terminalCount; ++i) {
QString result = env.searchInPath(QLatin1String(knownTerminals[i].binary));
QString result = env.searchInPath(QLatin1String(knownTerminals[i].binary)).toString();
if (!result.isEmpty()) {
result += QLatin1Char(' ');
result += QLatin1String(knownTerminals[i].options);
......@@ -388,7 +388,7 @@ QStringList ConsoleProcess::availableTerminalEmulators()
const Environment env = Environment::systemEnvironment();
const int terminalCount = int(sizeof(knownTerminals) / sizeof(knownTerminals[0]));
for (int i = 0; i < terminalCount; ++i) {
QString terminal = env.searchInPath(QLatin1String(knownTerminals[i].binary));
QString terminal = env.searchInPath(QLatin1String(knownTerminals[i].binary)).toString();
if (!terminal.isEmpty()) {
terminal += QLatin1Char(' ');
terminal += QLatin1String(knownTerminals[i].options);
......
......@@ -214,11 +214,11 @@ void Environment::clear()
m_values.clear();
}
QString Environment::searchInDirectory(const QStringList &execs, QString directory) const
FileName Environment::searchInDirectory(const QStringList &execs, QString directory) const
{
const QChar slash = QLatin1Char('/');
if (directory.isEmpty())
return QString();
return FileName();
// Avoid turing / into // on windows which triggers windows to check
// for network drives!
if (!directory.endsWith(slash))
......@@ -227,16 +227,16 @@ QString Environment::searchInDirectory(const QStringList &execs, QString directo
foreach (const QString &exec, execs) {
QFileInfo fi(directory + exec);
if (fi.exists() && fi.isFile() && fi.isExecutable())
return fi.absoluteFilePath();
return FileName::fromString(fi.absoluteFilePath());
}
return QString();
return FileName();
}
QString Environment::searchInPath(const QString &executable,
const QStringList &additionalDirs) const
FileName Environment::searchInPath(const QString &executable,
const QStringList &additionalDirs) const
{
if (executable.isEmpty())
return QString();
return FileName();
QString exec = QDir::cleanPath(expandVariables(executable));
QFileInfo fi(exec);
......@@ -252,7 +252,7 @@ QString Environment::searchInPath(const QString &executable,
QString tmp = executable + ext.toLower();
if (fi.isAbsolute()) {
if (QFile::exists(tmp))
return tmp;
return FileName::fromString(tmp);
} else {
execs << tmp;
}
......@@ -261,30 +261,30 @@ QString Environment::searchInPath(const QString &executable,
}
if (fi.isAbsolute())
return exec;
return FileName::fromString(exec);
QSet<QString> alreadyChecked;
foreach (const QString &dir, additionalDirs) {
if (alreadyChecked.contains(dir))
continue;
alreadyChecked.insert(dir);
QString tmp = searchInDirectory(execs, dir);
FileName tmp = searchInDirectory(execs, dir);
if (!tmp.isEmpty())
return tmp;
}
if (executable.indexOf(QLatin1Char('/')) != -1)
return QString();
return FileName();
foreach (const QString &p, path()) {
if (alreadyChecked.contains(p))
continue;
alreadyChecked.insert(p);
QString tmp = searchInDirectory(execs, QDir::fromNativeSeparators(p));
FileName tmp = searchInDirectory(execs, QDir::fromNativeSeparators(p));
if (!tmp.isEmpty())
return tmp;
}
return QString();
return FileName();
}
QStringList Environment::path() const
......
......@@ -30,6 +30,7 @@
#ifndef UTILS_ENVIRONMENT_H
#define UTILS_ENVIRONMENT_H
#include "fileutils.h"
#include "hostosinfo.h"
#include "utils_global.h"
......@@ -100,8 +101,8 @@ public:
Environment::const_iterator constEnd() const;
Environment::const_iterator constFind(const QString &name) const;
QString searchInPath(const QString &executable,
const QStringList &additionalDirs = QStringList()) const;
FileName searchInPath(const QString &executable,
const QStringList &additionalDirs = QStringList()) const;
QStringList path() const;
QString expandVariables(const QString &input) const;
......@@ -111,7 +112,7 @@ public:
bool operator==(const Environment &other) const;
private:
QString searchInDirectory(const QStringList &execs, QString directory) const;
FileName searchInDirectory(const QStringList &execs, QString directory) const;
QMap<QString, QString> m_values;
OsType m_osType;
};
......
......@@ -211,8 +211,8 @@ QString PathChooserPrivate::expandedPath(const QString &input) const
switch (m_acceptingKind) {
case PathChooser::Command:
case PathChooser::ExistingCommand: {
const QString expanded = m_environment.searchInPath(path, QStringList(m_baseDirectory));
return expanded.isEmpty() ? path : expanded;
const FileName expanded = m_environment.searchInPath(path, QStringList(m_baseDirectory));
return expanded.isEmpty() ? path : expanded.toString();
}
case PathChooser::Any:
break;
......
......@@ -1188,22 +1188,22 @@ AndroidConfigurations::AndroidConfigurations(QObject *parent)
m_instance = this;
}
Utils::FileName javaHomeForJavac(const QString &location)
static FileName javaHomeForJavac(const FileName &location)
{
QFileInfo fileInfo(location);
QFileInfo fileInfo = location.toFileInfo();
int tries = 5;
while (tries > 0) {
QDir dir = fileInfo.dir();
dir.cdUp();
if (QFileInfo(dir.filePath(QLatin1String("lib/tools.jar"))).exists())
return Utils::FileName::fromString(dir.path());
return FileName::fromString(dir.path());
if (fileInfo.isSymLink())
fileInfo.setFile(fileInfo.symLinkTarget());
else
break;
--tries;
}
return Utils::FileName();
return FileName();
}
void AndroidConfigurations::load()
......@@ -1215,10 +1215,10 @@ void AndroidConfigurations::load()
if (m_config.antLocation().isEmpty()) {
Environment env = Environment::systemEnvironment();
QString location = env.searchInPath(QLatin1String("ant"));
QFileInfo fi(location);
FileName location = env.searchInPath(QLatin1String("ant"));
QFileInfo fi = location.toFileInfo();
if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
m_config.setAntLocation(FileName::fromString(location));
m_config.setAntLocation(location);
saveSettings = true;
}
}
......@@ -1226,8 +1226,8 @@ void AndroidConfigurations::load()
if (m_config.openJDKLocation().isEmpty()) {
if (HostOsInfo::isLinuxHost()) {
Environment env = Environment::systemEnvironment();
QString location = env.searchInPath(QLatin1String("javac"));
QFileInfo fi(location);
FileName location = env.searchInPath(QLatin1String("javac"));
QFileInfo fi = location.toFileInfo();
if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
m_config.setOpenJDKLocation(javaHomeForJavac(location));
saveSettings = true;
......
......@@ -217,16 +217,16 @@ QString AndroidToolChain::makeCommand(const Utils::Environment &env) const
{
QStringList extraDirectories = AndroidConfigurations::currentConfig().makeExtraSearchDirectories();
if (HostOsInfo::isWindowsHost()) {
QString tmp = env.searchInPath(QLatin1String("ma-make.exe"), extraDirectories);
FileName tmp = env.searchInPath(QLatin1String("ma-make.exe"), extraDirectories);
if (!tmp.isEmpty())
return tmp;
return QString();
tmp = env.searchInPath(QLatin1String("mingw32-make"), extraDirectories);
return tmp.isEmpty() ? QLatin1String("mingw32-make") : tmp;
return tmp.isEmpty() ? QLatin1String("mingw32-make") : tmp.toString();
}
QString make = QLatin1String("make");
QString tmp = env.searchInPath(make, extraDirectories);
return tmp.isEmpty() ? make : tmp;
FileName tmp = env.searchInPath(make, extraDirectories);
return tmp.isEmpty() ? make : tmp.toString();
}
QString AndroidToolChain::ndkToolChainVersion() const
......
......@@ -68,10 +68,10 @@ bool BazaarControl::managesFile(const QString &workingDirectory, const QString &
bool BazaarControl::isConfigured() const
{
const QString binary = m_bazaarClient->settings()->binaryPath();
const Utils::FileName binary = m_bazaarClient->settings()->binaryPath();
if (binary.isEmpty())
return false;
QFileInfo fi(binary);
QFileInfo fi = binary.toFileInfo();
return fi.exists() && fi.isFile() && fi.isExecutable();
}
......
......@@ -1500,7 +1500,7 @@ ClearCaseResponse
}
const Utils::SynchronousProcessResponse sp_resp =
VcsBase::VcsBasePlugin::runVcs(workingDir, executable,
VcsBase::VcsBasePlugin::runVcs(workingDir, Utils::FileName::fromUserInput(executable),
arguments, timeOut,
flags, outputCodec);
......
......@@ -77,7 +77,7 @@ void ClearCaseSettings::fromSettings(QSettings *settings)
{
settings->beginGroup(QLatin1String(groupC));
ccCommand = settings->value(QLatin1String(commandKeyC), defaultCommand()).toString();
ccBinaryPath = Utils::Environment::systemEnvironment().searchInPath(ccCommand);
ccBinaryPath = Utils::Environment::systemEnvironment().searchInPath(ccCommand).toString();
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), false).toBool();
QString sDiffType = settings->value(QLatin1String(diffTypeKeyC), QLatin1String("Graphical")).toString();
......
......@@ -81,7 +81,7 @@ CMakeSettingsPage::~CMakeSettingsPage()
QString CMakeSettingsPage::findCmakeExecutable() const
{
return Utils::Environment::systemEnvironment().searchInPath(QLatin1String("cmake"));
return Utils::Environment::systemEnvironment().searchInPath(QLatin1String("cmake")).toString();
}
QWidget *CMakeSettingsPage::widget()
......
......@@ -608,9 +608,10 @@ void ExternalToolRunner::run()
connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError()));
if (!m_resolvedWorkingDirectory.isEmpty())
m_process->setWorkingDirectory(m_resolvedWorkingDirectory);
m_process->setCommand(m_resolvedExecutable, m_resolvedArguments);
MessageManager::write(
tr("Starting external tool \"%1\" %2").arg(m_resolvedExecutable, m_resolvedArguments), MessageManager::Silent);
m_process->setCommand(m_resolvedExecutable.toString(), m_resolvedArguments);
MessageManager::write(tr("Starting external tool \"%1\" %2")
.arg(m_resolvedExecutable.toUserOutput(), m_resolvedArguments),
MessageManager::Silent);
m_process->start();
}
......@@ -630,8 +631,8 @@ void ExternalToolRunner::finished(int exitCode, QProcess::ExitStatus status)
}
if (m_tool->modifiesCurrentDocument())
DocumentManager::unexpectFileChange(m_expectedFileName);
MessageManager::write(
tr("\"%1\" finished").arg(m_resolvedExecutable), MessageManager::Silent);
MessageManager::write(tr("\"%1\" finished")
.arg(m_resolvedExecutable.toUserOutput()), MessageManager::Silent);
deleteLater();
}
......
......@@ -30,6 +30,8 @@
#ifndef EXTERNALTOOL_H
#define EXTERNALTOOL_H
#include <utils/fileutils.h>
#include <QObject>
#include <QStringList>
#include <QProcess>
......@@ -139,7 +141,7 @@ private:
bool resolve();
const ExternalTool *m_tool; // is a copy of the tool that was passed in
QString m_resolvedExecutable;
Utils::FileName m_resolvedExecutable;
QString m_resolvedArguments;
QString m_resolvedInput;
QString m_resolvedWorkingDirectory;
......
......@@ -77,7 +77,7 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
{
// Mac, Windows support folder or file.
if (HostOsInfo::isWindowsHost()) {
const QString explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe"));
const FileName explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe"));
if (explorer.isEmpty()) {
QMessageBox::warning(parent,
QApplication::translate("Core::Internal",
......@@ -90,7 +90,7 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
if (!QFileInfo(pathIn).isDir())
param += QLatin1String("/select,");
param += QDir::toNativeSeparators(pathIn);
QProcess::startDetached(explorer, param);
QProcess::startDetached(explorer.toString(), param);
} else if (HostOsInfo::isMacHost()) {
QStringList scriptArgs;
scriptArgs << QLatin1String("-e")
......
......@@ -155,7 +155,7 @@ void ExecuteFilter::runHeadCommand()
{
if (!m_taskQueue.isEmpty()) {
const ExecuteData &d = m_taskQueue.head();
const QString fullPath = Utils::Environment::systemEnvironment().searchInPath(d.executable);
const Utils::FileName fullPath = Utils::Environment::systemEnvironment().searchInPath(d.executable);
if (fullPath.isEmpty()) {
MessageManager::write(tr("Could not find executable for \"%1\".").arg(d.executable));
m_taskQueue.dequeue();
......@@ -164,7 +164,7 @@ void ExecuteFilter::runHeadCommand()
}
MessageManager::write(tr("Starting command \"%1\".").arg(headCommand()));
m_process->setWorkingDirectory(d.workingDirectory);
m_process->setCommand(fullPath, d.arguments);
m_process->setCommand(fullPath.toString(), d.arguments);
m_process->start();
m_process->closeWriteChannel();
if (!m_process->waitForStarted(1000)) {
......
......@@ -80,7 +80,7 @@ VcsBase::Command *CheckoutWizard::createCommand(Utils::FileName *checkoutDir)
QTC_ASSERT(cwp, return 0);
const CvsSettings settings = CvsPlugin::instance()->settings();
const QString binary = settings.binaryPath();
const Utils::FileName binary = settings.binaryPath();
QStringList args;
const QString repository = cwp->repository();
......
......@@ -55,10 +55,10 @@ Core::Id CvsControl::id() const
bool CvsControl::isConfigured() const
{
const QString binary = m_plugin->settings().binaryPath();
const Utils::FileName binary = m_plugin->settings().binaryPath();
if (binary.isEmpty())
return false;
QFileInfo fi(binary);
QFileInfo fi = binary.toFileInfo();
return fi.exists() && fi.isFile() && fi.isExecutable();
}
......
......@@ -1125,7 +1125,7 @@ CvsResponse CvsPlugin::runCvs(const QString &workingDirectory,
unsigned flags,
QTextCodec *outputCodec) const
{
const QString executable = m_settings.binaryPath();
const Utils::FileName executable = m_settings.binaryPath();
CvsResponse response;
if (executable.isEmpty()) {
response.result = CvsResponse::OtherError;
......@@ -1154,7 +1154,7 @@ CvsResponse CvsPlugin::runCvs(const QString &workingDirectory,
}
if (response.result != CvsResponse::Ok)
response.message = sp_resp.exitMessage(executable, timeOut);
response.message = sp_resp.exitMessage(executable.toString(), timeOut);
return response;
}
......
......@@ -66,7 +66,7 @@ CvsSettings SettingsPageWidget::settings() const
void SettingsPageWidget::setSettings(const CvsSettings &s)
{
m_ui.commandPathChooser->setPath(s.binaryPath());
m_ui.commandPathChooser->setFileName(s.binaryPath());
m_ui.rootLineEdit->setText(s.stringValue(CvsSettings::cvsRootKey));
m_ui.diffOptionsLineEdit->setText(s.stringValue(CvsSettings::diffOptionsKey));
m_ui.timeOutSpinBox->setValue(s.intValue(CvsSettings::timeoutKey));
......
......@@ -257,7 +257,7 @@ void ChangeSelectionDialog::recalculateDetails()
connect(m_process, SIGNAL(finished(int)), this, SLOT(setDetails(int)));
m_process->start(m_gitBinaryPath, args);
m_process->start(m_gitBinaryPath.toString(), args);
m_process->closeWriteChannel();
if (!m_process->waitForStarted())
m_ui->detailsText->setPlainText(tr("Error: Could not start Git."));
......
......@@ -32,6 +32,8 @@
#include <coreplugin/id.h>
#include <utils/fileutils.h>
#include <QDialog>
#include <QProcessEnvironment>
......@@ -87,7 +89,7 @@ private:
Ui::ChangeSelectionDialog *m_ui;
QProcess *m_process;
QString m_gitBinaryPath;
Utils::FileName m_gitBinaryPath;
QProcessEnvironment m_gitEnvironment;
ChangeCommand m_command;
QStringListModel *m_changeModel;
......
......@@ -314,8 +314,8 @@ void QueryContext::startQuery(const QString &query)
{
QStringList arguments = m_baseArguments;
arguments.push_back(query);
VcsBase::VcsBaseOutputWindow::instance()
->appendCommand(m_process.workingDirectory(), m_binary, arguments);
VcsBase::VcsBaseOutputWindow::instance()->appendCommand(
m_process.workingDirectory(), Utils::FileName::fromString(m_binary), arguments);
m_timer.start();
m_process.start(m_binary, arguments);
m_process.closeWriteChannel();
......
......@@ -73,10 +73,10 @@ static inline QString detectSsh()
if (!ssh.isEmpty())
return ssh;
if (Utils::HostOsInfo::isWindowsHost()) { // Windows: Use ssh.exe from git if it cannot be found.
const QString git = GerritPlugin::gitBinary();
const Utils::FileName git = GerritPlugin::gitBinary();
if (!git.isEmpty()) {
// Is 'git\cmd' in the path (folder containing .bats)?
QString path = QFileInfo(git).absolutePath();
QString path = git.parentDir().toString();
if (path.endsWith(QLatin1String("cmd"), Qt::CaseInsensitive))
path.replace(path.size() - 3, 3, QLatin1String("bin"));
ssh = path + QLatin1Char('/') + QLatin1String(defaultSshC);
......
......@@ -99,7 +99,7 @@ class FetchContext : public QObject
Q_OBJECT
public:
FetchContext(const QSharedPointer<GerritChange> &change,
const QString &repository, const QString &git,
const QString &repository, const Utils::FileName &git,
const QSharedPointer<GerritParameters> &p,
FetchMode fm, QObject *parent = 0);
~FetchContext();
......@@ -129,7 +129,7 @@ private:
const QSharedPointer<GerritChange> m_change;
const QString m_repository;
const FetchMode m_fetchMode;
const QString m_git;
const Utils::FileName m_git;
const QSharedPointer<GerritParameters> m_parameters;
State m_state;
QProcess m_process;
......@@ -137,7 +137,7 @@ private:
};
FetchContext::FetchContext(const QSharedPointer<GerritChange> &change,
const QString &repository, const QString &git,
const QString &repository, const Utils::FileName &git,
const QSharedPointer<GerritParameters> &p,
FetchMode fm, QObject *parent)
: QObject(parent)
......@@ -179,18 +179,18 @@ void FetchContext::start()
// Order: initialize future before starting the process in case error handling is invoked.
const QStringList args = m_change->gitFetchArguments(m_parameters);
VcsBase::VcsBaseOutputWindow::instance()->appendCommand(m_repository, m_git, args);
m_process.start(m_git, args);
m_process.start(m_git.toString(), args);
m_process.closeWriteChannel();
}
void FetchContext::processFinished(int exitCode, QProcess::ExitStatus es)
{
if (es != QProcess::NormalExit) {
handleError(tr("%1 crashed.").arg(m_git));
handleError(tr("%1 crashed.").arg(m_git.toUserOutput()));
return;
}
if (exitCode) {
handleError(tr("%1 returned %2.").arg(m_git).arg(exitCode));
handleError(tr("%1 returned %2.").arg(m_git.toUserOutput()).arg(exitCode));
return;
}
if (m_state == FetchState) {
......@@ -235,7 +235,7 @@ void FetchContext::handleError(const QString &e)
void FetchContext::processError(QProcess::ProcessError e)
{
const QString msg = tr("Error running %1: %2").arg(m_git, m_process.errorString());
const QString msg = tr("Error running %1: %2").arg(m_git.toUserOutput(), m_process.errorString());
if (e == QProcess::FailedToStart)
handleError(msg);
else
......@@ -388,13 +388,13 @@ void GerritPlugin::push()
push(GitPlugin::instance()->currentState().topLevel());
}
QString GerritPlugin::gitBinary()
Utils::FileName GerritPlugin::gitBinary()
{
bool ok;
const QString git = gitClient()->gitBinaryPath(&ok);
const Utils::FileName git = gitClient()->gitBinaryPath(&ok);
if (!ok) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(tr("Git is not available."));
return QString();
return Utils::FileName();
}
return git;
}
......@@ -423,7 +423,7 @@ void GerritPlugin::fetchCheckout(const QSharedPointer<GerritChange> &change)
void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
{
// Locate git.
const QString git = gitBinary();
const Utils::FileName git = gitBinary();
if (git.isEmpty())
return;
......
......@@ -30,6 +30,8 @@
#ifndef GERRIT_INTERNAL_GERRITPLUGIN_H
#define GERRIT_INTERNAL_GERRITPLUGIN_H
#include <utils/fileutils.h>
#include <QObject>
#include <QPointer>
#include <QSharedPointer>
......@@ -61,7 +63,7 @@ public:
bool initialize(Core::ActionContainer *ac);
static QString gitBinary();
static Utils::FileName gitBinary();
static QString branch(const QString &repository);
void addToLocator(Core::CommandLocator *locator);
void push(const QString &topLevel);
......
......@@ -133,7 +133,7 @@ private:
void addJob(VcsBase::Command *command, const QStringList &arguments);
int timeout() const;
QProcessEnvironment processEnvironment() const;
QString gitPath() const;
Utils::FileName gitPath() const;
QPointer<DiffEditor::DiffEditorController> m_controller;
const QString m_workingDirectory;
......@@ -303,7 +303,7 @@ QProcessEnvironment GitDiffHandler::processEnvironment() const
return m_gitClient->processEnvironment();
}
QString GitDiffHandler::gitPath() const
Utils::FileName GitDiffHandler::gitPath() const
{
return m_gitClient->gitBinaryPath();
}
......@@ -2185,7 +2185,9 @@ VcsBase::Command *GitClient::executeGit(const QString &workingDirectory,
unsigned additionalFlags,
int editorLineNumber)
{
outputWindow()->appendCommand(workingDirectory, settings()->stringValue(GitSettings::binaryPathKey), arguments);