-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetting.h
38 lines (29 loc) · 944 Bytes
/
setting.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
#ifndef __SETTING_H__
#define __SETTING_H__
#define SET_APP_NAME "transfer"
#define SET_MAX_CMBITM 10
#define SET_PFX_CMBITM "item"
#define SET_PFX_CMBTXT 'x'
#define SET_SEC_CFG "config"
#define SET_SEC_DIR "dir"
#define SET_KEY_LOG "/log"
class QComboBox;
class QSettings;
class Setting
{
public:
static void set(const QString& section, const QString& key, const QString& val);
static QString get(const QString& section, const QString& key, const QString& def);
static QString path();
static void save(const QString& section, const QString& prefix, const QComboBox& cmb, bool all=true);
static void load(const QString& section, const QString& prefix, QComboBox& cmb, bool all=true);
static void flush();
//---------add by davidWu 2013/12/31---------
// static void save();
// static void load();
//---------end---------
private:
Setting();
static QSettings& storage();
};
#endif // __SETTING_H__