-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.h
More file actions
38 lines (31 loc) · 914 Bytes
/
Copy pathconfig.h
File metadata and controls
38 lines (31 loc) · 914 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
36
37
38
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include <QObject>
class Config : public QObject {
Q_OBJECT
public:
Config(const QString& config_file)
: config_file(config_file)
{
load();
}
void load();
void write();
private:
QJsonObject toJsonObject();
public:
const QUrl& recentLrcFile() const;
void setRecentLrcFile(const QUrl& newRecentLrcFile);
const QUrl& recentAudioFile() const;
void setRecentAudioFile(const QUrl& newRecentAudioFile);
signals:
void recentLrcFileChanged();
void recentAudioFileChanged();
private:
QString config_file;
QUrl m_recentAudioFile;
QUrl m_recentLrcFile;
Q_PROPERTY(QUrl recentLrcFile READ recentLrcFile WRITE setRecentLrcFile NOTIFY recentLrcFileChanged)
Q_PROPERTY(QUrl recentAudioFile READ recentAudioFile WRITE setRecentAudioFile NOTIFY recentAudioFileChanged)
};