diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/btdeviceselectiondialog.cpp | 5 | ||||
-rw-r--r-- | desktop-widgets/btdeviceselectiondialog.h | 2 |
2 files changed, 3 insertions, 4 deletions
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<QBluetoothDeviceInfo>(); // Save the selected device - selectedRemoteDeviceInfo = QSharedPointer<QBluetoothDeviceInfo>(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(); } diff --git a/desktop-widgets/btdeviceselectiondialog.h b/desktop-widgets/btdeviceselectiondialog.h index 448404843..e883278ce 100644 --- a/desktop-widgets/btdeviceselectiondialog.h +++ b/desktop-widgets/btdeviceselectiondialog.h @@ -83,7 +83,7 @@ private: QBluetoothLocalDevice *localDevice; QBluetoothDeviceDiscoveryAgent *remoteDeviceDiscoveryAgent; #endif - QSharedPointer<QBluetoothDeviceInfo> selectedRemoteDeviceInfo; + QScopedPointer<QBluetoothDeviceInfo> selectedRemoteDeviceInfo; void updateLocalDeviceInformation(); void initializeDeviceDiscoveryAgent(); |