forked from qt-creator/qt-creator
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:
@@ -57,10 +57,10 @@ unsigned int Task::s_nextId = 1;
|
|||||||
|
|
||||||
Task::Task(TaskType type_, const QString &description_,
|
Task::Task(TaskType type_, const QString &description_,
|
||||||
const Utils::FileName &file_, int line_, Core::Id category_,
|
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_),
|
taskId(s_nextId), type(type_), addTextMark(addTextMark), description(description_),
|
||||||
file(file_), line(line_), movedLine(line_), category(category_),
|
file(file_), line(line_), movedLine(line_), category(category_),
|
||||||
icon(iconFile.isEmpty() ? taskTypeIcon(type_) : QIcon(iconFile.toString()))
|
icon(icon.isNull() ? taskTypeIcon(type_) : icon)
|
||||||
{
|
{
|
||||||
++s_nextId;
|
++s_nextId;
|
||||||
}
|
}
|
||||||
|
@@ -55,7 +55,7 @@ public:
|
|||||||
Task() = default;
|
Task() = default;
|
||||||
Task(TaskType type, const QString &description,
|
Task(TaskType type, const QString &description,
|
||||||
const Utils::FileName &file, int line, Core::Id category,
|
const Utils::FileName &file, int line, Core::Id category,
|
||||||
const Utils::FileName &iconName = Utils::FileName(),
|
const QIcon &icon = QIcon(),
|
||||||
bool addTextMark = true);
|
bool addTextMark = true);
|
||||||
|
|
||||||
static Task compilerMissingTask();
|
static Task compilerMissingTask();
|
||||||
|
Reference in New Issue
Block a user