summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Teske <daniel.teske@digia.com>2012-09-18 17:09:17 +0200
committerDaniel Teske <daniel.teske@digia.com>2012-09-19 14:44:18 +0200
commit3e9c32696836503188d3e5da50cd0d1b6c33ba9e (patch)
tree7f38bd63f78d148428b1576e349415ac499b8be5
parent05be9bbdf5dc976849642a83038d5e5a63ae4620 (diff)
downloadqt-creator-3e9c32696836503188d3e5da50cd0d1b6c33ba9e.tar.gz
Issues Pane: Fix badge number on clearing tasks of unknown type
Task-number: QTCREATORBUG-7893 Change-Id: I80870916081bc3b7464417173b74020aed40d485 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
-rw-r--r--src/plugins/projectexplorer/taskmodel.cpp7
-rw-r--r--src/plugins/projectexplorer/taskmodel.h1
-rw-r--r--src/plugins/projectexplorer/taskwindow.cpp2
3 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp
index b891df82f5..f1d27acda1 100644
--- a/src/plugins/projectexplorer/taskmodel.cpp
+++ b/src/plugins/projectexplorer/taskmodel.cpp
@@ -70,6 +70,13 @@ int TaskModel::warningTaskCount(const Core::Id &categoryId)
return m_categories.value(categoryId).warnings;
}
+int TaskModel::unknownTaskCount(const Core::Id &categoryId)
+{
+ return m_categories.value(categoryId).count
+ - m_categories.value(categoryId).errors
+ - m_categories.value(categoryId).warnings;
+}
+
bool TaskModel::hasFile(const QModelIndex &index) const
{
int row = index.row();
diff --git a/src/plugins/projectexplorer/taskmodel.h b/src/plugins/projectexplorer/taskmodel.h
index 9b74e2938f..51fc1b1a23 100644
--- a/src/plugins/projectexplorer/taskmodel.h
+++ b/src/plugins/projectexplorer/taskmodel.h
@@ -74,6 +74,7 @@ public:
int taskCount(const Core::Id &categoryId);
int errorTaskCount(const Core::Id &categoryId);
int warningTaskCount(const Core::Id &categoryId);
+ int unknownTaskCount(const Core::Id &categoryId);
bool hasFile(const QModelIndex &index) const;
diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp
index 83485a5797..2a82476375 100644
--- a/src/plugins/projectexplorer/taskwindow.cpp
+++ b/src/plugins/projectexplorer/taskwindow.cpp
@@ -341,6 +341,8 @@ void TaskWindow::clearTasks(const Core::Id &categoryId)
d->m_badgeCount -= d->m_model->errorTaskCount(categoryId);
if (d->m_filter->filterIncludesWarnings())
d->m_badgeCount -= d->m_model->warningTaskCount(categoryId);
+ if (d->m_filter->filterIncludesUnknowns())
+ d->m_badgeCount -= d->m_model->unknownTaskCount(categoryId);
} else {
d->m_badgeCount = 0;
}