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-04-04 11:34:09 -0700
commit5ba2e7752c478a386de6c6cf06adb6f9cf7ee79e (patch)
tree678e6edf13d5812a88b6c873b4176927fa0dafe4 /bluetooth/bluetooth.h
parent47903065edab76a0278ab160a7cbbc112180f326 (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 SPEC-2290 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