-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.h
More file actions
35 lines (28 loc) · 786 Bytes
/
Copy pathsettings.h
File metadata and controls
35 lines (28 loc) · 786 Bytes
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
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QObject>
#include <QSettings>
#include "settings_type.h"
class Settings : public QObject
{
Q_OBJECT
public:
explicit Settings(QObject *parent = nullptr);
const QString adapterAddress() const;
bool autoCopyCode() const;
const struct settings_type settings() const;
signals:
void settingsChanged(const settings_type& s);
public slots:
void setAdapterAddress(const QString& address);
void setAutoCopyCode(const bool enabled);
void updateSettings(const settings_type& new_settings);
void saveSettings();
void reloadSettingsOrDefaults();
private:
void loadSettingsOrDefaults();
private:
QSettings settings_storage_;
struct settings_type current_settings_;
};
#endif // SETTINGS_H