diff options
author | Daniel Teske <[email protected]> | 2015-04-20 17:13:45 +0200 |
---|---|---|
committer | Daniel Teske <[email protected]> | 2015-04-21 13:42:03 +0000 |
commit | 4f383f77b42fe6a0f7a2768b4c1103a68295ce3a (patch) | |
tree | 8fbdb53b3046be057b8c91b3dea65131997db048 /src/plugins/qmakeprojectmanager/qmakeparser.cpp | |
parent | 02068b8ef1d5dd615eb53478d01ff881cda73b74 (diff) |
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 <[email protected]>
Reviewed-by: Daniel Teske <[email protected]>
Diffstat (limited to 'src/plugins/qmakeprojectmanager/qmakeparser.cpp')
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakeparser.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakeparser.cpp b/src/plugins/qmakeprojectmanager/qmakeparser.cpp index 93423ac1ee9..c14ae2e525f 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparser.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparser.cpp @@ -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); |