ProjectExplorer: Make Task accept a QIcon

...instead of a FileName.

If requiring a file name, one has to use Utils::Icon::imageFileName(),
which is discouraged according to the comment there. I've tried that and
ended up with a black/white icon. With Utils::Icon::icon() the icon
retains its color.

Change-Id: Id84f514f7408f4b24b74d68b4e9096ceaa0851dd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Nikolai Kosjar
2018-04-13 14:30:09 +02:00
parent a1e3360236
commit dd231fa754
2 changed files with 3 additions and 3 deletions

View File

@@ -57,10 +57,10 @@ unsigned int Task::s_nextId = 1;
Task::Task(TaskType type_, const QString &description_,
const Utils::FileName &file_, int line_, Core::Id category_,
const Utils::FileName &iconFile, bool addTextMark) :
const QIcon &icon, bool addTextMark) :
taskId(s_nextId), type(type_), addTextMark(addTextMark), description(description_),
file(file_), line(line_), movedLine(line_), category(category_),
icon(iconFile.isEmpty() ? taskTypeIcon(type_) : QIcon(iconFile.toString()))
icon(icon.isNull() ? taskTypeIcon(type_) : icon)
{
++s_nextId;
}

View File

@@ -55,7 +55,7 @@ public:
Task() = default;
Task(TaskType type, const QString &description,
const Utils::FileName &file, int line, Core::Id category,
const Utils::FileName &iconName = Utils::FileName(),
const QIcon &icon = QIcon(),
bool addTextMark = true);
static Task compilerMissingTask();