aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/task.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-09-04 18:08:45 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-09-07 07:33:45 +0000
commit9c99aa223db8c9ae09c20387a82b23c03eee0e73 (patch)
tree6ab48e062583c9d69198a8efc35613f529cb7a5e /src/plugins/projectexplorer/task.cpp
parent568cd8066e7b0e92ffaddc3109bd9677dbdde979 (diff)
ProjectExplorer: Delay task icon creation
Parsers can change the initial task type when accumulating output, and then the original icon would no longer match. To the user, the problem manifested itself by a missing error symbol in the issues pane and a missing text marker in the editor. Fix this by delaying creation of the icon until it is used. Change-Id: I5349f21c6c0d9bc39a5000ceb33faf88ea62eeac Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/task.cpp')
-rw-r--r--src/plugins/projectexplorer/task.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp
index 045e461d43..3ca1b969da 100644
--- a/src/plugins/projectexplorer/task.cpp
+++ b/src/plugins/projectexplorer/task.cpp
@@ -67,7 +67,7 @@ Task::Task(TaskType type_, const QString &description,
const QIcon &icon, Options options) :
taskId(s_nextId), type(type_), options(options), summary(description),
line(line_), movedLine(line_), category(category_),
- icon(icon.isNull() ? taskTypeIcon(type_) : icon)
+ m_icon(icon)
{
++s_nextId;
setFile(file_);
@@ -108,7 +108,7 @@ void Task::clear()
line = -1;
movedLine = -1;
category = Utils::Id();
- icon = QIcon();
+ m_icon = QIcon();
formats.clear();
m_mark.clear();
}
@@ -133,6 +133,13 @@ QString Task::description() const
return desc;
}
+QIcon Task::icon() const
+{
+ if (m_icon.isNull())
+ m_icon = taskTypeIcon(type);
+ return m_icon;
+}
+
//
// functions
//