Tasks: Make the linking of compile output to Tasks more robust

Clicking on error messages is supposed to jump to the editor.
And "Show Output" on the task is supposed to select the error
in the output.

The old code just registered the task for the last line of
output. This broke for every parser that allowed for
error messages that spanned multiple lines. And was obviously
also incorrect for tasks that weren't generated due to
compile output.

Fix both of those issues by giving the IOutputParsers more
control on which lines are linked to a task.

Task-number: QTCREATORBUG-14136
Change-Id: I095922c9875620dabfb7d406f6b152c8a9b25b62
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Daniel Teske
2015-04-20 17:13:45 +02:00
parent 02068b8ef1
commit 4f383f77b4
38 changed files with 168 additions and 101 deletions

View File

@@ -95,7 +95,7 @@ void JavaParser::parse(const QString &line)
file /* filename */,
lineno,
Constants::TASK_CATEGORY_COMPILE);
emit addTask(task);
emit addTask(task, 1);
return;
}

View File

@@ -71,15 +71,18 @@ void CMakeParser::stdError(const QString &line)
if (m_commonError.indexIn(trimmedLine) != -1) {
m_lastTask = Task(Task::Error, QString(), Utils::FileName::fromUserInput(m_commonError.cap(1)),
m_commonError.cap(2).toInt(), Constants::TASK_CATEGORY_BUILDSYSTEM);
m_lines = 1;
return;
} else if (m_nextSubError.indexIn(trimmedLine) != -1) {
m_lastTask = Task(Task::Error, QString(), Utils::FileName::fromUserInput(m_nextSubError.cap(1)), -1,
Constants::TASK_CATEGORY_BUILDSYSTEM);
m_lines = 1;
return;
} else if (trimmedLine.startsWith(QLatin1String(" ")) && !m_lastTask.isNull()) {
if (!m_lastTask.description.isEmpty())
m_lastTask.description.append(QLatin1Char(' '));
m_lastTask.description.append(trimmedLine.trimmed());
++m_lines;
return;
}
@@ -92,7 +95,8 @@ void CMakeParser::doFlush()
return;
Task t = m_lastTask;
m_lastTask.clear();
emit addTask(t);
emit addTask(t, m_lines, 1);
m_lines = 0;
}
#ifdef WITH_TESTS

View File

@@ -53,6 +53,7 @@ private:
QRegExp m_commonError;
QRegExp m_nextSubError;
bool m_skippedFirstEmptyLine;
int m_lines = 0;
};
} // namespace CMakeProjectManager

View File

@@ -391,7 +391,7 @@ void AbstractProcessStep::checkForCancel()
}
}
void AbstractProcessStep::taskAdded(const Task &task)
void AbstractProcessStep::taskAdded(const Task &task, int linkedOutputLines, int skipLines)
{
// Do not bother to report issues if we do not care about the results of
// the buildstep anyway:
@@ -443,7 +443,7 @@ void AbstractProcessStep::taskAdded(const Task &task)
qWarning() << "Could not find absolute location of file " << filePath;
}
}
emit addTask(editable);
emit addTask(editable, linkedOutputLines, skipLines);
}
void AbstractProcessStep::outputAdded(const QString &string, BuildStep::OutputFormat format)

View File

@@ -90,7 +90,7 @@ private slots:
void cleanUp();
void taskAdded(const Task &task);
void taskAdded(const Task &task, int linkedOutputLines = 0, int skipLines = 0);
void outputAdded(const QString &string, BuildStep::OutputFormat format);

View File

@@ -341,10 +341,10 @@ void BuildManager::showBuildResults()
//toggleTaskWindow();
}
void BuildManager::addToTaskWindow(const Task &task)
void BuildManager::addToTaskWindow(const Task &task, int linkedOutputLines, int skipLines)
{
d->m_outputWindow->registerPositionOf(task);
// Distribute to all others
d->m_outputWindow->registerPositionOf(task, linkedOutputLines, skipLines);
TaskHub::addTask(task);
}
@@ -496,8 +496,8 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps, QStringList names,
int i = 0;
for (; i < count; ++i) {
BuildStep *bs = steps.at(i);
connect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
m_instance, SLOT(addToTaskWindow(ProjectExplorer::Task)));
connect(bs, SIGNAL(addTask(ProjectExplorer::Task, int, int)),
m_instance, SLOT(addToTaskWindow(ProjectExplorer::Task, int, int)));
connect(bs, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting)),
m_instance, SLOT(addToOutputWindow(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting)));
if (bs->enabled()) {
@@ -657,8 +657,8 @@ void BuildManager::decrementActiveBuildSteps(BuildStep *bs)
void BuildManager::disconnectOutput(BuildStep *bs)
{
disconnect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
m_instance, SLOT(addToTaskWindow(ProjectExplorer::Task)));
disconnect(bs, SIGNAL(addTask(ProjectExplorer::Task, int, int)),
m_instance, SLOT(addToTaskWindow(ProjectExplorer::Task, int, int)));
disconnect(bs, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat,
ProjectExplorer::BuildStep::OutputNewlineSetting)),
m_instance, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat,

