blob: 60c0375834d174245d608eb879e8fbea60cba252 (
plain) (
blame)
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
|
// SPDX-License-Identifier: GPL-2.0
#ifndef QPREFSFACEBOOK_H
#define QPREFSFACEBOOK_H
#include "core/pref.h"
#include <QObject>
class qPrefFacebook : public QObject {
Q_OBJECT
Q_PROPERTY(QString access_token READ access_token WRITE set_access_token NOTIFY access_token_changed);
Q_PROPERTY(QString album_id READ album_id WRITE set_album_id NOTIFY album_id_changed);
Q_PROPERTY(QString user_id READ user_id WRITE set_user_id NOTIFY user_id_changed);
public:
qPrefFacebook(QObject *parent = NULL);
static qPrefFacebook *instance();
// Load/Sync local settings (disk) and struct preference
void loadSync(bool doSync);
void load() {loadSync(false); }
void sync() {loadSync(true); }
public:
static QString access_token() { return prefs.facebook.access_token; }
static QString album_id() { return prefs.facebook.album_id; }
static QString user_id() { return prefs.facebook.user_id; }
public slots:
void set_access_token(const QString& value);
void set_album_id(const QString& value);
void set_user_id(const QString& value);
signals:
void access_token_changed(const QString& value);
void album_id_changed(const QString& value);
void user_id_changed(const QString& value);
private:
void disk_access_token(bool doSync);
void disk_album_id(bool doSync);
void disk_user_id(bool doSync);
};
#endif
|