diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/btdiscovery.cpp | 7 | ||||
-rw-r--r-- | core/btdiscovery.h | 3 | ||||
-rw-r--r-- | core/connectionlistmodel.cpp | 7 | ||||
-rw-r--r-- | core/connectionlistmodel.h | 1 | ||||
-rw-r--r-- | core/qt-gui.h | 1 |
5 files changed, 17 insertions, 2 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp index f9c6e8522..281e3b314 100644 --- a/core/btdiscovery.cpp +++ b/core/btdiscovery.cpp @@ -60,6 +60,12 @@ BTDiscovery::BTDiscovery(QObject *parent) } m_instance = this; #if defined(BT_SUPPORT) + BTDiscoveryReDiscover(); +#endif +} + +void BTDiscovery::BTDiscoveryReDiscover() +{ #if !defined(Q_OS_IOS) if (localBtDevice.isValid() && localBtDevice.hostMode() == QBluetoothLocalDevice::HostConnectable) { @@ -100,7 +106,6 @@ BTDiscovery::BTDiscovery(QObject *parent) m_btValid = false; } #endif -#endif } BTDiscovery::~BTDiscovery() diff --git a/core/btdiscovery.h b/core/btdiscovery.h index 61d03f49b..7a9e9c655 100644 --- a/core/btdiscovery.h +++ b/core/btdiscovery.h @@ -46,6 +46,8 @@ public: void getBluetoothDevices(); #endif QList<btVendorProduct> getBtDcs(); + QBluetoothLocalDevice localBtDevice; + void BTDiscoveryReDiscover(); private: static BTDiscovery *m_instance; @@ -59,7 +61,6 @@ private: #endif QList<struct btPairedDevice> btPairedDevices; - QBluetoothLocalDevice localBtDevice; QBluetoothDeviceDiscoveryAgent *discoveryAgent; signals: diff --git a/core/connectionlistmodel.cpp b/core/connectionlistmodel.cpp index 3e1e0d71c..7f8b9894b 100644 --- a/core/connectionlistmodel.cpp +++ b/core/connectionlistmodel.cpp @@ -42,3 +42,10 @@ void ConnectionListModel::addAddress(const QString address) m_addresses.append(address); endInsertRows(); } + +void ConnectionListModel::removeAllAddresses() +{ + beginRemoveRows(QModelIndex(), 0, rowCount()); + m_addresses.clear(); + endRemoveRows(); +} diff --git a/core/connectionlistmodel.h b/core/connectionlistmodel.h index ec3a785fa..b7b1db5c9 100644 --- a/core/connectionlistmodel.h +++ b/core/connectionlistmodel.h @@ -15,6 +15,7 @@ public: QString address(int idx) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; void addAddress(const QString address); + void removeAllAddresses(); private: QStringList m_addresses; }; diff --git a/core/qt-gui.h b/core/qt-gui.h index 59e79c268..1fc7d161e 100644 --- a/core/qt-gui.h +++ b/core/qt-gui.h @@ -7,6 +7,7 @@ void init_ui(); void run_ui(); void exit_ui(); +void set_non_bt_addresses(); #if defined(SUBSURFACE_MOBILE) #include <QQuickWindow> |