summaryrefslogtreecommitdiffstats
path: root/core/btdiscovery.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-16 21:45:21 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-16 21:53:44 -0700
commitc21845aa016786fb92a08c5d01029218ad1e10fb (patch)
tree5fdfe1a325c94f653157e2bd4217aab15925c7c2 /core/btdiscovery.h
parentdd1bdd3f8110a74306538ad5c952769f82adf6ba (diff)
downloadsubsurface-c21845aa016786fb92a08c5d01029218ad1e10fb.tar.gz
Add ConnectionListModel
We'll use that to do a better job of showing the connection used when talking to a dive computer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/btdiscovery.h')
-rw-r--r--core/btdiscovery.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/btdiscovery.h b/core/btdiscovery.h
index 4b4e4b802..71df24f24 100644
--- a/core/btdiscovery.h
+++ b/core/btdiscovery.h
@@ -5,6 +5,7 @@
#include <QObject>
#include <QString>
#include <QLoggingCategory>
+#include <QAbstractListModel>
#if defined(BT_SUPPORT)
#include <QBluetoothLocalDevice>
#include <QBluetoothDeviceDiscoveryAgent>
@@ -17,6 +18,22 @@
#include <QAndroidJniEnvironment>
#endif
+class ConnectionListModel : public QAbstractListModel {
+ Q_OBJECT
+public:
+ enum CLMRole {
+ AddressRole = Qt::UserRole + 1
+ };
+ ConnectionListModel(QObject *parent = 0);
+ QHash<int, QByteArray> roleNames() const;
+ QVariant data(const QModelIndex &index, int role = AddressRole) const;
+ QString address(int idx) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ void addAddress(const QString address);
+private:
+ QStringList m_addresses;
+};
+
class BTDiscovery : public QObject {
Q_OBJECT