View File

@@ -86,7 +86,7 @@ signals:
void tasksCleared();
private slots:
static void addToTaskWindow(const ProjectExplorer::Task &task);
static void addToTaskWindow(const ProjectExplorer::Task &task, int linkedOutputLines, int skipLines);
static void addToOutputWindow(const QString &string, ProjectExplorer::BuildStep::OutputFormat,
ProjectExplorer::BuildStep::OutputNewlineSetting = BuildStep::DoAppendNewline);

View File

@@ -84,8 +84,13 @@ public:
enum OutputNewlineSetting { DoAppendNewline, DontAppendNewline };
signals:
void addTask(const ProjectExplorer::Task &task);
/// Adds a \p task to the Issues pane.
/// Do note that for linking compile output with tasks, you should first emit the task
/// and then emit the output. \p linkedOutput lines will be linked. And the last \p skipLines will
/// be skipped.
void addTask(const ProjectExplorer::Task &task, int linkedOutputLines = 0, int skipLines = 0);
/// Adds \p string to the compile output view, formatted in \p format
void addOutput(const QString &string, ProjectExplorer::BuildStep::OutputFormat format,
ProjectExplorer::BuildStep::OutputNewlineSetting newlineSetting = DoAppendNewline) const;

View File

@@ -257,14 +257,21 @@ bool CompileOutputWindow::canNavigate() const
return false;
}
void CompileOutputWindow::registerPositionOf(const Task &task)
void CompileOutputWindow::registerPositionOf(const Task &task, int linkedOutputLines, int skipLines)
{
int blocknumber = m_outputWindow->blockCount();
if (linkedOutputLines <= 0)
return;
int blocknumber = m_outputWindow->document()->blockCount();
if (blocknumber > MAX_LINECOUNT)
return;
m_taskPositions.insert(task.taskId, blocknumber);
m_outputWindow->addTask(task, blocknumber);
const int startLine = blocknumber - linkedOutputLines + 1 - skipLines;
const int endLine = blocknumber - skipLines;
m_taskPositions.insert(task.taskId, qMakePair(startLine, endLine));
for (int i = startLine; i <= endLine; ++i)
m_outputWindow->addTask(task, i);
}
bool CompileOutputWindow::knowsPositionOf(const Task &task)
@@ -274,10 +281,20 @@ bool CompileOutputWindow::knowsPositionOf(const Task &task)
void CompileOutputWindow::showPositionOf(const Task &task)
{
int position = m_taskPositions.value(task.taskId);
QTextCursor newCursor(m_outputWindow->document()->findBlockByNumber(position));
newCursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
QPair<int, int> position = m_taskPositions.value(task.taskId);
QTextCursor newCursor(m_outputWindow->document()->findBlockByNumber(position.second));
// Move cursor to end of last line of interest:
newCursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::MoveAnchor);
m_outputWindow->setTextCursor(newCursor);
// Move cursor and select lines:
newCursor.setPosition(m_outputWindow->document()->findBlockByNumber(position.first).position(),
QTextCursor::KeepAnchor);
m_outputWindow->setTextCursor(newCursor);
// Center cursor now:
m_outputWindow->centerCursor();
}
void CompileOutputWindow::flush()

View File

