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: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Tobias Hunger
2013-11-25 11:58:32 +01:00
parent 5b92d43814
commit 9233be390b
3 changed files with 3 additions and 21 deletions

View File

@@ -30,6 +30,7 @@
#include "taskmodel.h"
#include "task.h"
#include "taskhub.h"
#include <utils/qtcassert.h>
@@ -46,8 +47,6 @@ TaskModel::TaskModel(QObject *parent) :
QAbstractItemModel(parent),
m_maxSizeOfFileName(0),
m_lastMaxSizeIndex(0),
m_errorIcon(QLatin1String(":/projectexplorer/images/compile_error.png")),
m_warningIcon(QLatin1String(":/projectexplorer/images/compile_warning.png")),
m_sizeOfLineNumber(0)
{
m_categories.insert(Core::Id(), CategoryData());
@@ -83,19 +82,6 @@ bool TaskModel::hasFile(const QModelIndex &index) const
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)
{
QTC_ASSERT(categoryId.uniqueIdentifier(), return);
@@ -269,7 +255,7 @@ QVariant TaskModel::data(const QModelIndex &index, int role) const
else if (role == TaskModel::Category)
return m_tasks.at(index.row()).category.uniqueIdentifier();
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)
return QVariant::fromValue(task(index));
return QVariant();

View File

@@ -71,8 +71,6 @@ public:
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 errorTaskCount(const Core::Id &categoryId);
int warningTaskCount(const Core::Id &categoryId);
@@ -125,8 +123,6 @@ private:
int m_maxSizeOfFileName;
int m_lastMaxSizeIndex;
QFont m_fileMeasurementFont;
const QIcon m_errorIcon;
const QIcon m_warningIcon;
int m_sizeOfLineNumber;
QFont m_lineMeasurementFont;
};

View File

@@ -261,7 +261,7 @@ TaskWindow::TaskWindow() : d(new TaskWindowPrivate)
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"),
this, SLOT(setShowWarnings(bool)));