Index: sources/view/settings/VBluetooth.h =================================================================== diff -u -rb252cd2777aadbce2d04aa32cc275f193de0cf52 -raeb915075b9e13e5c1aaf2800ba6db03b6c24a0b --- sources/view/settings/VBluetooth.h (.../VBluetooth.h) (revision b252cd2777aadbce2d04aa32cc275f193de0cf52) +++ sources/view/settings/VBluetooth.h (.../VBluetooth.h) (revision aeb915075b9e13e5c1aaf2800ba6db03b6c24a0b) @@ -46,19 +46,12 @@ PROPERTY(QString , localName , "" ) PROPERTY(QString , localAddr , "" ) - PROPERTY(bool , scanEnabled , false ) - PROPERTY(QString , deviceName , "" ) - PROPERTY(QString , deviceAddr , "" ) - PROPERTY(QString , devicePin , "" ) - PROPERTY(quint8 , devicePair , 0 ) + PROPERTY(bool , scanEnabled , true ) PROPERTY(qint16 , error , 0 ) + PROPERTY(QString , pairedAddr , "" ) + PROPERTY(quint8 , pairedBatt , 0 ) - PROPERTY(QString , detailAddr , "" ) - PROPERTY(QString , detailName , "" ) - PROPERTY(QString , detailValue , "" ) - - // List Model public: enum DataRole { @@ -71,32 +64,11 @@ private: BluetoothDeviceListData _devices {}; - int rowCount(const QModelIndex & = QModelIndex()) const; void reset(); - QVariant data(const QModelIndex &index, int role) const - { - if (index.row() < rowCount()) - switch (role) { - case ToStringRole : return _devices.at(index.row()).toString(); - case AddrRole : return _devices.at(index.row()).addr; - case NameRole : return _devices.at(index.row()).name; - case PairRole : return _devices.at(index.row()).pair; - default: return QVariant(); - } - return QVariant(); - } + int rowCount (const QModelIndex & = QModelIndex()) const override; + QVariant data (const QModelIndex &index, int role ) const override; + QHash roleNames ( ) const override; - QHash roleNames() const - { - static const QHash roles { - { ToStringRole, "toString" }, - { AddrRole, "addr" }, - { NameRole, "name" }, - { PairRole, "pair" } - }; - return roles; - } - VIEW_DEC_CLASS(VBluetooth) signals: @@ -113,10 +85,5 @@ public slots: void doScan (); - void doConnectToDevice (); - void doDiscoverServices (); - void doEnableNotify (); - void doReadMeasurements (); - void doReadInformation (); }; }