This repository was archived by the owner on Apr 28, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 38
38
39
39
NfcSettings::NfcSettings (QObject *parent)
40
40
: QObject(parent)
41
+ , m_valid(false )
41
42
, m_enabled(false )
42
43
, m_available(false )
43
44
{
@@ -67,6 +68,11 @@ NfcSettings::~NfcSettings()
67
68
{
68
69
}
69
70
71
+ bool NfcSettings::valid () const
72
+ {
73
+ return m_valid;
74
+ }
75
+
70
76
bool NfcSettings::available () const
71
77
{
72
78
return m_available;
@@ -89,6 +95,8 @@ void NfcSettings::getEnableStateFinished(QDBusPendingCallWatcher *call)
89
95
qWarning () << " Get dbus error:" << reply.error ();
90
96
} else {
91
97
updateEnabledState (reply.value ());
98
+ m_valid = true ;
99
+ emit validChanged ();
92
100
}
93
101
call->deleteLater ();
94
102
}
Original file line number Diff line number Diff line change 11
11
class SYSTEMSETTINGS_EXPORT NfcSettings : public QObject
12
12
{
13
13
Q_OBJECT
14
-
14
+ Q_PROPERTY ( bool valid READ valid NOTIFY validChanged)
15
15
Q_PROPERTY (bool available READ available NOTIFY availableChanged)
16
16
Q_PROPERTY (bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
17
+
17
18
public:
18
19
explicit NfcSettings (QObject *parent = nullptr );
19
20
~NfcSettings ();
20
21
22
+ bool valid () const ;
21
23
bool available () const ;
22
24
bool enabled () const ;
23
25
void setEnabled (bool enabled);
24
26
25
27
signals:
28
+ void validChanged ();
26
29
void availableChanged ();
27
30
void enabledChanged ();
28
31
29
32
private:
33
+ bool m_valid;
30
34
bool m_enabled;
31
35
bool m_available;
32
36
QDBusInterface *m_interface;
You can’t perform that action at this time.
0 commit comments