From 6addfe16605b0257f6c42b0adb75c8ae157626f5 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 11 Nov 2017 22:12:21 +0100 Subject: Trivial: Replace a QSharedPointer by a QScopedPointer Since the QSharedPointer is never passed or copied, reference counting is certainly not needed. Signed-off-by: Berthold Stoeger --- desktop-widgets/btdeviceselectiondialog.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'desktop-widgets/btdeviceselectiondialog.cpp') diff --git a/desktop-widgets/btdeviceselectiondialog.cpp b/desktop-widgets/btdeviceselectiondialog.cpp index c036fc3b7..1b43c8471 100644 --- a/desktop-widgets/btdeviceselectiondialog.cpp +++ b/desktop-widgets/btdeviceselectiondialog.cpp @@ -152,7 +152,7 @@ void BtDeviceSelectionDialog::on_save_clicked() QBluetoothDeviceInfo remoteDeviceInfo = currentItem->data(Qt::UserRole).value(); // Save the selected device - selectedRemoteDeviceInfo = QSharedPointer(new QBluetoothDeviceInfo(remoteDeviceInfo)); + selectedRemoteDeviceInfo.reset(new QBluetoothDeviceInfo(remoteDeviceInfo)); QString address = remoteDeviceInfo.address().isNull() ? remoteDeviceInfo.deviceUuid().toString() : remoteDeviceInfo.address().toString(); saveBtDeviceInfo(address.toUtf8().constData(), remoteDeviceInfo); @@ -460,9 +460,8 @@ QString BtDeviceSelectionDialog::getSelectedDeviceAddress() QString BtDeviceSelectionDialog::getSelectedDeviceName() { - if (selectedRemoteDeviceInfo) { + if (selectedRemoteDeviceInfo) return selectedRemoteDeviceInfo.data()->name(); - } return QString(); } -- cgit v1.2.3-70-g09d2