-
Notifications
You must be signed in to change notification settings - Fork 2
/
settingscontroller.cpp
58 lines (49 loc) · 1.3 KB
/
settingscontroller.cpp
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "settingscontroller.h"
SettingsController::SettingsController()
{
}
void SettingsController::saveCookies(QByteArray cookies)
{
settings.beginGroup(QLatin1String("cookies"));
settings.setValue("cookies", cookies);
settings.endGroup();
}
QByteArray SettingsController::getCookies()
{
settings.beginGroup(QLatin1String("cookies"));
QByteArray value=settings.value("cookies").toByteArray();
settings.endGroup();
return value;
}
void SettingsController::clearCookies()
{
settings.beginGroup(QLatin1String("cookies"));
settings.remove("");
settings.endGroup();
}
void SettingsController::setplan(int type)
{
settings.beginGroup(QLatin1String("usersettings"));
settings.setValue("plan", type);
settings.endGroup();
}
int SettingsController::getplan()
{
settings.beginGroup(QLatin1String("usersettings"));
int value=settings.value("plan").toInt();
settings.endGroup();
return value;
}
int SettingsController::getLastAutoPlan()
{
settings.beginGroup(QLatin1String("usersettings"));
int value=settings.value("autoplan").toInt();
settings.endGroup();
return value;
}
void SettingsController::setLastAutoPlan(int type)
{
settings.beginGroup(QLatin1String("usersettings"));
settings.setValue("autoplan", type);
settings.endGroup();
}