From 7bd860f2b768ac9f14fea7a55ad23092a9f4bba2 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 25 Feb 2018 00:17:33 +0100 Subject: Cleanup: Use QString as parameter for [get|save]BtDeviceInfo() Each callsite of saveBtDeviceInfo() has a QString, which is converted to a C-string, passed and immediately converted back. Remove these conversions by taking a reference to QString directly. getBtDeviceInfo() is not as clear. Here, the callsite has a C-string handed down from libdivecomputer. Nevertheless, pass a reference of QString here as well. Firstly, for reasons of symmetry. Secondly, to avoid multiple conversions in the getBtDeviceInfo() functions. Signed-off-by: Berthold Stoeger --- desktop-widgets/btdeviceselectiondialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets') 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(); -- cgit v1.2.3-70-g09d2