mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: add helper function to fill in the BT name
For some devices the BT device name is different from the product name. Make sure that name is available to the mobile UI. This helper fills it in from the scan data (based on the device address). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
6ba1cf8cf7
commit
ef8656998a
2 changed files with 13 additions and 0 deletions
|
@ -1757,6 +1757,17 @@ void QMLManager::setStatusbarColor(QColor)
|
|||
|
||||
#endif
|
||||
|
||||
void QMLManager::retrieveBluetoothName()
|
||||
{
|
||||
QString name = DC_devName();
|
||||
QList<BTDiscovery::btVendorProduct> btDCs = BTDiscovery::instance()->getBtDcs();
|
||||
foreach (BTDiscovery::btVendorProduct btDC, btDCs) {
|
||||
qDebug() << "compare" <<name << btDC.btpdi.address;
|
||||
if (name.contains(btDC.btpdi.address))
|
||||
DC_setDevBluetoothName(btDC.btpdi.name);
|
||||
}
|
||||
}
|
||||
|
||||
QString QMLManager::DC_vendor() const
|
||||
{
|
||||
return DCDeviceData::instance()->vendor();
|
||||
|
|
|
@ -62,6 +62,8 @@ public:
|
|||
QString DC_devName() const;
|
||||
void DC_setDevName(const QString& devName);
|
||||
|
||||
Q_INVOKABLE void retrieveBluetoothName();
|
||||
|
||||
QString DC_devBluetoothName() const;
|
||||
void DC_setDevBluetoothName(const QString& devBluetoothName);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue