diff --git a/src/plugins/projectexplorer/taskhub.cpp b/src/plugins/projectexplorer/taskhub.cpp
index 0a45e0f0900a2626b9a032e92d34645905795340..fe9b0e1d4a3e61ce4b590fc0c4c498d65e103bc8 100644
--- a/src/plugins/projectexplorer/taskhub.cpp
+++ b/src/plugins/projectexplorer/taskhub.cpp
@@ -115,8 +115,7 @@ void TaskHub::addTask(Task::TaskType type, const QString &description, Core::Id
 void TaskHub::addTask(Task task)
 {
     if (task.line != -1 && !task.file.isEmpty()) {
-        bool visible = (task.type == Task::Warning || task.type == Task::Error);
-        TaskMark *mark = new TaskMark(task.taskId, task.file.toString(), task.line, visible);
+        TaskMark *mark = new TaskMark(task.taskId, task.file.toString(), task.line, !task.icon.isNull());
         mark->setIcon(task.icon);
         mark->setPriority(TextEditor::ITextMark::LowPriority);
         task.addMark(mark);