From ac2edceb02a61c1d670312385b1d709417961799 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Thu, 19 Sep 2013 20:27:00 +0200 Subject: Refactor device and service discovery errors - Make them more consistent with other Qt modules - Propagate the error during device discovery to the QBluetoothServiceDiscoveryAgent Change-Id: Idcd3e0e6061b85e8b6adad248625740f3b91289a Reviewed-by: Alex Blasche --- src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp') diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp index d10dcc4b..257ebf3d 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp @@ -97,7 +97,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() #ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << "ERROR: " << errorString; #endif - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; Q_Q(QBluetoothDeviceDiscoveryAgent); emit q->error(lastError); return; @@ -115,11 +115,11 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() QDBusPendingReply propertiesReply = adapter->GetProperties(); propertiesReply.waitForFinished(); if(propertiesReply.isError()) { + errorString = propertiesReply.error().message(); #ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << "ERROR: " << errorString; #endif - errorString = propertiesReply.error().message(); - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; Q_Q(QBluetoothDeviceDiscoveryAgent); emit q->error(lastError); return; @@ -130,7 +130,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() delete adapter; adapter = 0; errorString = discoveryReply.error().message(); - lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; + lastError = QBluetoothDeviceDiscoveryAgent::InputOutputError; Q_Q(QBluetoothDeviceDiscoveryAgent); emit q->error(lastError); #ifdef QT_DEVICEDISCOVERY_DEBUG -- cgit v1.2.3