Commit 9233be39 authored by Tobias Hunger's avatar Tobias Hunger

Tasks: Remove one of two methods to find the task icon

The method is in a internal class, so this does not break the build
for external plugins.

Change-Id: I9ad75e8230059d865ec7a73aa0868cb82a35b35f
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 5b92d438
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "taskmodel.h" #include "taskmodel.h"
#include "task.h" #include "task.h"
#include "taskhub.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
...@@ -46,8 +47,6 @@ TaskModel::TaskModel(QObject *parent) : ...@@ -46,8 +47,6 @@ TaskModel::TaskModel(QObject *parent) :
QAbstractItemModel(parent), QAbstractItemModel(parent),
m_maxSizeOfFileName(0), m_maxSizeOfFileName(0),
m_lastMaxSizeIndex(0), m_lastMaxSizeIndex(0),
m_errorIcon(QLatin1String(":/projectexplorer/images/compile_error.png")),
m_warningIcon(QLatin1String(":/projectexplorer/images/compile_warning.png")),
m_sizeOfLineNumber(0) m_sizeOfLineNumber(0)
{ {
m_categories.insert(Core::Id(), CategoryData()); m_categories.insert(Core::Id(), CategoryData());
...@@ -83,19 +82,6 @@ bool TaskModel::hasFile(const QModelIndex &index) const ...@@ -83,19 +82,6 @@ bool TaskModel::hasFile(const QModelIndex &index) const
return !m_tasks.at(row).file.isEmpty(); return !m_tasks.at(row).file.isEmpty();
} }
QIcon TaskModel::taskTypeIcon(Task::TaskType t) const
{
switch (t) {
case Task::Warning:
return m_warningIcon;
case Task::Error:
return m_errorIcon;
case Task::Unknown:
break;
}
return QIcon();
}
void TaskModel::addCategory(const Core::Id &categoryId, const QString &categoryName) void TaskModel::addCategory(const Core::Id &categoryId, const QString &categoryName)
{ {
QTC_ASSERT(categoryId.uniqueIdentifier(), return); QTC_ASSERT(categoryId.uniqueIdentifier(), return);
...@@ -269,7 +255,7 @@ QVariant TaskModel::data(const QModelIndex &index, int role) const ...@@ -269,7 +255,7 @@ QVariant TaskModel::data(const QModelIndex &index, int role) const
else if (role == TaskModel::Category) else if (role == TaskModel::Category)
return m_tasks.at(index.row()).category.uniqueIdentifier(); return m_tasks.at(index.row()).category.uniqueIdentifier();
else if (role == TaskModel::Icon) else if (role == TaskModel::Icon)
return taskTypeIcon(m_tasks.at(index.row()).type); return TaskHub::taskTypeIcon(m_tasks.at(index.row()).type);
else if (role == TaskModel::Task_t) else if (role == TaskModel::Task_t)
return QVariant::fromValue(task(index)); return QVariant::fromValue(task(index));
return QVariant(); return QVariant();
......
...@@ -71,8 +71,6 @@ public: ...@@ -71,8 +71,6 @@ public:
enum Roles { File = Qt::UserRole, Line, MovedLine, Description, FileNotFound, Type, Category, Icon, Task_t }; enum Roles { File = Qt::UserRole, Line, MovedLine, Description, FileNotFound, Type, Category, Icon, Task_t };
QIcon taskTypeIcon(Task::TaskType t) const;
int taskCount(const Core::Id &categoryId); int taskCount(const Core::Id &categoryId);
int errorTaskCount(const Core::Id &categoryId); int errorTaskCount(const Core::Id &categoryId);
int warningTaskCount(const Core::Id &categoryId); int warningTaskCount(const Core::Id &categoryId);
...@@ -125,8 +123,6 @@ private: ...@@ -125,8 +123,6 @@ private:
int m_maxSizeOfFileName; int m_maxSizeOfFileName;
int m_lastMaxSizeIndex; int m_lastMaxSizeIndex;
QFont m_fileMeasurementFont; QFont m_fileMeasurementFont;
const QIcon m_errorIcon;
const QIcon m_warningIcon;
int m_sizeOfLineNumber; int m_sizeOfLineNumber;
QFont m_lineMeasurementFont; QFont m_lineMeasurementFont;
}; };
......
...@@ -261,7 +261,7 @@ TaskWindow::TaskWindow() : d(new TaskWindowPrivate) ...@@ -261,7 +261,7 @@ TaskWindow::TaskWindow() : d(new TaskWindowPrivate)
d->m_listview->setContextMenuPolicy(Qt::ActionsContextMenu); d->m_listview->setContextMenuPolicy(Qt::ActionsContextMenu);
d->m_filterWarningsButton = createFilterButton(d->m_model->taskTypeIcon(Task::Warning), d->m_filterWarningsButton = createFilterButton(TaskHub::taskTypeIcon(Task::Warning),
tr("Show Warnings"), tr("Show Warnings"),
this, SLOT(setShowWarnings(bool))); this, SLOT(setShowWarnings(bool)));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment