Commit 44716f0a authored by Slava Monich's avatar Slava Monich Committed by neochapay

[settings-nfc] Add valid property to NfcSettings. Contibutes JB#48464

parent 1d160e35
......@@ -38,6 +38,7 @@
NfcSettings::NfcSettings(QObject *parent)
: QObject(parent)
, m_valid(false)
, m_enabled(false)
, m_available(false)
{
......@@ -67,6 +68,11 @@ NfcSettings::~NfcSettings()
{
}
bool NfcSettings::valid() const
{
return m_valid;
}
bool NfcSettings::available() const
{
return m_available;
......@@ -89,6 +95,8 @@ void NfcSettings::getEnableStateFinished(QDBusPendingCallWatcher *call)
qWarning() << "Get dbus error:" << reply.error();
} else {
updateEnabledState(reply.value());
m_valid = true;
emit validChanged();
}
call->deleteLater();
}
......
......@@ -11,22 +11,26 @@
class SYSTEMSETTINGS_EXPORT NfcSettings : public QObject
{
Q_OBJECT
Q_PROPERTY(bool valid READ valid NOTIFY validChanged)
Q_PROPERTY(bool available READ available NOTIFY availableChanged)
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
public:
explicit NfcSettings(QObject *parent = nullptr);
~NfcSettings();
bool valid() const;
bool available() const;
bool enabled() const;
void setEnabled(bool enabled);
signals:
void validChanged();
void availableChanged();
void enabledChanged();
private:
bool m_valid;
bool m_enabled;
bool m_available;
QDBusInterface *m_interface;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment