-
Notifications
You must be signed in to change notification settings - Fork 9
/
settings.h
41 lines (28 loc) · 1.29 KB
/
settings.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
40
41
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QSettings>
class Cache : public QSettings
{
public:
static const QString GREETER_DATA_DIR_PATH;
static void prepare();
Cache() : QSettings(GREETER_DATA_DIR_PATH + "/state", QSettings::NativeFormat) {}
QString getLastUser() { return value("last-user").toString(); }
void setLastUser(QString userId) { setValue("last-user", userId); }
QString getLastSession(QString userId) { return value(userId + "/last-session").toString(); }
void setLastSession(QString userId, QString session) { setValue(userId + "/last-session", session); }
};
#define CONFIG_FILE "/etc/lightdm/qt-lightdm-greeter.conf"
#define BACKGROUND_IMAGE_KEY "greeter-background-image"
#define LOGINFORM_OFFSETX_KEY "loginform-offset-x"
#define LOGINFORM_OFFSETY_KEY "loginform-offset-y"
class Settings : public QSettings
{
public:
Settings() : QSettings(QString("/etc/lightdm/qt-lightdm-greeter.conf"), QSettings::NativeFormat) {}
QString iconThemeName() { return value("greeter-icon-theme").toString(); }
QString backgrundImagePath() { return value("greeter-background-image").toString(); }
QString offsetX() { return value("loginform-offset-x").toString(); }
QString offsetY() { return value("loginform-offset-y").toString(); }
};
#endif // SETTINGS_H