diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2017-11-11 22:12:21 +0100 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-12 20:12:32 +0100 |
commit | 6addfe16605b0257f6c42b0adb75c8ae157626f5 (patch) | |
tree | 4395d60039fb72102b1ff9ace95b5e032d200cad /desktop-widgets | |
parent | b32251a5a8ec6dc431b6c5a71e5cd9d3d95f0930 (diff) | |
download | subsurface-6addfe16605b0257f6c42b0adb75c8ae157626f5.tar.gz |
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 <bstoeger@mail.tuwien.ac.at>
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(); |