Commit 4d082cee authored by hjk's avatar hjk

VcsBase: Use static pattern for VcsBaseOutputWindow

Also rename to VcsOutputWindow.

Change-Id: I79547b1154603a8c7b3604eadc5b460930c6109c
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent aa6495a2
......@@ -30,7 +30,7 @@
#include "constants.h"
#include <vcsbase/vcsbaseplugin.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <vcsbase/vcsbaseeditorparameterwidget.h>
#include <utils/synchronousprocess.h>
......@@ -39,6 +39,8 @@
#include <QTextStream>
#include <QDebug>
using namespace VcsBase;
namespace Bazaar {
namespace Internal {
......@@ -117,7 +119,7 @@ bool BazaarClient::synchronousUncommit(const QString &workingDir,
QByteArray stdOut;
const bool success = vcsFullySynchronousExec(workingDir, args, &stdOut);
if (!stdOut.isEmpty())
VcsBase::VcsBaseOutputWindow::instance()->append(QString::fromUtf8(stdOut));
VcsOutputWindow::append(QString::fromUtf8(stdOut));
return success;
}
......
......@@ -59,7 +59,7 @@
#include <vcsbase/vcsbasesubmiteditor.h>
#include <vcsbase/vcsbaseconstants.h>
#include <vcsbase/vcsbaseeditor.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <QtPlugin>
#include <QAction>
......@@ -574,13 +574,12 @@ void BazaarPlugin::commit()
void BazaarPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &status)
{
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
//Once we receive our data release the connection so it can be reused elsewhere
disconnect(m_client, SIGNAL(parsedStatus(QList<VcsBaseClient::StatusItem>)),
this, SLOT(showCommitWidget(QList<VcsBaseClient::StatusItem>)));
if (status.isEmpty()) {
outputWindow->appendError(tr("There are no changes to commit."));
VcsOutputWindow::appendError(tr("There are no changes to commit."));
return;
}
......@@ -589,20 +588,20 @@ void BazaarPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &stat
// Keep the file alive, else it removes self and forgets its name
saver.setAutoRemove(false);
if (!saver.finalize()) {
VcsBaseOutputWindow::instance()->appendError(saver.errorString());
VcsOutputWindow::appendError(saver.errorString());
return;
}
IEditor *editor = EditorManager::openEditor(saver.fileName(), COMMIT_ID);
if (!editor) {
outputWindow->appendError(tr("Unable to create an editor for the commit."));
VcsOutputWindow::appendError(tr("Unable to create an editor for the commit."));
return;
}
CommitEditor *commitEditor = qobject_cast<CommitEditor *>(editor);
if (!commitEditor) {
outputWindow->appendError(tr("Unable to create a commit editor."));
VcsOutputWindow::appendError(tr("Unable to create a commit editor."));
return;
}
setSubmitEditor(commitEditor);
......
......@@ -67,7 +67,7 @@
#include <vcsbase/basevcssubmiteditorfactory.h>
#include <vcsbase/vcsbaseeditor.h>
#include <vcsbase/vcsbaseeditorparameterwidget.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <vcsbase/vcsbasesubmiteditor.h>
......@@ -105,6 +105,7 @@
using namespace Core;
using namespace ProjectExplorer;
using VcsBase::VcsOutputWindow;
namespace ClearCase {
namespace Internal {
......@@ -1033,8 +1034,7 @@ void ClearCasePlugin::ccDiffWithPred(const QString &workingDir, const QStringLis
return; // done here, diff is opened in a new window
}
if (!m_settings.extDiffAvailable) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(
tr("External diff is required to compare multiple files."));
VcsOutputWindow::appendError(tr("External diff is required to compare multiple files."));
return;
}
QString result;
......@@ -1106,8 +1106,7 @@ void ClearCasePlugin::diffActivity()
if (Constants::debug)
qDebug() << Q_FUNC_INFO;
if (!m_settings.extDiffAvailable) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(
tr("External diff is required to compare multiple files."));
VcsOutputWindow::appendError(tr("External diff is required to compare multiple files."));
return;
}
QString topLevel = state.topLevel();
......@@ -1238,16 +1237,15 @@ void ClearCasePlugin::startCheckIn(const QString &workingDir, const QStringList
{
if (raiseSubmitEditor())
return;
VcsBase::VcsBaseOutputWindow *outputwindow = VcsBase::VcsBaseOutputWindow::instance();
if (isCheckInEditorOpen()) {
outputwindow->appendWarning(tr("Another check in is currently being executed."));
VcsOutputWindow::appendWarning(tr("Another check in is currently being executed."));
return;
}
// Get list of added/modified/deleted files
if (files.empty()) {
outputwindow->appendWarning(tr("There are no modified files."));
VcsOutputWindow::appendWarning(tr("There are no modified files."));
return;
}
// Create a new submit change file containing the submit template
......@@ -1258,7 +1256,7 @@ void ClearCasePlugin::startCheckIn(const QString &workingDir, const QStringList
// Create a submit
saver.write(submitTemplate.toUtf8());
if (!saver.finalize()) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
VcsOutputWindow::appendError(saver.errorString());
return;
}
m_checkInMessageFileName = saver.fileName();
......@@ -1331,8 +1329,7 @@ void ClearCasePlugin::viewStatus()
if (m_viewData.name.isEmpty())
m_viewData = ccGetView(m_topLevel);
QTC_ASSERT(!m_viewData.name.isEmpty() && !m_settings.disableIndexer, return);
VcsBase::VcsBaseOutputWindow *outputwindow = VcsBase::VcsBaseOutputWindow::instance();
outputwindow->appendCommand(QLatin1String("Indexed files status (C=Checked Out, "
VcsBase::VcsOutputWindow::appendCommand(QLatin1String("Indexed files status (C=Checked Out, "
"H=Hijacked, ?=Missing)"));
bool anymod = false;
for (StatusMap::ConstIterator it = m_statusMap->constBegin();
......@@ -1347,14 +1344,14 @@ void ClearCasePlugin::viewStatus()
default: break;
}
if (cstat) {
outputwindow->append(QString::fromLatin1("%1 %2\n")
VcsOutputWindow::append(QString::fromLatin1("%1 %2\n")
.arg(cstat)
.arg(QDir::toNativeSeparators(it.key())));
anymod = true;
}
}
if (!anymod)
outputwindow->appendWarning(QLatin1String("No modified files found."));
VcsOutputWindow::appendWarning(QLatin1String("No modified files found."));
}
void ClearCasePlugin::ccUpdate(const QString &workingDir, const QStringList &relativePaths)
......@@ -1637,9 +1634,8 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
ShowStdOutInLogWindow | FullySynchronously);
}
} else {
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
outputWindow->append(response.stdOut);
outputWindow->appendError(response.stdErr);
VcsOutputWindow::append(response.stdOut);
VcsOutputWindow::appendError(response.stdErr);
}
}
......
......@@ -40,7 +40,7 @@
#include <vcsbase/vcsbaseconstants.h>
#include <vcsbase/vcsbaseeditor.h>
#include <vcsbase/basevcssubmiteditorfactory.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <vcsbase/vcsbaseeditorparameterwidget.h>
#include <utils/synchronousprocess.h>
#include <utils/parameteraction.h>
......@@ -673,7 +673,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
if (raiseSubmitEditor())
return;
if (isCommitEditorOpen()) {
VcsBaseOutputWindow::instance()->appendWarning(tr("Another commit is currently being executed."));
VcsOutputWindow::appendWarning(tr("Another commit is currently being executed."));
return;
}
......@@ -696,7 +696,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
}
}
if (statusOutput.empty()) {
VcsBaseOutputWindow::instance()->appendWarning(tr("There are no modified files."));
VcsOutputWindow::appendWarning(tr("There are no modified files."));
return;
}
m_commitRepository = workingDir;
......@@ -709,7 +709,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
// Create a submit
saver.write(submitTemplate.toUtf8());
if (!saver.finalize()) {
VcsBaseOutputWindow::instance()->appendError(saver.errorString());
VcsOutputWindow::appendError(saver.errorString());
return;
}
m_commitMessageFileName = saver.fileName();
......@@ -983,7 +983,7 @@ void CvsPlugin::slotDescribe(const QString &source, const QString &changeNr)
{
QString errorMessage;
if (!describe(source, changeNr, &errorMessage))
VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
}
bool CvsPlugin::describe(const QString &file, const QString &changeNr, QString *errorMessage)
......
......@@ -39,7 +39,7 @@
#include <utils/qtcassert.h>
#include <utils/execmenu.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <coreplugin/documentmanager.h>
#include <QAction>
......@@ -50,6 +50,8 @@
#include <QDebug>
using namespace VcsBase;
namespace Git {
namespace Internal {
......@@ -99,7 +101,7 @@ void BranchDialog::refresh(const QString &repository, bool force)
m_ui->repositoryLabel->setText(StashDialog::msgRepositoryLabel(m_repository));
QString errorMessage;
if (!m_model->refresh(m_repository, &errorMessage))
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
m_ui->branchView->expandAll();
}
......
......@@ -31,11 +31,13 @@
#include "gitclient.h"
#include <utils/qtcassert.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <vcsbase/vcsbaseplugin.h>
#include <QFont>
using namespace VcsBase;
namespace Git {
namespace Internal {
......@@ -310,7 +312,7 @@ bool BranchModel::setData(const QModelIndex &index, const QVariant &value, int r
<< newFullName.last(),
&output, &errorMessage)) {
node->name = oldFullName.last();
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
return false;
}
......@@ -354,7 +356,7 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage
args << QLatin1String("--format=%(objectname)\t%(refname)\t%(upstream:short)\t%(*objectname)");
QString output;
if (!m_client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage))
VcsBase::VcsBaseOutputWindow::instance()->appendError(*errorMessage);
VcsOutputWindow::appendError(*errorMessage);
m_workingDirectory = workingDirectory;
const QStringList lines = output.split(QLatin1Char('\n'));
......@@ -393,7 +395,7 @@ void BranchModel::renameBranch(const QString &oldName, const QString &newName)
if (!m_client->synchronousBranchCmd(m_workingDirectory,
QStringList() << QLatin1String("-m") << oldName << newName,
&output, &errorMessage))
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
else
refresh(m_workingDirectory, &errorMessage);
}
......@@ -407,7 +409,7 @@ void BranchModel::renameTag(const QString &oldName, const QString &newName)
|| !m_client->synchronousTagCmd(m_workingDirectory,
QStringList() << QLatin1String("-d") << oldName,
&output, &errorMessage)) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
} else {
refresh(m_workingDirectory, &errorMessage);
}
......@@ -497,7 +499,7 @@ void BranchModel::removeBranch(const QModelIndex &idx)
args << QLatin1String("-D") << branch;
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
return;
}
removeNode(idx);
......@@ -515,7 +517,7 @@ void BranchModel::removeTag(const QModelIndex &idx)
args << QLatin1String("-d") << tag;
if (!m_client->synchronousTagCmd(m_workingDirectory, args, &output, &errorMessage)) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
return;
}
removeNode(idx);
......@@ -544,7 +546,7 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx)
args << QLatin1String("-a") << QLatin1String("--contains") << sha(idx);
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage))
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
QStringList lines = output.split(QLatin1Char('\n'), QString::SkipEmptyParts);
foreach (const QString &l, lines) {
......@@ -589,7 +591,7 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel
}
if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
return QModelIndex();
}
......
......@@ -34,7 +34,7 @@
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/progressmanager/futureprogress.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <utils/synchronousprocess.h>
#include <QStringList>
......@@ -59,6 +59,8 @@
enum { debug = 0 };
using namespace VcsBase;
namespace Gerrit {
namespace Internal {
......@@ -314,7 +316,7 @@ void QueryContext::startQuery(const QString &query)
{
QStringList arguments = m_baseArguments;
arguments.push_back(query);
VcsBase::VcsBaseOutputWindow::instance()->appendCommand(
VcsBase::VcsOutputWindow::appendCommand(
m_process.workingDirectory(), Utils::FileName::fromString(m_binary), arguments);
m_timer.start();
m_process.start(m_binary, arguments);
......@@ -325,7 +327,7 @@ void QueryContext::errorTermination(const QString &msg)
{
m_progress.reportCanceled();
m_progress.reportFinished();
VcsBase::VcsBaseOutputWindow::instance()->appendError(msg);
VcsBase::VcsOutputWindow::appendError(msg);
emit finished();
}
......@@ -335,7 +337,7 @@ void QueryContext::processError(QProcess::ProcessError e)
if (e == QProcess::FailedToStart)
errorTermination(msg);
else
VcsBase::VcsBaseOutputWindow::instance()->appendError(msg);
VcsBase::VcsOutputWindow::appendError(msg);
}
void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
......@@ -363,7 +365,7 @@ void QueryContext::processFinished(int exitCode, QProcess::ExitStatus es)
void QueryContext::readyReadStandardError()
{
VcsBase::VcsBaseOutputWindow::instance()->appendError(QString::fromLocal8Bit(m_process.readAllStandardError()));
VcsBase::VcsOutputWindow::appendError(QString::fromLocal8Bit(m_process.readAllStandardError()));
}
void QueryContext::readyReadStandardOutput()
......@@ -601,7 +603,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> &parameters,
.arg(QString::fromLocal8Bit(line))
.arg(error.errorString());
qWarning() << errorMessage;
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsBase::VcsOutputWindow::appendError(errorMessage);
res = false;
continue;
}
......@@ -649,8 +651,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> &parameters,
result.push_back(change);
} else {
qWarning("%s: Parse error: '%s'.", Q_FUNC_INFO, line.constData());
VcsBase::VcsBaseOutputWindow::instance()
->appendError(GerritModel::tr("Parse error: \"%1\"")
VcsOutputWindow::appendError(GerritModel::tr("Parse error: \"%1\"")
.arg(QString::fromLocal8Bit(line)));
res = false;
}
......@@ -747,7 +748,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> &parameters,
QString errorMessage = GerritModel::tr("Parse error: \"%1\"")
.arg(QString::fromLocal8Bit(line));
qWarning() << errorMessage;
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsBase::VcsOutputWindow::appendError(errorMessage);
res = false;
continue;
}
......@@ -817,7 +818,7 @@ static bool parseOutput(const QSharedPointer<GerritParameters> &parameters,
} else {
QString errorMessage = GerritModel::tr("Parse error in line \"%1\"")
.arg(QString::fromLocal8Bit(line));
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
VcsBase::VcsOutputWindow::appendError(errorMessage);
qWarning("%s: Parse error in line '%s'.", Q_FUNC_INFO, line.constData());
res = false;
}
......
......@@ -53,7 +53,7 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/locator/commandlocator.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <utils/synchronousprocess.h>
......@@ -178,7 +178,7 @@ void FetchContext::start()
m_progress.reportStarted();
// 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);
VcsBase::VcsOutputWindow::appendCommand(m_repository, m_git, args);
m_process.start(m_git.toString(), args);
m_process.closeWriteChannel();
}
......@@ -213,21 +213,21 @@ void FetchContext::processReadyReadStandardError()
// Note: fetch displays progress on stderr.
const QString errorOutput = QString::fromLocal8Bit(m_process.readAllStandardError());
if (m_state == FetchState)
VcsBase::VcsBaseOutputWindow::instance()->append(errorOutput);
VcsBase::VcsOutputWindow::append(errorOutput);
else
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorOutput);
VcsBase::VcsOutputWindow::appendError(errorOutput);
}
void FetchContext::processReadyReadStandardOutput()
{
const QByteArray output = m_process.readAllStandardOutput();
VcsBase::VcsBaseOutputWindow::instance()->append(QString::fromLocal8Bit(output));
VcsBase::VcsOutputWindow::append(QString::fromLocal8Bit(output));
}
void FetchContext::handleError(const QString &e)
{
m_state = ErrorState;
VcsBase::VcsBaseOutputWindow::instance()->appendError(e);
VcsBase::VcsOutputWindow::appendError(e);
m_progress.reportCanceled();
m_progress.reportFinished();
deleteLater();
......@@ -239,7 +239,7 @@ void FetchContext::processError(QProcess::ProcessError e)
if (e == QProcess::FailedToStart)
handleError(msg);
else
VcsBase::VcsBaseOutputWindow::instance()->appendError(msg);
VcsBase::VcsOutputWindow::appendError(msg);
}
void FetchContext::show()
......@@ -252,7 +252,7 @@ void FetchContext::show()
void FetchContext::cherryPick()
{
// Point user to errors.
VcsBase::VcsBaseOutputWindow::instance()->popup(IOutputPane::ModeSwitch
VcsBase::VcsOutputWindow::instance()->popup(IOutputPane::ModeSwitch
| IOutputPane::WithFocus);
gitClient()->synchronousCherryPick(m_repository, QLatin1String("FETCH_HEAD"));
}
......@@ -394,7 +394,7 @@ Utils::FileName GerritPlugin::gitBinary()
bool ok;
const Utils::FileName git = gitClient()->gitExecutable(&ok);
if (!ok) {
VcsBase::VcsBaseOutputWindow::instance()->appendError(tr("Git is not available."));
VcsBase::VcsOutputWindow::appendError(tr("Git is not available."));
return Utils::FileName();
}
return git;
......
......@@ -56,7 +56,7 @@
#include <vcsbase/command.h>
#include <vcsbase/vcsbaseeditor.h>
#include <vcsbase/vcsbaseeditorparameterwidget.h>
#include <vcsbase/vcsbaseoutputwindow.h>
#include <vcsbase/vcsoutputwindow.h>
#include <vcsbase/vcsbaseplugin.h>
#include <diffeditor/diffeditorconstants.h>
......@@ -87,6 +87,7 @@ static const char noColorOption[] = "--no-color";
static const char decorateOption[] = "--decorate";
using namespace Core;
using namespace VcsBase;
namespace Git {
namespace Internal {
......@@ -682,11 +683,6 @@ static inline QStringList commandOutputLinesFromLocal8Bit(const QByteArray &a)
return output.split(newLine);
}
static inline VcsBase::VcsBaseOutputWindow *outputWindow()
{
return VcsBase::VcsBaseOutputWindow::instance();
}
static inline QString msgRepositoryNotFound(const QString &dir)
{
return GitClient::tr("Cannot determine the repository for \"%1\".").arg(dir);
......@@ -720,7 +716,7 @@ static inline void msgCannotRun(const QString &message, QString *errorMessage)
if (errorMessage)
*errorMessage = message;
else
outputWindow()->appendError(message);
VcsOutputWindow::appendError(message);
}
static inline void msgCannotRun(const QStringList &args, const QString &workingDirectory,
......@@ -908,8 +904,6 @@ void GitClient::slotUnstageChunk()
void GitClient::stage(const QString &patch, bool revert)
{
VcsBase::VcsBaseOutputWindow *outwin =
VcsBase::VcsBaseOutputWindow::instance();
QTemporaryFile patchFile;
if (!patchFile.open())
return;
......@@ -929,15 +923,15 @@ void GitClient::stage(const QString &patch, bool revert)
&errorMessage, args)) {
if (errorMessage.isEmpty()) {
if (revert)
outwin->append(tr("Chunk successfully unstaged"));
VcsOutputWindow::append(tr("Chunk successfully unstaged"));
else
outwin->append(tr("Chunk successfully staged"));
VcsOutputWindow::append(tr("Chunk successfully staged"));
} else {
outwin->append(errorMessage);
VcsOutputWindow::append(errorMessage);
}
m_contextController->requestReload();
} else {
outwin->appendError(errorMessage);
VcsOutputWindow::appendError(errorMessage);
}
}
......@@ -1090,10 +1084,9 @@ void GitClient::status(const QString &workingDirectory)
{
QStringList statusArgs = statusArguments();
statusArgs << QLatin1String("-u");
VcsBase::VcsBaseOutputWindow *outwin = outputWindow();
outwin->setRepository(workingDirectory);
VcsOutputWindow::setRepository(workingDirectory);
VcsBase::Command *command = executeGit(workingDirectory, statusArgs, 0, true);
connect(command, SIGNAL(finished(bool,int,QVariant)), outwin, SLOT(clearRepository()),
connect(command, SIGNAL(finished(bool,int,QVariant)), VcsOutputWindow::instance(), SLOT(clearRepository()),
Qt::QueuedConnection);
}
......@@ -1174,7 +1167,7 @@ static inline QString msgCannotShow(const QString &sha)
void GitClient::show(const QString &source, const QString &id, const QString &name)
{
if (!canShow(id)) {
outputWindow()->appendError(msgCannotShow(id));
VcsOutputWindow::appendError(msgCannotShow(id));
return;
}
......@@ -1272,7 +1265,7 @@ bool GitClient::synchronousCheckout(const QString &workingDirectory,
QStringList arguments = setupCheckoutArguments(workingDirectory, ref);
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText,
VcsBasePlugin::ExpectRepoChanges);
outputWindow()->append(commandOutputFromLocal8Bit(outputText));
VcsOutputWindow::append(commandOutputFromLocal8Bit(outputText));
if (!rc) {
msgCannotRun(arguments, workingDirectory, errorText, errorMessage);
return false;
......@@ -1453,7 +1446,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
arguments << QLatin1String(HEAD) << QLatin1String("--") << files;
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
const QString output = commandOutputFromLocal8Bit(outputText);
outputWindow()->append(output);
VcsOutputWindow::append(output);
// Note that git exits with 1 even if the operation is successful
// Assume real failure if the output does not contain "foo.cpp modified"
// or "Unstaged changes after reset" (git 1.7.0).
......@@ -1480,9 +1473,9 @@ bool GitClient::synchronousInit(const QString &workingDirectory)
const QStringList arguments(QLatin1String("init"));
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
// '[Re]Initialized...'
outputWindow()->append(commandOutputFromLocal8Bit(outputText));
VcsOutputWindow::append(commandOutputFromLocal8Bit(outputText));
if (!rc) {
outputWindow()->appendError(commandOutputFromLocal8Bit(errorText));
VcsOutputWindow::appendError(commandOutputFromLocal8Bit(errorText));
} else {
// TODO: Turn this into a VcsBaseClient and use resetCachedVcsInfo(...)
VcsManager::resetVersionControlForDirectory(workingDirectory);
......@@ -1849,8 +1842,7 @@ QString GitClient::synchronousShortDescription(const QString &workingDirectory,
<< QLatin1String("--max-count=1") << revision;
const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputTextData, &errorText);
if (!rc) {