@@ -35,6 +35,7 @@
#include <coreplugin/ioutputpane.h>
#include <QHash>
#include <QPair>
QT_BEGIN_NAMESPACE
class QPlainTextEdit;
@@ -79,7 +80,7 @@ public:
void goToPrev();
bool canNavigate() const;
void registerPositionOf(const Task &task);
void registerPositionOf(const Task &task, int linkedOutputLines, int skipLines);
bool knowsPositionOf(const Task &task);
void showPositionOf(const Task &task);
@@ -90,7 +91,7 @@ private slots:
private:
CompileOutputTextEdit *m_outputWindow;
QHash<unsigned int, int> m_taskPositions;
QHash<unsigned int, QPair<int, int>> m_taskPositions;
ShowOutputTaskHandler * m_handler;
QToolButton *m_cancelBuildButton;
Utils::AnsiEscapeCodeHandler *m_escapeCodeHandler;

View File

@@ -31,6 +31,7 @@
#include "customparser.h"
#include "task.h"
#include "projectexplorerconstants.h"
#include "buildmanager.h"
#include <utils/qtcassert.h>
@@ -143,7 +144,8 @@ bool CustomParser::parseLine(const QString &rawLine)
const int lineNumber = m_errorRegExp.cap(m_lineNumberCap).toInt();
const QString message = m_errorRegExp.cap(m_messageCap);
emit addTask(Task(Task::Error, message, fileName, lineNumber, Constants::TASK_CATEGORY_COMPILE));
Task task = Task(Task::Error, message, fileName, lineNumber, Constants::TASK_CATEGORY_COMPILE);
emit addTask(task, 1);
return true;
}

View File

@@ -32,6 +32,7 @@
#include "ldparser.h"
#include "task.h"
#include "projectexplorerconstants.h"
#include "buildmanager.h"
#include <texteditor/fontsettings.h>
#include <texteditor/texteditorsettings.h>
@@ -152,6 +153,7 @@ void GccParser::newTask(const Task &task)
{
doFlush();
m_currentTask = task;
m_lines = 1;
}
void GccParser::doFlush()
@@ -160,7 +162,8 @@ void GccParser::doFlush()
return;
Task t = m_currentTask;
m_currentTask.clear();
emit addTask(t);
emit addTask(t, m_lines, 1);
m_lines = 0;
}
void GccParser::amendDescription(const QString &desc, bool monospaced)
@@ -178,6 +181,7 @@ void GccParser::amendDescription(const QString &desc, bool monospaced)
fr.format.setFontStyleHint(QFont::Monospace);
m_currentTask.formats.append(fr);
}
++m_lines;
return;
}

View File

@@ -61,6 +61,7 @@ private:
QRegularExpression m_regExpGccNames;
Task m_currentTask;
int m_lines = 0;
};
} // namespace ProjectExplorer

View File

@@ -128,7 +128,7 @@ void GnuMakeParser::stdError(const QString &line)
taskAdded(Task(res.type, res.description,
Utils::FileName::fromUserInput(match.captured(1)) /* filename */,
match.captured(4).toInt(), /* line */
Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)), 1, 0);
}
return;
}
@@ -138,9 +138,10 @@ void GnuMakeParser::stdError(const QString &line)
if (res.isFatal)
++m_fatalErrorCount;
if (!m_suppressIssues) {
taskAdded(Task(res.type, res.description,
Utils::FileName() /* filename */, -1, /* line */
Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)));
Task task = Task(res.type, res.description,
Utils::FileName() /* filename */, -1, /* line */
Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM));
taskAdded(task, 1, 0);
}
return;
}
@@ -160,7 +161,7 @@ void GnuMakeParser::removeDirectory(const QString &dir)
m_directories.removeOne(dir);
}
void GnuMakeParser::taskAdded(const Task &task)
void GnuMakeParser::taskAdded(const Task &task, int linkedLines, int skippedLines)
{
Task editable(task);
@@ -187,7 +188,7 @@ void GnuMakeParser::taskAdded(const Task &task)
// identify the file!
}
IOutputParser::taskAdded(editable);
IOutputParser::taskAdded(editable, linkedLines, skippedLines);
}
#if defined WITH_TESTS

View File

@@ -55,7 +55,7 @@ public:
bool hasFatalErrors() const;
public slots:
void taskAdded(const ProjectExplorer::Task &task);
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skippedLines);
private:
void addDirectory(const QString &dir);

View File

