summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_android.cpp24
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_p.h4
2 files changed, 12 insertions, 16 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_android.cpp b/src/bluetooth/qbluetoothlocaldevice_android.cpp
index 0144a5ef..b46923eb 100644
--- a/src/bluetooth/qbluetoothlocaldevice_android.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice_android.cpp
@@ -54,25 +54,21 @@ Q_DECLARE_LOGGING_CATEGORY(QT_BT_ANDROID)
QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate(
QBluetoothLocalDevice *q, const QBluetoothAddress &address) :
- q_ptr(q),
- obj(0),
- pendingHostModeTransition(false)
+ q_ptr(q)
{
registerQBluetoothLocalDeviceMetaType();
initialize(address);
receiver = new LocalDeviceBroadcastReceiver(q_ptr);
- connect(receiver, SIGNAL(hostModeStateChanged(QBluetoothLocalDevice::HostMode)),
- this, SLOT(processHostModeChange(QBluetoothLocalDevice::HostMode)));
- connect(receiver, SIGNAL(pairingStateChanged(QBluetoothAddress,
- QBluetoothLocalDevice::Pairing)),
- this, SLOT(processPairingStateChanged(QBluetoothAddress,
- QBluetoothLocalDevice::Pairing)));
- connect(receiver, SIGNAL(connectDeviceChanges(QBluetoothAddress, bool)),
- this, SLOT(processConnectDeviceChanges(QBluetoothAddress, bool)));
- connect(receiver, SIGNAL(pairingDisplayConfirmation(QBluetoothAddress, QString)),
- this, SLOT(processDisplayConfirmation(QBluetoothAddress, QString)));
+ connect(receiver, &LocalDeviceBroadcastReceiver::hostModeStateChanged,
+ this, &QBluetoothLocalDevicePrivate::processHostModeChange);
+ connect(receiver, &LocalDeviceBroadcastReceiver::pairingStateChanged,
+ this, &QBluetoothLocalDevicePrivate::processPairingStateChanged);
+ connect(receiver, &LocalDeviceBroadcastReceiver::connectDeviceChanges,
+ this, &QBluetoothLocalDevicePrivate::processConnectDeviceChanges);
+ connect(receiver, &LocalDeviceBroadcastReceiver::pairingDisplayConfirmation,
+ this, &QBluetoothLocalDevicePrivate::processDisplayConfirmation);
connect(receiver, &LocalDeviceBroadcastReceiver::pairingDisplayPinCode,
this, &QBluetoothLocalDevicePrivate::processDisplayPinCode);
}
@@ -130,7 +126,7 @@ void QBluetoothLocalDevicePrivate::initialize(const QBluetoothAddress &address)
if (localAddress != address.toString()) {
// passed address not local one -> invalid
delete obj;
- obj = 0;
+ obj = nullptr;
}
}
}
diff --git a/src/bluetooth/qbluetoothlocaldevice_p.h b/src/bluetooth/qbluetoothlocaldevice_p.h
index 8752504d..89dbf9a3 100644
--- a/src/bluetooth/qbluetoothlocaldevice_p.h
+++ b/src/bluetooth/qbluetoothlocaldevice_p.h
@@ -117,13 +117,13 @@ private slots:
private:
QBluetoothLocalDevice *q_ptr;
- QAndroidJniObject *obj;
+ QAndroidJniObject *obj = nullptr;
int pendingPairing(const QBluetoothAddress &address);
public:
LocalDeviceBroadcastReceiver *receiver;
- bool pendingHostModeTransition;
+ bool pendingHostModeTransition = false;
QList<QPair<QBluetoothAddress, bool> > pendingPairings;
QList<QBluetoothAddress> connectedDevices;