summaryrefslogtreecommitdiff
path: root/src/plugins/cmakeprojectmanager
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@theqtcompany.com>2015-04-20 17:13:45 +0200
committerDaniel Teske <daniel.teske@theqtcompany.com>2015-04-21 13:42:03 +0000
commit4f383f77b42fe6a0f7a2768b4c1103a68295ce3a (patch)
tree8fbdb53b3046be057b8c91b3dea65131997db048 /src/plugins/cmakeprojectmanager
parent02068b8ef1d5dd615eb53478d01ff881cda73b74 (diff)
downloadqt-creator-4f383f77b42fe6a0f7a2768b4c1103a68295ce3a.tar.gz
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>
Diffstat (limited to 'src/plugins/cmakeprojectmanager')
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeparser.cpp6
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeparser.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp
index 354fb70681..4802eef763 100644
--- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp
@@ -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
diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.h b/src/plugins/cmakeprojectmanager/cmakeparser.h
index 48148609f9..f0432b93da 100644
--- a/src/plugins/cmakeprojectmanager/cmakeparser.h
+++ b/src/plugins/cmakeprojectmanager/cmakeparser.h
@@ -53,6 +53,7 @@ private:
QRegExp m_commonError;
QRegExp m_nextSubError;
bool m_skippedFirstEmptyLine;
+ int m_lines = 0;
};
} // namespace CMakeProjectManager