2
* Copyright (C) 2013 Canonical, Ltd.
5
* Michał Sawicz <michal.sawicz@canonical.com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25
#include "deelistmodel.h"
32
class Categories : public DeeListModel
38
Q_PROPERTY(DeeListModel* resultModel READ resultModel WRITE setResultModel NOTIFY resultModelChanged)
39
Q_PROPERTY(DeeListModel* globalResultModel READ globalResultModel WRITE setResultModel NOTIFY globalResultModelChanged)
42
explicit Categories(QObject* parent = 0);
57
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
59
QHash<int, QByteArray> roleNames() const;
62
DeeListModel* resultModel() { return m_resultModel; }
63
DeeListModel* globalResultModel() { return m_globalResultModel; }
66
void setResultModel(DeeListModel*);
67
void setGlobalResultModel(DeeListModel*);
70
void resultModelChanged(DeeListModel*);
71
void globalResultModelChanged(DeeListModel*);
74
void onCountChanged();
75
void onGlobalCountChanged();
76
void onEmitCountChanged();
79
CategoryFilter* getFilter(int index) const;
80
CategoryFilter* getGlobalFilter(int index) const;
83
QSet<CategoryFilter*> m_timerFilters;
84
QHash<int, QByteArray> m_roles;
85
DeeListModel* m_resultModel;
86
DeeListModel* m_globalResultModel;
87
mutable QMap<int, CategoryFilter*> m_filters;
88
mutable QMap<int, CategoryFilter*> m_globalFilters;
91
#endif // CATEGORIES_H