forked from qt-creator/qt-creator
Vcs: Remove "waiting for data" when process fails
Task-number: QTCREATORBUG-7946 Change-Id: Ic3c3ceddd3b4bf115a1da78a5b5e5b640dbbd1f1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -211,8 +211,9 @@ void GitEditor::setPlainTextDataFiltered(const QByteArray &a)
|
|||||||
setPlainTextData(array);
|
setPlainTextData(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitEditor::commandFinishedGotoLine(bool ok, int /* exitCode */, const QVariant &v)
|
void GitEditor::commandFinishedGotoLine(bool ok, int exitCode, const QVariant &v)
|
||||||
{
|
{
|
||||||
|
reportCommandFinished(ok, exitCode, v);
|
||||||
if (ok && v.type() == QVariant::Int) {
|
if (ok && v.type() == QVariant::Int) {
|
||||||
const int line = v.toInt();
|
const int line = v.toInt();
|
||||||
if (line >= 0)
|
if (line >= 0)
|
||||||
|
|||||||
@@ -153,7 +153,9 @@ void VcsBaseClientPrivate::commandFinishedGotoLine(QObject *editorObject)
|
|||||||
VcsBase::VcsBaseEditorWidget *editor = qobject_cast<VcsBase::VcsBaseEditorWidget *>(editorObject);
|
VcsBase::VcsBaseEditorWidget *editor = qobject_cast<VcsBase::VcsBaseEditorWidget *>(editorObject);
|
||||||
Command *cmd = qobject_cast<Command *>(m_cmdFinishedMapper->mapping(editor));
|
Command *cmd = qobject_cast<Command *>(m_cmdFinishedMapper->mapping(editor));
|
||||||
if (editor && cmd) {
|
if (editor && cmd) {
|
||||||
if (cmd->lastExecutionSuccess() && cmd->cookie().type() == QVariant::Int) {
|
if (!cmd->lastExecutionSuccess()) {
|
||||||
|
editor->reportCommandFinished(false, cmd->lastExecutionExitCode(), cmd->cookie());
|
||||||
|
} else if (cmd->cookie().type() == QVariant::Int) {
|
||||||
const int line = cmd->cookie().toInt();
|
const int line = cmd->cookie().toInt();
|
||||||
if (line >= 0)
|
if (line >= 0)
|
||||||
editor->gotoLine(line);
|
editor->gotoLine(line);
|
||||||
|
|||||||
@@ -1177,6 +1177,15 @@ void VcsBaseEditorWidget::setPlainTextData(const QByteArray &data)
|
|||||||
setPlainText(codec()->toUnicode(data));
|
setPlainText(codec()->toUnicode(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VcsBaseEditorWidget::reportCommandFinished(bool ok, int exitCode, const QVariant &data)
|
||||||
|
{
|
||||||
|
Q_UNUSED(exitCode);
|
||||||
|
Q_UNUSED(data);
|
||||||
|
|
||||||
|
if (!ok)
|
||||||
|
setPlainText(tr("Failed to retrieve data."));
|
||||||
|
}
|
||||||
|
|
||||||
void VcsBaseEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
|
void VcsBaseEditorWidget::setFontSettings(const TextEditor::FontSettings &fs)
|
||||||
{
|
{
|
||||||
TextEditor::BaseTextEditorWidget::setFontSettings(fs);
|
TextEditor::BaseTextEditorWidget::setFontSettings(fs);
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ public slots:
|
|||||||
// Convenience slot to set data read from stdout, will use the
|
// Convenience slot to set data read from stdout, will use the
|
||||||
// documents' codec to decode
|
// documents' codec to decode
|
||||||
void setPlainTextData(const QByteArray &data);
|
void setPlainTextData(const QByteArray &data);
|
||||||
|
void reportCommandFinished(bool ok, int exitCode, const QVariant &data);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual TextEditor::BaseTextEditor *createEditor();
|
virtual TextEditor::BaseTextEditor *createEditor();
|
||||||
|
|||||||
Reference in New Issue
Block a user