@@ -149,8 +149,8 @@ void IOutputParser::appendOutputParser(IOutputParser *parser)
m_parser = parser;
connect(parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)),
this, SLOT(outputAdded(QString,ProjectExplorer::BuildStep::OutputFormat)), Qt::DirectConnection);
connect(parser, SIGNAL(addTask(ProjectExplorer::Task)),
this, SLOT(taskAdded(ProjectExplorer::Task)), Qt::DirectConnection);
connect(parser, SIGNAL(addTask(ProjectExplorer::Task, int, int)),
this, SLOT(taskAdded(ProjectExplorer::Task, int, int)), Qt::DirectConnection);
}
IOutputParser *IOutputParser::takeOutputParserChain()
@@ -158,8 +158,8 @@ IOutputParser *IOutputParser::takeOutputParserChain()
IOutputParser *parser = m_parser;
disconnect(parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)),
this, SLOT(outputAdded(QString,ProjectExplorer::BuildStep::OutputFormat)));
disconnect(parser, SIGNAL(addTask(ProjectExplorer::Task)),
this, SLOT(taskAdded(ProjectExplorer::Task)));
disconnect(parser, SIGNAL(addTask(ProjectExplorer::Task, int, int)),
this, SLOT(taskAdded(ProjectExplorer::Task, int, int)));
m_parser = 0;
return parser;
}
@@ -193,9 +193,9 @@ void IOutputParser::outputAdded(const QString &string, BuildStep::OutputFormat f
emit addOutput(string, format);
}
void IOutputParser::taskAdded(const Task &task)
void IOutputParser::taskAdded(const Task &task, int linkedOutputLines, int skipLines)
{
emit addTask(task);
emit addTask(task, linkedOutputLines, skipLines);
}
void IOutputParser::doFlush()

View File

@@ -67,11 +67,11 @@ public:
signals:
void addOutput(const QString &string, ProjectExplorer::BuildStep::OutputFormat format);
void addTask(const ProjectExplorer::Task &task);
void addTask(const ProjectExplorer::Task &task, int linkedOutputLines = 0, int skipLines = 0);
public slots:
virtual void outputAdded(const QString &string, ProjectExplorer::BuildStep::OutputFormat format);
virtual void taskAdded(const ProjectExplorer::Task &task);
virtual void taskAdded(const ProjectExplorer::Task &task, int linkedOutputLines = 0, int skipLines = 0);
private:
virtual void doFlush();

View File

@@ -71,11 +71,12 @@ void LdParser::stdError(const QString &line)
}
if (lne.startsWith(QLatin1String("collect2:"))) {
emit addTask(Task(Task::Error,
lne /* description */,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Constants::TASK_CATEGORY_COMPILE));
Task task = Task(Task::Error,
lne /* description */,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Constants::TASK_CATEGORY_COMPILE);
emit addTask(task, 1);
return;
}
@@ -85,7 +86,7 @@ void LdParser::stdError(const QString &line)
Task task(Task::Warning, description,
Utils::FileName(), -1,
Constants::TASK_CATEGORY_COMPILE);
emit addTask(task);
emit addTask(task, 1);
return;
}
@@ -101,7 +102,7 @@ void LdParser::stdError(const QString &line)
}
Task task(type, description, Utils::FileName() /* filename */, -1 /* line */,
Constants::TASK_CATEGORY_COMPILE);
emit addTask(task);
emit addTask(task, 1);
return;
}
@@ -131,7 +132,7 @@ void LdParser::stdError(const QString &line)
description = description.mid(9);
}
Task task(type, description, filename, lineno, Constants::TASK_CATEGORY_COMPILE);
emit addTask(task);
emit addTask(task, 1);
return;
}

View File

@@ -90,6 +90,7 @@ void LinuxIccParser::stdError(const QString &line)
m_firstLine.cap(2).toInt(),
Constants::TASK_CATEGORY_COMPILE);
m_lines = 1;
m_expectFirstLine = false;
} else if (!m_expectFirstLine && m_caretLine.indexIn(line) != -1) {
// Format the last line as code
@@ -106,7 +107,7 @@ void LinuxIccParser::stdError(const QString &line)
m_temporary.formats.append(fr2);
} else if (!m_expectFirstLine && line.trimmed().isEmpty()) { // last Line
m_expectFirstLine = true;
emit addTask(m_temporary);
emit addTask(m_temporary, m_lines);
m_temporary = Task();
} else if (!m_expectFirstLine && m_continuationLines.indexIn(line) != -1) {
m_temporary.description.append(QLatin1Char('\n'));
@@ -114,6 +115,7 @@ void LinuxIccParser::stdError(const QString &line)
while (m_indent < line.length() && line.at(m_indent).isSpace())
m_indent++;
m_temporary.description.append(m_continuationLines.cap(1).trimmed());
++m_lines;
} else {
IOutputParser::stdError(line);
}
@@ -125,7 +127,7 @@ void LinuxIccParser::doFlush()
return;
Task t = m_temporary;
m_temporary.clear();
emit addTask(t);
emit addTask(t, m_lines, 1);
}
#ifdef WITH_TESTS

