Commit b0d14c79 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

VCS: Use correct output style

Change-Id: I95ea8078ae53e7339213765fbb8a79bff33f899c
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent e2aa5b53
......@@ -536,7 +536,7 @@ void BazaarPlugin::showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusIt
// Keep the file alive, else it removes self and forgets its name
saver.setAutoRemove(false);
if (!saver.finalize()) {
VcsBase::VcsBaseOutputWindow::instance()->append(saver.errorString());
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
return;
}
......
......@@ -1513,7 +1513,7 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
} else {
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
outputWindow->append(response.stdOut);
outputWindow->append(response.stdErr);
outputWindow->appendError(response.stdErr);
}
}
......
......@@ -781,7 +781,7 @@ void CvsPlugin::startCommit(const QString &workingDir, const QString &file)
}
}
if (statusOutput.empty()) {
VcsBaseOutputWindow::instance()->append(tr("There are no modified files."));
VcsBaseOutputWindow::instance()->appendWarning(tr("There are no modified files."));
return;
}
m_commitRepository = workingDir;
......
......@@ -1170,7 +1170,7 @@ void GitClient::show(const QString &source, const QString &id,
const QStringList &args, const QString &name)
{
if (!canShow(id)) {
outputWindow()->append(msgCannotShow(id));
outputWindow()->appendError(msgCannotShow(id));
return;
}
......@@ -1550,9 +1550,9 @@ bool GitClient::synchronousRevListCmd(const QString &workingDirectory, const QSt
if (errorMessage)
*errorMessage = commandOutputFromLocal8Bit(errorText);
else
outputWindow()->append(tr("Cannot execute \"git %1\" in \"%2\": %3").arg(
args.join(QLatin1String(" ")), workingDirectory,
commandOutputFromLocal8Bit(errorText)));
outputWindow()->appendError(tr("Cannot execute \"git %1\" in \"%2\": %3").arg(
args.join(QLatin1String(" ")), workingDirectory,
commandOutputFromLocal8Bit(errorText)));
return false;
}
*output = commandOutputFromLocal8Bit(outputTextData);
......@@ -1656,7 +1656,7 @@ bool GitClient::synchronousHeadRefs(const QString &workingDirectory, QStringList
if (errorMessage)
*errorMessage = message;
else
outputWindow()->append(message);
outputWindow()->appendError(message);
return false;
}
......@@ -1885,10 +1885,10 @@ QString GitClient::synchronousStash(const QString &workingDirectory, const QStri
if (unchanged)
*unchanged = true;
if (!(flags & StashIgnoreUnchanged))
outputWindow()->append(msgNoChangedFiles());
outputWindow()->appendWarning(msgNoChangedFiles());
break;
case StatusFailed:
outputWindow()->append(errorMessage);
outputWindow()->appendError(errorMessage);
break;
}
if (!success)
......@@ -1946,7 +1946,7 @@ bool GitClient::stashNameFromMessage(const QString &workingDirectory,
if (errorMessage)
*errorMessage = msg;
else
outputWindow()->append(msg);
outputWindow()->appendError(msg);
return false;
}
......@@ -2027,7 +2027,7 @@ QMap<QString,QString> GitClient::synchronousRemotesList(const QString &workingDi
if (errorMessage)
*errorMessage = error;
else
outputWindow()->append(error);
outputWindow()->appendError(error);
return result;
}
QStringList remotes = output.split(QLatin1String("\n"));
......@@ -2062,7 +2062,7 @@ QStringList GitClient::synchronousSubmoduleStatus(const QString &workingDirector
if (errorMessage)
*errorMessage = error;
else
outputWindow()->append(error);
outputWindow()->appendError(error);
return QStringList();
}
......@@ -2985,11 +2985,11 @@ void GitClient::revert(const QStringList &files, bool revertStaging)
break;
case RevertUnchanged: {
const QString msg = (isDirectory || files.size() > 1) ? msgNoChangedFiles() : tr("The file is not modified.");
outputWindow()->append(msg);
outputWindow()->appendWarning(msg);
}
break;
case RevertFailed:
outputWindow()->append(errorMessage);
outputWindow()->appendError(errorMessage);
break;
}
}
......@@ -3308,7 +3308,7 @@ bool GitClient::synchronousStashRestore(const QString &workingDirectory,
if (errorMessage)
*errorMessage = msg;
else
outputWindow()->append(msg);
outputWindow()->appendError(msg);
return false;
}
QString output = commandOutputFromLocal8Bit(outputText);
......@@ -3340,7 +3340,7 @@ bool GitClient::synchronousStashRemove(const QString &workingDirectory,
if (errorMessage)
*errorMessage = msg;
else
outputWindow()->append(msg);
outputWindow()->appendError(msg);
return false;
}
QString output = commandOutputFromLocal8Bit(outputText);
......@@ -3380,7 +3380,7 @@ bool GitClient::synchronousStashList(const QString &workingDirectory,
if (errorMessage)
*errorMessage = msg;
else
outputWindow()->append(msg);
outputWindow()->appendError(msg);
return false;
}
Stash stash;
......@@ -3510,7 +3510,7 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
if (errorMessage)
*errorMessage = msg;
else
outputWindow()->append(msg);
outputWindow()->appendError(msg);
return 0;
}
// cut 'git version 1.6.5.1.sha'
......
......@@ -969,7 +969,7 @@ void GitPlugin::startCommit(CommitType commitType)
QString errorMessage, commitTemplate;
CommitData data(commitType);
if (!m_gitClient->getCommitData(state.topLevel(), &commitTemplate, data, &errorMessage)) {
VcsBase::VcsBaseOutputWindow::instance()->append(errorMessage);
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
return;
}
......@@ -983,7 +983,7 @@ void GitPlugin::startCommit(CommitType commitType)
saver.setAutoRemove(false);
saver.write(commitTemplate.toLocal8Bit());
if (!saver.finalize()) {
VcsBase::VcsBaseOutputWindow::instance()->append(saver.errorString());
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
return;
}
m_commitMessageFileName = saver.fileName();
......@@ -1300,7 +1300,7 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file)
if (errorMessage.isEmpty())
outwin->append(tr("Patch %1 successfully applied to %2").arg(file, workingDirectory));
else
outwin->append(errorMessage);
outwin->appendError(errorMessage);
} else {
outwin->appendError(errorMessage);
}
......
......@@ -179,7 +179,7 @@ void GitSubmitEditor::updateFileModel()
setCommitData(data);
submitEditorWidget()->refreshLog(m_workingDirectory);
} else {
VcsBase::VcsBaseOutputWindow::instance()->append(errorMessage);
VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage);
m_forceClose = true;
Core::EditorManager::instance()->closeEditor(this);
}
......
......@@ -265,7 +265,8 @@ void MergeTool::done()
outputWindow->append(tr("Merge tool process finished successully."));
m_gitClient->continueCommandIfNeeded(workingDirectory);
} else {
outputWindow->append(tr("Merge tool process terminated with exit code %1").arg(exitCode));
outputWindow->appendError(tr("Merge tool process terminated with exit code %1")
.arg(exitCode));
}
GitPlugin::instance()->gitVersionControl()->emitRepositoryChanged(workingDirectory);
deleteLater();
......
......@@ -557,7 +557,7 @@ void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &s
// Keep the file alive, else it removes self and forgets its name
saver.setAutoRemove(false);
if (!saver.finalize()) {
VcsBase::VcsBaseOutputWindow::instance()->append(saver.errorString());
VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString());
return;
}
......
......@@ -1095,7 +1095,7 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
// Logging
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
if ((flags & StdErrToWindow) && !response.stdErr.isEmpty())
outputWindow->append(response.stdErr);
outputWindow->appendError(response.stdErr);
if ((flags & StdOutToWindow) && !response.stdOut.isEmpty())
outputWindow->append(response.stdOut);
return response;
......
......@@ -305,7 +305,7 @@ bool VcsBaseClient::vcsFullySynchronousExec(const QString &workingDir,
return false;
}
if (!stdErr.isEmpty())
::vcsOutputWindow()->append(QString::fromLocal8Bit(stdErr));
::vcsOutputWindow()->appendError(QString::fromLocal8Bit(stdErr));
return vcsProcess.exitStatus() == QProcess::NormalExit && vcsProcess.exitCode() == 0;
}
......
......@@ -1098,7 +1098,7 @@ bool VcsBasePlugin::runPatch(const QByteArray &input, const QString &workingDire
if (!stdOut.isEmpty())
ow->append(QString::fromLocal8Bit(stdOut));
if (!stdErr.isEmpty())
ow->append(QString::fromLocal8Bit(stdErr));
ow->appendError(QString::fromLocal8Bit(stdErr));
if (patchProcess.exitStatus() != QProcess::NormalExit) {
ow->appendError(tr("'%1' crashed.").arg(patch));
......
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