-
Notifications
You must be signed in to change notification settings - Fork 1
/
UserMgr.h
39 lines (29 loc) · 976 Bytes
/
UserMgr.h
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
#ifndef USERMGR_H
#define USERMGR_H
#include "MySQLite.h"
#include "QSettings"
#include "QStringList"
typedef QList< QMap<QString, QVariant> > LISTMAPINFO;
class UserMgr : public MySQLite
{
public:
UserMgr(const QString &dbpath, const QString &connName,const QString &path);
~UserMgr();
public:
bool exists(const QString &userName); // 判断用户是否存在
QVariant getUserInfo(const QString &itemName,const QString &userName); // 获取用户相关的信息
QStringList getUserList(); // 返回用户列表,已经按最后登录时间排序好
QStringList getUserListOrderById(); // 返回用户列表, 按id降序排号
void initMainConfig();
QSettings *getCfg();
QString getDefaultUser();
void setDefaultUser(const QString &userName);
bool getAutoSelect();
void setAutoSelect(bool bAuto);
private:
LISTMAPINFO getLMI(const QString & prefix);
void setLMI(const QString & prefix, LISTMAPINFO &lmi);
private:
QSettings *cfg;
};
#endif // USERMGR_H