mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
b32251a5a8
commit
6addfe1660
2 changed files with 3 additions and 4 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ private:
|
|||
QBluetoothLocalDevice *localDevice;
|
||||
QBluetoothDeviceDiscoveryAgent *remoteDeviceDiscoveryAgent;
|
||||
#endif
|
||||
QSharedPointer<QBluetoothDeviceInfo> selectedRemoteDeviceInfo;
|
||||
QScopedPointer<QBluetoothDeviceInfo> selectedRemoteDeviceInfo;
|
||||
|
||||
void updateLocalDeviceInformation();
|
||||
void initializeDeviceDiscoveryAgent();
|
||||
|
|
Loading…
Reference in a new issue