summaryrefslogtreecommitdiffstats
path: root/src/bluetooth
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-01-24 11:43:37 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-24 14:23:07 +0100
commitc72bc0a79004af16ece22cc5a5493fa9034bb13e (patch)
treea8238d8a220870706e1b276a6e46c2027b2e0c9e /src/bluetooth
parentc87ab8b4b1a9017878cf4257e056a0baa2af5012 (diff)
Suppress warning from QObject attempting to connect null object
This can happen when QBluetoothLocalDevice(some_invalid_bt_address) was called. Change-Id: I8d547dc802b79ffd5cf8349fec6334177e8c4421 Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Diffstat (limited to 'src/bluetooth')
-rw-r--r--src/bluetooth/qbluetoothlocaldevice_bluez.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_bluez.cpp b/src/bluetooth/qbluetoothlocaldevice_bluez.cpp
index 8f15dc80..310be91b 100644
--- a/src/bluetooth/qbluetoothlocaldevice_bluez.cpp
+++ b/src/bluetooth/qbluetoothlocaldevice_bluez.cpp
@@ -355,9 +355,11 @@ QBluetoothLocalDevicePrivate::QBluetoothLocalDevicePrivate(QBluetoothLocalDevice
void QBluetoothLocalDevicePrivate::connectDeviceChanges()
{
- connect(adapter, SIGNAL(PropertyChanged(QString,QDBusVariant)), SLOT(PropertyChanged(QString,QDBusVariant)));
- connect(adapter, SIGNAL(DeviceCreated(QDBusObjectPath)), SLOT(_q_deviceCreated(QDBusObjectPath)));
- connect(adapter, SIGNAL(DeviceRemoved(QDBusObjectPath)), SLOT(_q_deviceRemoved(QDBusObjectPath)));
+ if (adapter) { //invalid QBluetoothLocalDevice due to wrong local adapter address
+ connect(adapter, SIGNAL(PropertyChanged(QString,QDBusVariant)), SLOT(PropertyChanged(QString,QDBusVariant)));
+ connect(adapter, SIGNAL(DeviceCreated(QDBusObjectPath)), SLOT(_q_deviceCreated(QDBusObjectPath)));
+ connect(adapter, SIGNAL(DeviceRemoved(QDBusObjectPath)), SLOT(_q_deviceRemoved(QDBusObjectPath)));
+ }
}
QBluetoothLocalDevicePrivate::~QBluetoothLocalDevicePrivate()