@@ -20,12 +20,10 @@
2020// self
2121#include "categories.h"
2222#include "categoryfilter.h"
23−#include <QDebug>
2423
2524Categories::Categories(QObject* parent)
2625 : DeeListModel(parent)
2726 , m_resultModel(0)
28−// , m_globalResultModel(0)
2927{
3028 // FIXME: need to clean up unused filters on countChanged
3129 m_roles[Categories::RoleId] = "id";
@@ -34,9 +32,7 @@ Categories::Categories(QObject* parent)
3432 m_roles[Categories::RoleRenderer] = "renderer";
3533 m_roles[Categories::RoleHints] = "hints";
3634 m_roles[Categories::RoleResults] = "results";
37− m_roles[Categories::RoleGlobalResults] = "globalResults";
3835 m_roles[Categories::RoleCount] = "count";
39− m_roles[Categories::RoleGlobalCount] = "globalCount";
4036
4137 // TODO This should not be needed but accumulatting the count changes
4238 // makes the visualization more stable and also makes crashes on fast
@@ -49,7 +45,6 @@ Categories::Categories(QObject* parent)
4945Categories::~Categories()
5046{
5147 qDeleteAll(m_filters);
52−// qDeleteAll(m_globalFilters);
5348}
5449
5550CategoryFilter*
@@ -67,21 +62,6 @@ Categories::getFilter(int index) const
6762 return m_filters[index];
6863}
6964
70−/*CategoryFilter*
71−Categories::getGlobalFilter(int index) const
72−{
73− if (!m_globalFilters.contains(index)) {
74− CategoryFilter* filter = new CategoryFilter();
75− connect(filter, SIGNAL(countChanged()), this, SLOT(onGlobalCountChanged()));
76− filter->setModel(m_globalResultModel);
77− filter->setIndex(index);
78−
79− m_globalFilters.insert(index, filter);
80− }
81−
82− return m_globalFilters[index];
83− }*/
84−
8565void
8666Categories::setResultModel(DeeListModel* model)
8767{
@@ -96,21 +76,6 @@ Categories::setResultModel(DeeListModel* model)
9676 }
9777}
9878
99−/*
100−void
101−Categories::setGlobalResultModel(DeeListModel* model)
102−{
103− if (model != m_globalResultModel) {
104− m_globalResultModel = model;
105−
106− Q_FOREACH(CategoryFilter* filter, m_globalFilters) {
107− filter->setModel(m_globalResultModel);
108− }
109−
110− Q_EMIT globalResultModelChanged(m_globalResultModel);
111− }
112− }*/
113−
11479void
11580Categories::onCountChanged()
11681{
@@ -133,19 +98,6 @@ Categories::onEmitCountChanged()
13398 m_timerFilters.clear();
13499}
135100
136−/*
137−void
138−Categories::onGlobalCountChanged()
139−{
140− CategoryFilter* filter = qobject_cast<CategoryFilter*>(sender());
141− if (filter) {
142− QModelIndex changedIndex = index(filter->index());
143− QVector<int> roles;
144− roles.append(Categories::RoleGlobalCount);
145− Q_EMIT dataChanged(changedIndex, changedIndex, roles);
146− }
147− }*/
148−
149101QHash<int, QByteArray>
150102Categories::roleNames() const
151103{
@@ -171,18 +123,9 @@ Categories::data(const QModelIndex& index, int role) const
171123 return QVariant::fromValue(DeeListModel::data(index, 4)); //HINTS
172124 } else if (role == RoleResults) {
173125 return QVariant::fromValue(getFilter(index.row()));
174− } else if (role == RoleGlobalResults) {
175− qWarning() << "GLOBAL RESULTS???";
176−// return QVariant::fromValue(getGlobalFilter(index.row()));
177− return QVariant();
178126 } else if (role == RoleCount) {
179127 CategoryFilter* filter = getFilter(index.row());
180128 return QVariant::fromValue(filter->rowCount());
181− } else if (role == RoleGlobalCount) {
182− qWarning() << "GLOBAL COUNT???";
183−// QSortFilterProxyModel* filter = getGlobalFilter(index.row());
184− // return QVariant::fromValue(filter->rowCount());
185− return QVariant();
186129 } else {
187130 return QVariant();
188131 }