summaryrefslogtreecommitdiffstats
path: root/bluetooth/bluetooth.h
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2019-03-20 14:22:57 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2019-03-22 12:36:51 -0700
commit6a80077e386e8a74940e81268055ff5ea0d97771 (patch)
treededc469f9ba4831917f18eaa00c2128532744af1 /bluetooth/bluetooth.h
parentdc5eea70949891012ddb7d37727955c30a2e74bb (diff)
libqtappfw: bluetooth: add BluetoothModel support
Switch from using single threaded and incorrect QML processing of ListViews to using models provided from libqtappfw Bug-AGL: SPEC-2270 Change-Id: I83f02ab104a18ade95dfd172902e32a808c3d897 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'bluetooth/bluetooth.h')
-rw-r--r--bluetooth/bluetooth.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/bluetooth/bluetooth.h b/bluetooth/bluetooth.h
index 0f38381..6cef0ce 100644
--- a/bluetooth/bluetooth.h
+++ b/bluetooth/bluetooth.h
@@ -22,6 +22,7 @@
#include <QJsonArray>
#include "messageengine.h"
+#include "bluetoothmodel.h"
class Bluetooth : public QObject
{
@@ -30,7 +31,7 @@ class Bluetooth : public QObject
Q_PROPERTY(bool discoverable READ discoverable WRITE setDiscoverable NOTIFY discoverableChanged)
public:
- explicit Bluetooth(QUrl &url, QObject * parent = Q_NULLPTR);
+ explicit Bluetooth(QUrl &url, QQmlContext *context, QObject * parent = Q_NULLPTR);
virtual ~Bluetooth();
void setPower(bool);
@@ -60,16 +61,15 @@ class Bluetooth : public QObject
void connectionEvent(QJsonObject data);
void requestConfirmationEvent(QJsonObject data);
- void deviceAddedEvent(QJsonObject data);
- void deviceRemovedEvent(QJsonObject data);
- void deviceUpdatedEvent(QJsonObject data);
- void deviceListEvent(QJsonObject data);
private:
MessageEngine *m_mloop;
+ QQmlContext *m_context;
+ BluetoothModel *m_bluetooth;
void send_command(QString, QJsonObject);
void set_discovery_filter();
void discovery_command(bool);
+ void populateDeviceList(QJsonObject data);
void processDeviceChangesEvent(QJsonObject data);
// slots