View File

@@ -58,6 +58,7 @@ private:
bool m_expectFirstLine;
int m_indent;
Task m_temporary;
int m_lines = 0;
};
} // namespace ProjectExplorer

View File

@@ -30,6 +30,7 @@
#include "msvcparser.h"
#include "projectexplorerconstants.h"
#include "buildmanager.h"
#include <utils/qtcassert.h>
#include <utils/fileutils.h>
@@ -100,6 +101,7 @@ void MsvcParser::stdOutput(const QString &line)
} else {
m_lastTask.formats[0].length = m_lastTask.description.length() - m_lastTask.formats[0].start;
}
++m_lines;
return;
}
@@ -111,6 +113,7 @@ void MsvcParser::stdOutput(const QString &line)
Utils::FileName(), /* fileName */
-1, /* linenumber */
Constants::TASK_CATEGORY_COMPILE);
m_lines = 1;
return;
}
if (line.startsWith(QLatin1String("Warning:"))) {
@@ -119,6 +122,7 @@ void MsvcParser::stdOutput(const QString &line)
Utils::FileName(), /* fileName */
-1, /* linenumber */
Constants::TASK_CATEGORY_COMPILE);
m_lines = 1;
return;
}
if (match.hasMatch()) {
@@ -130,6 +134,7 @@ void MsvcParser::stdOutput(const QString &line)
Utils::FileName::fromUserInput(match.captured(2)), /* fileName */
match.captured(3).toInt(), /* linenumber */
Constants::TASK_CATEGORY_COMPILE);
m_lines = 1;
return;
}
IOutputParser::stdOutput(line);
@@ -146,6 +151,7 @@ void MsvcParser::stdError(const QString &line)
Utils::FileName(), /* fileName */
-1, /* linenumber */
Constants::TASK_CATEGORY_COMPILE);
m_lines = 1;
return;
}
IOutputParser::stdError(line);
@@ -167,6 +173,7 @@ bool MsvcParser::processCompileLine(const QString &line)
m_lastTask = Task(type, match.captured(4).trimmed() /* description */,
position.first, position.second,
Constants::TASK_CATEGORY_COMPILE);
m_lines = 1;
return true;
}
return false;
@@ -179,7 +186,7 @@ void MsvcParser::doFlush()
Task t = m_lastTask;
m_lastTask.clear();
emit addTask(t);
emit addTask(t, m_lines, 1);
}
// Unit tests:

View File

@@ -57,6 +57,7 @@ private:
QRegularExpression m_additionalInfoRegExp;
Task m_lastTask;
int m_lines = 0;
};
} // namespace ProjectExplorer

View File

@@ -142,8 +142,10 @@ void OutputParserTester::outputAdded(const QString &line, BuildStep::OutputForma
m_receivedOutput.append(line);
}
void OutputParserTester::taskAdded(const Task &task)
void OutputParserTester::taskAdded(const Task &task, int linkedLines, int skipLines)
{
Q_UNUSED(linkedLines);
Q_UNUSED(skipLines);
m_receivedTasks.append(task);
}

View File

@@ -75,7 +75,7 @@ signals:
private slots:
void outputAdded(const QString &string, ProjectExplorer::BuildStep::OutputFormat format);
void taskAdded(const ProjectExplorer::Task &task);
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines);
private:
void reset();

View File

@@ -84,7 +84,7 @@ void XcodebuildParser::stdOutput(const QString &line)
Utils::FileName::fromString(m_replacingSignatureRe.cap(1)), /* filename */
-1, /* line */
Constants::TASK_CATEGORY_COMPILE);
taskAdded(task);
taskAdded(task, 1);
return;
}
IOutputParser::stdError(line);

View File

@@ -322,9 +322,10 @@ void QbsBuildStep::handleProcessResultReport(const qbs::ProcessResult &result)
void QbsBuildStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message,
const QString &file, int line)
{
emit addTask(ProjectExplorer::Task(type, message,
Utils::FileName::fromString(file), line,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE));
ProjectExplorer::Task task = ProjectExplorer::Task(type, message,
Utils::FileName::fromString(file), line,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE);
emit addTask(task, 1);
emit addOutput(message, NormalOutput);
}

View File

@@ -39,6 +39,7 @@
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/kit.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/target.h>
#include <utils/qtcassert.h>
@@ -211,9 +212,10 @@ void QbsCleanStep::handleProgress(int value)
void QbsCleanStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line)
{
emit addTask(ProjectExplorer::Task(type, message,
Utils::FileName::fromString(file), line,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE));
ProjectExplorer::Task task = ProjectExplorer::Task(type, message,
Utils::FileName::fromString(file), line,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE);
emit addTask(task, 1);
emit addOutput(message, NormalOutput);
}

View File

@@ -222,9 +222,10 @@ void QbsInstallStep::handleProgress(int value)
void QbsInstallStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line)
{
emit addTask(ProjectExplorer::Task(type, message,
Utils::FileName::fromString(file), line,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE));
ProjectExplorer::Task task = ProjectExplorer::Task(type, message,
Utils::FileName::fromString(file), line,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE);
emit addTask(task, 1);
emit addOutput(message, NormalOutput);
}

View File

@@ -50,7 +50,7 @@ void QbsParser::setWorkingDirectory(const QString &workingDirectory)
IOutputParser::setWorkingDirectory(workingDirectory);
}
void QbsParser::taskAdded(const ProjectExplorer::Task &task)
void QbsParser::taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines)
{
ProjectExplorer::Task editable(task);
@@ -59,7 +59,7 @@ void QbsParser::taskAdded(const ProjectExplorer::Task &task)
if (!filePath.isEmpty())
editable.file = Utils::FileName::fromUserInput(m_workingDirectory.absoluteFilePath(filePath));
IOutputParser::taskAdded(editable);
IOutputParser::taskAdded(editable, linkedLines, skipLines);
}
} // namespace Internal

View File

@@ -50,7 +50,7 @@ public:
void setWorkingDirectory(const QString &workingDirectory);
public slots:
void taskAdded(const ProjectExplorer::Task &task);
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines);
private:
QDir m_workingDirectory;

View File

@@ -32,6 +32,7 @@
#include <projectexplorer/task.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/buildmanager.h>
using namespace QmakeProjectManager;
using ProjectExplorer::Task;
@@ -47,20 +48,22 @@ void QMakeParser::stdError(const QString &line)
QString lne = rightTrimmed(line);
if (lne.startsWith(QLatin1String("Project ERROR:"))) {
const QString description = lne.mid(15);
emit addTask(Task(Task::Error,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
Task task = Task(Task::Error,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
emit addTask(task, 1);
return;
}
if (lne.startsWith(QLatin1String("Project WARNING:"))) {
const QString description = lne.mid(17);
emit addTask(Task(Task::Warning,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
Task task = Task(Task::Warning,
description,
Utils::FileName() /* filename */,
-1 /* linenumber */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
emit addTask(task, 1);
return;
}
if (m_error.indexIn(lne) > -1) {
@@ -72,11 +75,12 @@ void QMakeParser::stdError(const QString &line)
} else if (fileName.startsWith(QLatin1String("ERROR: "))) {
fileName = fileName.mid(7);
}
emit addTask(Task(type,
m_error.cap(3) /* description */,
Utils::FileName::fromUserInput(fileName),
m_error.cap(2).toInt() /* line */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)));
Task task = Task(type,
m_error.cap(3) /* description */,
Utils::FileName::fromUserInput(fileName),
m_error.cap(2).toInt() /* line */,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
emit addTask(task, 1);
return;
}
IOutputParser::stdError(line);

View File

@@ -188,9 +188,10 @@ void BlackBerryAbstractDeployStep::emitOutputInfo(const ProjectExplorer::Process
void BlackBerryAbstractDeployStep::raiseError(const QString &errorMessage)
{
ProjectExplorer::Task task = ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task, 1);
emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
}
void BlackBerryAbstractDeployStep::processReadyReadStdOutput()

View File

@@ -238,16 +238,18 @@ ProjectExplorer::BuildStepConfigWidget *BlackBerryCheckDeviceStatusStep::createC
void BlackBerryCheckDeviceStatusStep::raiseError(const QString &errorMessage)
{
ProjectExplorer::Task task = ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task, 1);
emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Error, errorMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
}
void BlackBerryCheckDeviceStatusStep::raiseWarning(const QString &warningMessage)
{
ProjectExplorer::Task task = ProjectExplorer::Task(ProjectExplorer::Task::Warning, warningMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task, 1);
emit addOutput(warningMessage, BuildStep::ErrorOutput);
emit addTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning, warningMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
}

View File

@@ -96,7 +96,7 @@ void BlackBerryProcessParser::parseErrorAndWarningMessage(const QString &line, b
Utils::FileName(),
-1,
Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM));
emit addTask(task);
emit addTask(task, 1);
}
void BlackBerryProcessParser::parseProgress(const QString &line)

View File

@@ -66,7 +66,7 @@ void QtParser::stdError(const QString &line)
Utils::FileName::fromUserInput(m_mocRegExp.cap(1)) /* filename */,
lineno,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE);
emit addTask(task);
emit addTask(task, 1);
return;
}
if (m_translationRegExp.indexIn(lne) > -1) {
@@ -77,7 +77,7 @@ void QtParser::stdError(const QString &line)
Utils::FileName::fromUserInput(m_translationRegExp.cap(3)) /* filename */,
-1,
ProjectExplorer::Constants::TASK_CATEGORY_COMPILE);
emit addTask(task);
emit addTask(task, 1);
return;
}
IOutputParser::stdError(line);

