summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/btdiscovery.cpp6
-rw-r--r--core/btdiscovery.h4
-rw-r--r--core/qt-ble.cpp2
-rw-r--r--desktop-widgets/btdeviceselectiondialog.cpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/core/btdiscovery.cpp b/core/btdiscovery.cpp
index b3aab4fb4..254088ec1 100644
--- a/core/btdiscovery.cpp
+++ b/core/btdiscovery.cpp
@@ -169,7 +169,7 @@ void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
// On mobile (iOS) the current ConnectionListModel does not support
// additional data, so just save all discovered devices.
- saveBtDeviceInfo(btDeviceAddress(&device, false).toUtf8().constData(), device);
+ saveBtDeviceInfo(btDeviceAddress(&device, false), device);
#endif
btDeviceDiscoveredMain(this_d);
@@ -287,12 +287,12 @@ bool BTDiscovery::checkException(const char* method, const QAndroidJniObject *ob
QHash<QString, QBluetoothDeviceInfo> btDeviceInfo;
-void saveBtDeviceInfo(const char* devaddr, QBluetoothDeviceInfo deviceInfo)
+void saveBtDeviceInfo(const QString &devaddr, QBluetoothDeviceInfo deviceInfo)
{
btDeviceInfo[devaddr] = deviceInfo;
}
-QBluetoothDeviceInfo getBtDeviceInfo(const char* devaddr)
+QBluetoothDeviceInfo getBtDeviceInfo(const QString &devaddr)
{
if (btDeviceInfo.contains(devaddr))
return btDeviceInfo[devaddr];
diff --git a/core/btdiscovery.h b/core/btdiscovery.h
index 7a9e9c655..212585688 100644
--- a/core/btdiscovery.h
+++ b/core/btdiscovery.h
@@ -16,8 +16,8 @@
#include <QAndroidJniEnvironment>
#endif
-void saveBtDeviceInfo(const char* devaddr, QBluetoothDeviceInfo deviceInfo);
-QBluetoothDeviceInfo getBtDeviceInfo(const char* devaddr);
+void saveBtDeviceInfo(const QString &devaddr, QBluetoothDeviceInfo deviceInfo);
+QBluetoothDeviceInfo getBtDeviceInfo(const QString &devaddr);
class BTDiscovery : public QObject {
Q_OBJECT
diff --git a/core/qt-ble.cpp b/core/qt-ble.cpp
index 5836c93af..b39bd5331 100644
--- a/core/qt-ble.cpp
+++ b/core/qt-ble.cpp
@@ -298,7 +298,7 @@ dc_status_t qt_ble_open(dc_custom_io_t *io, dc_context_t *context, const char *d
qputenv("QT_DEFAULT_CENTRAL_SERVICES", "1");
#if defined(Q_OS_MACOS) || defined(Q_OS_IOS)
- QBluetoothDeviceInfo remoteDevice = getBtDeviceInfo(devaddr);
+ QBluetoothDeviceInfo remoteDevice = getBtDeviceInfo(QString(devaddr));
QLowEnergyController *controller = QLowEnergyController::createCentral(remoteDevice);
#else
// this is deprecated but given that we don't use Qt to scan for
diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp
index 89fd34b53..8077298f6 100644
--- a/desktop-widgets/btdeviceselectiondialog.cpp
+++ b/desktop-widgets/btdeviceselectiondialog.cpp
@@ -155,7 +155,7 @@ void BtDeviceSelectionDialog::on_save_clicked()
selectedRemoteDeviceInfo.reset(new QBluetoothDeviceInfo(remoteDeviceInfo));
QString address = remoteDeviceInfo.address().isNull() ? remoteDeviceInfo.deviceUuid().toString() :
remoteDeviceInfo.address().toString();
- saveBtDeviceInfo(address.toUtf8().constData(), remoteDeviceInfo);
+ saveBtDeviceInfo(address, remoteDeviceInfo);
if (remoteDeviceDiscoveryAgent->isActive()) {
// Stop the SDP agent if the clear button is pressed and enable the Scan button
remoteDeviceDiscoveryAgent->stop();