diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2013-09-17 16:30:32 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 17:24:33 +0200 |
commit | 9fa7195f0f2b8e7148215df564240dbfdad34935 (patch) | |
tree | adf84afa4cb65801c633186f59e9e8ea8d253edd | |
parent | 4810f41772cd0b86f04064f556d2c88cdc4a548f (diff) |
Lower the verbosity of bluetooth
Remove some qDebug statements and change qDebugs to qWarning in case of an error.
Task-number: QTBUG-32253
Change-Id: Ia647d3f485cae56cc9f9c6725400f5b4617b7bf7
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r-- | src/bluetooth/qbluetoothlocaldevice_bluez.cpp | 43 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothserver_bluez.cpp | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothserviceinfo.cpp | 4 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothserviceinfo_bluez.cpp | 8 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothsocket.cpp | 14 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothsocket_bluez.cpp | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothsocket_qnx.cpp | 4 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothtransferreply_bluez.cpp | 4 | ||||
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothservice.cpp | 15 | ||||
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothsocket.cpp | 2 | ||||
-rw-r--r-- | src/nfc/qnearfieldtagtype2.cpp | 2 |
12 files changed, 58 insertions, 44 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice_bluez.cpp b/src/bluetooth/qbluetoothlocaldevice_bluez.cpp index e625d2f9..ce3e1104 100644 --- a/src/bluetooth/qbluetoothlocaldevice_bluez.cpp +++ b/src/bluetooth/qbluetoothlocaldevice_bluez.cpp @@ -194,7 +194,7 @@ static inline OrgBluezDeviceInterface *getDevice(const QBluetoothAddress &addres QDBusPendingReply<QDBusObjectPath> reply = d_ptr->adapter->FindDevice(address.toString()); reply.waitForFinished(); if(reply.isError()){ - qDebug() << Q_FUNC_INFO << "reply failed" << reply.error(); + qWarning() << Q_FUNC_INFO << "reply failed" << reply.error(); return 0; } @@ -230,7 +230,7 @@ void QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pai if(!res){ QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); - qDebug() << "Failed to register agent"; + qWarning() << "Failed to register agent"; return; } } @@ -245,7 +245,7 @@ void QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pai QDBusPendingReply<> deviceReply = device->SetProperty(QLatin1String("Trusted"), QDBusVariant(true)); deviceReply.waitForFinished(); if(deviceReply.isError()){ - qDebug() << Q_FUNC_INFO << "reply failed" << deviceReply.error(); + qWarning() << Q_FUNC_INFO << "reply failed" << deviceReply.error(); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); return; @@ -264,7 +264,7 @@ void QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pai QDBusPendingReply<> deviceReply = device->SetProperty(QLatin1String("Trusted"), QDBusVariant(false)); deviceReply.waitForFinished(); if(deviceReply.isError()){ - qDebug() << Q_FUNC_INFO << "reply failed" << deviceReply.error(); + qWarning() << Q_FUNC_INFO << "reply failed" << deviceReply.error(); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); return; @@ -283,14 +283,14 @@ void QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pai connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), d_ptr, SLOT(pairingCompleted(QDBusPendingCallWatcher*))); if(reply.isError()) - qDebug() << Q_FUNC_INFO << reply.error() << d_ptr->agent_path; + qWarning() << Q_FUNC_INFO << reply.error() << d_ptr->agent_path; } } else if(pairing == Unpaired) { QDBusPendingReply<QDBusObjectPath> reply = this->d_ptr->adapter->FindDevice(address.toString()); reply.waitForFinished(); if(reply.isError()) { - qDebug() << Q_FUNC_INFO << "failed to find device" << reply.error(); + qWarning() << Q_FUNC_INFO << "failed to find device" << reply.error(); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); return; @@ -298,7 +298,7 @@ void QBluetoothLocalDevice::requestPairing(const QBluetoothAddress &address, Pai QDBusPendingReply<> removeReply = this->d_ptr->adapter->RemoveDevice(reply.value()); removeReply.waitForFinished(); if(removeReply.isError()){ - qDebug() << Q_FUNC_INFO << "failed to remove device" << removeReply.error(); + qWarning() << Q_FUNC_INFO << "failed to remove device" << removeReply.error(); QMetaObject::invokeMethod(this, "error", Qt::QueuedConnection, Q_ARG(QBluetoothLocalDevice::Error, QBluetoothLocalDevice::PairingError)); } else { @@ -436,7 +436,7 @@ void QBluetoothLocalDevice::pairingConfirmation(bool confirmation) QString QBluetoothLocalDevicePrivate::RequestPinCode(const QDBusObjectPath &in0) { Q_Q(QBluetoothLocalDevice); - qDebug() << Q_FUNC_INFO << in0.path(); + //qDebug() << Q_FUNC_INFO << in0.path(); // seeded in constructor, 6 digit pin QString pin = QString::fromLatin1("%1").arg(qrand()&1000000); pin = QString::fromLatin1("%1").arg(pin, 6, QLatin1Char('0')); @@ -451,7 +451,7 @@ void QBluetoothLocalDevicePrivate::pairingCompleted(QDBusPendingCallWatcher *wat QDBusPendingReply<> reply = *watcher; if(reply.isError()) { - qDebug() << Q_FUNC_INFO << "failed to create pairing" << reply.error(); + qWarning() << Q_FUNC_INFO << "failed to create pairing" << reply.error(); emit q->error(QBluetoothLocalDevice::PairingError); delete watcher; return; @@ -460,7 +460,7 @@ void QBluetoothLocalDevicePrivate::pairingCompleted(QDBusPendingCallWatcher *wat QDBusPendingReply<QDBusObjectPath> findReply = adapter->FindDevice(address.toString()); findReply.waitForFinished(); if(findReply.isError()) { - qDebug() << Q_FUNC_INFO << "failed to find device" << findReply.error(); + qWarning() << Q_FUNC_INFO << "failed to find device" << findReply.error(); emit q->error(QBluetoothLocalDevice::PairingError); delete watcher; return; @@ -483,34 +483,45 @@ void QBluetoothLocalDevicePrivate::pairingCompleted(QDBusPendingCallWatcher *wat void QBluetoothLocalDevicePrivate::Authorize(const QDBusObjectPath &in0, const QString &in1) { - qDebug() << "Got authorize for" << in0.path() << in1; + Q_UNUSED(in0) + Q_UNUSED(in1) + //TODO implement this + //qDebug() << "Got authorize for" << in0.path() << in1; } void QBluetoothLocalDevicePrivate::Cancel() { - qDebug() << Q_FUNC_INFO; + //TODO implement this + //qDebug() << Q_FUNC_INFO; } void QBluetoothLocalDevicePrivate::Release() { - qDebug() << Q_FUNC_INFO; + //TODO implement this + //qDebug() << Q_FUNC_INFO; } void QBluetoothLocalDevicePrivate::ConfirmModeChange(const QString &in0) { - qDebug() << Q_FUNC_INFO << in0; + Q_UNUSED(in0) + //TODO implement this + //qDebug() << Q_FUNC_INFO << in0; } void QBluetoothLocalDevicePrivate::DisplayPasskey(const QDBusObjectPath &in0, uint in1, uchar in2) { - qDebug() << Q_FUNC_INFO << in0.path() << in1 << in2; + Q_UNUSED(in0) + Q_UNUSED(in1) + Q_UNUSED(in2) + //TODO implement this + //qDebug() << Q_FUNC_INFO << in0.path() << in1 << in2; } uint QBluetoothLocalDevicePrivate::RequestPasskey(const QDBusObjectPath &in0) { Q_UNUSED(in0); - qDebug() << Q_FUNC_INFO; + //qDebug() << Q_FUNC_INFO; return qrand()&0x1000000; } diff --git a/src/bluetooth/qbluetoothserver_bluez.cpp b/src/bluetooth/qbluetoothserver_bluez.cpp index ae4fbb90..cd802648 100644 --- a/src/bluetooth/qbluetoothserver_bluez.cpp +++ b/src/bluetooth/qbluetoothserver_bluez.cpp @@ -239,7 +239,7 @@ void QBluetoothServer::setSecurityFlags(QBluetooth::SecurityFlags security) if (security.testFlag(QBluetooth::Secure)) lm |= RFCOMM_LM_SECURE; - qDebug() << hex << "Setting lm to" << lm << security; + //qDebug() << hex << "Setting lm to" << lm << security; if (setsockopt(d->socket->socketDescriptor(), SOL_RFCOMM, RFCOMM_LM, &lm, sizeof(lm)) < 0){ qWarning() << "Failed to set socket option, closing socket for safety" << errno; diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp index fdde28b7..13f759b2 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp @@ -257,7 +257,9 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingC emit q->serviceDiscovered(serviceInfo); // could stop discovery, check for state if(discoveryState() == Inactive){ +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << "Exit discovery after stop"; +#endif break; } } diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp index 8586bf38..4e2c0499 100644 --- a/src/bluetooth/qbluetoothserviceinfo.cpp +++ b/src/bluetooth/qbluetoothserviceinfo.cpp @@ -398,8 +398,8 @@ void QBluetoothServiceInfo::setDevice(const QBluetoothDeviceInfo &device) */ void QBluetoothServiceInfo::setAttribute(quint16 attributeId, const QVariant &value) { - if (value.type() == QVariant::List) - qDebug() << "tried attribute with type QVariantList" << value; +// if (value.type() == QVariant::List) +// qDebug() << "tried attribute with type QVariantList" << value; d_ptr->attributes[attributeId] = value; diff --git a/src/bluetooth/qbluetoothserviceinfo_bluez.cpp b/src/bluetooth/qbluetoothserviceinfo_bluez.cpp index 885ac0ed..a98b4a46 100644 --- a/src/bluetooth/qbluetoothserviceinfo_bluez.cpp +++ b/src/bluetooth/qbluetoothserviceinfo_bluez.cpp @@ -163,7 +163,7 @@ static void writeAttribute(QXmlStreamWriter *stream, const QVariant &attribute) } break; default: - qDebug() << "Unknown variant type", attribute.userType(); + qWarning() << "Unknown variant type", attribute.userType(); } } @@ -237,7 +237,7 @@ bool QBluetoothServiceInfoPrivate::ensureSdpConnection() const bool QBluetoothServiceInfoPrivate::registerService() const { if (!ensureSdpConnection()) { - qDebug() << "SDP not connected. Cannot register"; + qWarning() << "SDP not connected. Cannot register"; return false; } @@ -272,7 +272,7 @@ bool QBluetoothServiceInfoPrivate::registerService() const QDBusPendingReply<uint> reply = service->AddRecord(xmlServiceRecord); reply.waitForFinished(); if (reply.isError()) { - qDebug() << "AddRecord returned error" << reply.error(); + qWarning() << "AddRecord returned error" << reply.error(); return false; } @@ -281,7 +281,7 @@ bool QBluetoothServiceInfoPrivate::registerService() const QDBusPendingReply<> reply = service->UpdateRecord(serviceRecord, xmlServiceRecord); reply.waitForFinished(); if (reply.isError()) { - qDebug() << "UpdateRecord returned error" << reply.error(); + qWarning() << "UpdateRecord returned error" << reply.error(); return false; } } diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp index 9b1848a0..2eaabe84 100644 --- a/src/bluetooth/qbluetoothsocket.cpp +++ b/src/bluetooth/qbluetoothsocket.cpp @@ -325,7 +325,7 @@ void QBluetoothSocket::connectToService(const QBluetoothServiceInfo &service, Op qWarning() << "No port, no PSM, and no UUID provided, unable to connect"; return; } - qDebug() << "Need a port/psm, doing discovery"; + //qDebug() << "Need a port/psm, doing discovery"; doDeviceDiscovery(service, openMode); } #endif @@ -476,7 +476,7 @@ void QBluetoothSocket::doDeviceDiscovery(const QBluetoothServiceInfo &service, O { Q_D(QBluetoothSocket); - qDebug() << "Starting discovery"; + //qDebug() << "Starting discovery"; if(d->discoveryAgent) { delete d->discoveryAgent; @@ -484,7 +484,7 @@ void QBluetoothSocket::doDeviceDiscovery(const QBluetoothServiceInfo &service, O d->discoveryAgent = new QBluetoothServiceDiscoveryAgent(service.device().address(),this); - qDebug() << "Got agent"; + //qDebug() << "Got agent"; connect(d->discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)), this, SLOT(serviceDiscovered(QBluetoothServiceInfo))); connect(d->discoveryAgent, SIGNAL(finished()), this, SLOT(discoveryFinished())); @@ -500,7 +500,7 @@ void QBluetoothSocket::doDeviceDiscovery(const QBluetoothServiceInfo &service, O // we have to ID the service somehow Q_ASSERT(!d->discoveryAgent->uuidFilter().isEmpty()); - qDebug() << "UUID filter" << d->discoveryAgent->uuidFilter(); + //qDebug() << "UUID filter" << d->discoveryAgent->uuidFilter(); d->discoveryAgent->start(QBluetoothServiceDiscoveryAgent::FullDiscovery); } @@ -508,7 +508,7 @@ void QBluetoothSocket::doDeviceDiscovery(const QBluetoothServiceInfo &service, O void QBluetoothSocket::serviceDiscovered(const QBluetoothServiceInfo &service) { Q_D(QBluetoothSocket); - qDebug() << "FOUND SERVICE!" << service; + //qDebug() << "FOUND SERVICE!" << service; if(service.protocolServiceMultiplexer() != 0 || service.serverChannel() != 0) { connectToService(service, d->openMode); d->discoveryAgent->deleteLater(); @@ -518,10 +518,10 @@ void QBluetoothSocket::serviceDiscovered(const QBluetoothServiceInfo &service) void QBluetoothSocket::discoveryFinished() { - qDebug() << "Socket discovery finished"; + //qDebug() << "Socket discovery finished"; Q_D(QBluetoothSocket); if(d->discoveryAgent){ - qDebug() << "Didn't find any"; + //qDebug() << "Didn't find any"; emit error(QBluetoothSocket::ServiceNotFoundError); d->discoveryAgent->deleteLater(); d->discoveryAgent = 0; diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp index fc5661ae..3bf52a7e 100644 --- a/src/bluetooth/qbluetoothsocket_bluez.cpp +++ b/src/bluetooth/qbluetoothsocket_bluez.cpp @@ -228,7 +228,7 @@ void QBluetoothSocketPrivate::_q_readNotify() readNotifier->setEnabled(false); connectWriteNotifier->setEnabled(false); errorString = QString::fromLocal8Bit(strerror(errsv)); - qDebug() << Q_FUNC_INFO << socket << "error:" << readFromDevice << errorString; + qWarning() << Q_FUNC_INFO << socket << "error:" << readFromDevice << errorString; if(errsv == EHOSTDOWN) emit q->error(QBluetoothSocket::HostNotFoundError); else diff --git a/src/bluetooth/qbluetoothsocket_qnx.cpp b/src/bluetooth/qbluetoothsocket_qnx.cpp index 4197c4d9..dfb9f66e 100644 --- a/src/bluetooth/qbluetoothsocket_qnx.cpp +++ b/src/bluetooth/qbluetoothsocket_qnx.cpp @@ -144,7 +144,7 @@ void QBluetoothSocketPrivate::_q_readNotify() readNotifier->setEnabled(false); connectWriteNotifier->setEnabled(false); errorString = QString::fromLocal8Bit(strerror(errsv)); - qDebug() << Q_FUNC_INFO << socket << " error:" << readFromDevice << errorString; //TODO Try if this actually works + qWarning() << Q_FUNC_INFO << socket << " error:" << readFromDevice << errorString; //TODO Try if this actually works emit q->error(QBluetoothSocket::UnknownSocketError); q->disconnectFromService(); @@ -327,7 +327,7 @@ void QBluetoothSocketPrivate::controlReply(ppsResult result) socket = ::open(path.toStdString().c_str(), O_RDWR); if (socket == -1) { errorString = QString::fromLocal8Bit(strerror(errno)); - qDebug() << Q_FUNC_INFO << socket << " error:" << errno << errorString; //TODO Try if this actually works + qWarning() << Q_FUNC_INFO << socket << " error:" << errno << errorString; //TODO Try if this actually works emit q->error(QBluetoothSocket::UnknownSocketError); q->disconnectFromService(); diff --git a/src/bluetooth/qbluetoothtransferreply_bluez.cpp b/src/bluetooth/qbluetoothtransferreply_bluez.cpp index 468f2d80..3c63adeb 100644 --- a/src/bluetooth/qbluetoothtransferreply_bluez.cpp +++ b/src/bluetooth/qbluetoothtransferreply_bluez.cpp @@ -76,7 +76,7 @@ QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, con bool res = QDBusConnection::sessionBus().registerObject(m_agent_path, this); if(!res) - qDebug() << "Failed Creating dbus objects"; + qWarning() << "Failed Creating dbus objects"; qRegisterMetaType<QBluetoothTransferReply*>("QBluetoothTransferReply*"); QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); @@ -264,7 +264,7 @@ void QBluetoothTransferReplyBluez::abort() QDBusPendingReply<> reply = xfer->Cancel(); reply.waitForFinished(); if(reply.isError()){ - qDebug() << "Failed to abort transfer" << reply.error(); + qWarning() << "Failed to abort transfer" << reply.error(); } delete xfer; } diff --git a/src/imports/bluetooth/qdeclarativebluetoothservice.cpp b/src/imports/bluetooth/qdeclarativebluetoothservice.cpp index 83a6fea7..0d5d0e68 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothservice.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothservice.cpp @@ -347,7 +347,7 @@ bool QDeclarativeBluetoothService::isRegistered() const int QDeclarativeBluetoothServicePrivate::listen() { if (m_protocol != "l2cap" && m_protocol != "rfcomm") { - qDebug() << "Unknown protocol, can't make service" << m_protocol; + qWarning() << "Unknown protocol, can't make service" << m_protocol; return -1; } QBluetoothServer::ServerType serverType; @@ -409,7 +409,7 @@ void QDeclarativeBluetoothService::setRegistered(bool registered) d->m_service->setServiceUuid(QBluetoothUuid(d->m_uuid)); - qDebug() << "name/uuid" << d->m_name << d->m_uuid << d->m_port; + //qDebug() << "name/uuid" << d->m_name << d->m_uuid << d->m_port; d->m_service->setAttribute(QBluetoothServiceInfo::BrowseGroupList, QBluetoothUuid(QBluetoothUuid::PublicBrowseGroup)); @@ -417,7 +417,7 @@ void QDeclarativeBluetoothService::setRegistered(bool registered) QBluetoothServiceInfo::Sequence protocolDescriptorList; QBluetoothServiceInfo::Sequence protocol; - qDebug() << "Port" << d->m_port; + //qDebug() << "Port" << d->m_port; if (d->m_protocol == "l2cap") { protocol << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::L2cap)) @@ -436,11 +436,12 @@ void QDeclarativeBluetoothService::setRegistered(bool registered) protocolDescriptorList); if (d->m_service->registerService()) { - qDebug() << "registered"; + //qDebug() << "registered"; emit registeredChanged(); } else { - qDebug() << "Failed"; + qWarning() << "Register service failed"; + //TODO propaget this error to the user } } @@ -463,7 +464,7 @@ QDeclarativeBluetoothSocket *QDeclarativeBluetoothService::nextClient() return new QDeclarativeBluetoothSocket(socket, this, 0x0); } else { - qDebug() << "Socket has no pending connection, failing"; + qWarning() << "Socket has no pending connection, failing"; return 0x0; } } @@ -480,7 +481,7 @@ void QDeclarativeBluetoothService::assignNextClient(QDeclarativeBluetoothSocket return; } else { - qDebug() << "Socket has no pending connection, failing"; + qWarning() << "Socket has no pending connection, failing"; return; } } diff --git a/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp b/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp index 41badc36..a3251c87 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp @@ -99,7 +99,7 @@ public: void connect() { Q_ASSERT(m_service); - qDebug() << "Connecting to: " << m_service->serviceInfo()->device().address().toString(); + //qDebug() << "Connecting to: " << m_service->serviceInfo()->device().address().toString(); m_error = QLatin1String("No Error"); if (m_socket) diff --git a/src/nfc/qnearfieldtagtype2.cpp b/src/nfc/qnearfieldtagtype2.cpp index 0f926bf5..b679fa9d 100644 --- a/src/nfc/qnearfieldtagtype2.cpp +++ b/src/nfc/qnearfieldtagtype2.cpp @@ -117,7 +117,7 @@ QNearFieldTagType2::~QNearFieldTagType2() */ bool QNearFieldTagType2::hasNdefMessage() { - qDebug() << Q_FUNC_INFO << "is unimplemeted"; + qWarning() << Q_FUNC_INFO << "is unimplemeted"; return false; } |