~lightdm-team/lightdm/1.4

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
38
39
40
41
42
43
#ifndef USERSMODEL_H
#define USERSMODEL_H

#include <QAbstractListModel>

class UsersModelPrivate;

namespace QLightDM
{

class Config;
class User;

class Q_DECL_EXPORT UsersModel : public QAbstractListModel
{
    Q_OBJECT
public:
    enum UserModelRoles {NameRole = Qt::UserRole,
                         RealNameRole,
                         LoggedInRole
                        };

    explicit UsersModel(QLightDM::Config *config, QObject *parent = 0);
    ~UsersModel();
    int rowCount(const QModelIndex &parent) const;
    QVariant data(const QModelIndex &index, int role) const;

signals:

public slots:

private slots:
    /** Updates the model with new changes in the password file*/
    void loadUsers();

private:
    /** Returns a list of all users in the password file*/
    QList<User> getUsers();
    UsersModelPrivate *d;
};
};

#endif // USERSMODEL_H