View File

@@ -170,16 +170,18 @@ void AbstractPackagingStep::setDeploymentDataModified()
void AbstractPackagingStep::raiseError(const QString &errorMessage)
{
Task task = Task(Task::Error, errorMessage, Utils::FileName(), -1,
Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task);
emit addOutput(errorMessage, BuildStep::ErrorOutput);
emit addTask(Task(Task::Error, errorMessage, Utils::FileName(), -1,
Constants::TASK_CATEGORY_DEPLOYMENT));
}
void AbstractPackagingStep::raiseWarning(const QString &warningMessage)
{
Task task = Task(Task::Warning, warningMessage, Utils::FileName(), -1,
Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task);
emit addOutput(warningMessage, ErrorMessageOutput);
emit addTask(Task(Task::Warning, warningMessage, Utils::FileName(), -1,
Constants::TASK_CATEGORY_DEPLOYMENT));
}
} // namespace RemoteLinux

View File

@@ -131,17 +131,19 @@ void AbstractRemoteLinuxDeployStep::handleProgressMessage(const QString &message
void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message)
{
ProjectExplorer::Task task = Task(Task::Error, message, Utils::FileName(), -1,
Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task, 1); // TODO correct?
emit addOutput(message, ErrorMessageOutput);
emit addTask(Task(Task::Error, message, Utils::FileName(), -1,
Constants::TASK_CATEGORY_DEPLOYMENT));
d->hasError = true;
}
void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message)
{
ProjectExplorer::Task task = Task(Task::Warning, message, Utils::FileName(), -1,
Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task, 1); // TODO correct?
emit addOutput(message, ErrorMessageOutput);
emit addTask(Task(Task::Warning, message, Utils::FileName(), -1,
Constants::TASK_CATEGORY_DEPLOYMENT));
}
void AbstractRemoteLinuxDeployStep::handleFinished()

View File

@@ -243,16 +243,18 @@ QString WinRtPackageDeploymentStep::defaultWinDeployQtArguments() const
void WinRtPackageDeploymentStep::raiseError(const QString &errorMessage)
{
ProjectExplorer::Task task = Task(Task::Error, errorMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task, 1);
emit addOutput(errorMessage, BuildStep::ErrorMessageOutput);
emit addTask(Task(Task::Error, errorMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
}
void WinRtPackageDeploymentStep::raiseWarning(const QString &warningMessage)
{
ProjectExplorer::Task task = Task(Task::Warning, warningMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT);
emit addTask(task, 1);
emit addOutput(warningMessage, BuildStep::MessageOutput);
emit addTask(Task(Task::Warning, warningMessage, Utils::FileName(), -1,
ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT));
}
bool WinRtPackageDeploymentStep::fromMap(const QVariantMap &map)