blob: 59959d48ceaa4e010a3f56660e9f50f1cd42a7fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#ifndef FAVORITESMODEL_H
#define FAVORITESMODEL_H
#include <QtCore/QAbstractListModel>
class FavoritesModel : public QAbstractListModel
{
Q_OBJECT
public:
explicit FavoritesModel(QObject *parent = 0);
enum DataRoles {
NameRole = Qt::DisplayRole,
LogoRole = Qt::DecorationRole,
BoardUrlRole = Qt::UserRole
};
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
protected:
struct FavoriteBoard {
QString name;
QString url;
};
private:
void load();
void save();
private:
QList<FavoriteBoard> _boards;
};
#endif // FAVORITESMODEL_H
|