aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/projectexplorer/task.cpp')
-rw-r--r--src/plugins/projectexplorer/task.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp
index ec0e5edd72..f101ed25b8 100644
--- a/src/plugins/projectexplorer/task.cpp
+++ b/src/plugins/projectexplorer/task.cpp
@@ -38,17 +38,16 @@
namespace ProjectExplorer
{
-static QString taskTypeIcon(Task::TaskType t)
+static QIcon taskTypeIcon(Task::TaskType t)
{
- switch (t) {
- case Task::Warning:
- return QLatin1String(Core::Constants::ICON_WARNING);
- case Task::Error:
- return QLatin1String(Core::Constants::ICON_ERROR);
- case Task::Unknown:
- break;
- }
- return QString();
+ static QIcon icons[3] = { QIcon(),
+ QIcon(QLatin1String(Core::Constants::ICON_ERROR)),
+ QIcon(QLatin1String(Core::Constants::ICON_WARNING)) };
+
+ if (t < 0 || t > 2)
+ t = Task::Unknown;
+
+ return icons[t];
}
unsigned int Task::s_nextId = 1;
@@ -67,7 +66,7 @@ Task::Task(TaskType type_, const QString &description_,
const Utils::FileName &iconFile) :
taskId(s_nextId), type(type_), description(description_),
file(file_), line(line_), movedLine(line_), category(category_),
- icon(iconFile.isEmpty() ? taskTypeIcon(type_) : iconFile.toString())
+ icon(iconFile.isEmpty() ? taskTypeIcon(type_) : QIcon(iconFile.toString()))
{
++s_nextId;
}
@@ -92,11 +91,11 @@ Task Task::buildConfigurationMissingTask()
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
}
-void Task::addMark(TextEditor::BaseTextMark *mark)
+void Task::addMark(TextEditor::TextMark *mark)
{
QTC_ASSERT(m_mark.isNull(), return);
- m_mark = QSharedPointer<TextEditor::BaseTextMark>(mark);
+ m_mark = QSharedPointer<TextEditor::TextMark>(mark);
}
bool Task::isNull() const