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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-02-25 00:17:33 +01:00 committed by Jan Mulder
parent d9c0df0142
commit 7bd860f2b7
4 changed files with 7 additions and 7 deletions

View file

@ -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();