diff options
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp | 1 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent.cpp | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp | 5 | ||||
-rw-r--r-- | src/imports/bluetooth/plugin.cpp | 4 | ||||
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp | 11 | ||||
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothservice.cpp | 16 | ||||
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothsocket.cpp | 18 | ||||
-rw-r--r-- | src/nfc/qnx/qnxnfcmanager.cpp | 2 |
8 files changed, 34 insertions, 25 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp index 4660e84c..9abf359d 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_qnx.cpp @@ -129,7 +129,6 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() void QBluetoothDeviceDiscoveryAgentPrivate::stop() { - Q_Q(QBluetoothDeviceDiscoveryAgent); m_active = false; m_finishedTimer.stop(); if (m_currentOp == Start) { diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.cpp b/src/bluetooth/qbluetoothservicediscoveryagent.cpp index 98c02d19..eec9894f 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent.cpp @@ -456,8 +456,6 @@ void QBluetoothServiceDiscoveryAgentPrivate::startServiceDiscovery() { Q_Q(QBluetoothServiceDiscoveryAgent); - setDiscoveryState(ServiceDiscovery); - if (discoveredDevices.isEmpty()) { setDiscoveryState(Inactive); emit q->finished(); diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp index 0e4b8e7d..7af2590a 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent_qnx.cpp @@ -194,8 +194,9 @@ void QBluetoothServiceDiscoveryAgentPrivate::start(const QBluetoothAddress &addr else _q_serviceDiscoveryFinished(); #else - QByteArray filePath = QByteArray("/pps/services/bluetooth/remote_devices/").append(address.toString().toUtf8().constData()); - if ((m_rdfd = qt_safe_open(filePath.constData(), O_RDONLY)) == -1) { + qCDebug(QT_BT_QNX) << "Starting Service discovery for" << address.toString(); + const QString filePath = QStringLiteral("/pps/services/bluetooth/remote_devices/").append(address.toString()); + if ((m_rdfd = qt_safe_open(filePath.toLocal8Bit().constData(), O_RDONLY)) == -1) { if (QFile::exists(filePath + QLatin1String("-00")) || QFile::exists(filePath + QLatin1String("-01"))) { qCDebug(QT_BT_QNX) << "LE device discovered...skipping"; diff --git a/src/imports/bluetooth/plugin.cpp b/src/imports/bluetooth/plugin.cpp index be938949..bcf59794 100644 --- a/src/imports/bluetooth/plugin.cpp +++ b/src/imports/bluetooth/plugin.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ - +#include <QtCore/QLoggingCategory> #include <QtQml/QQmlEngine> #include <QtQml/QQmlExtensionPlugin> @@ -82,4 +82,6 @@ public: } }; +Q_LOGGING_CATEGORY(QT_BT_QML, "qt.bluetooth.qml") + #include "plugin.moc" diff --git a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp index 67b71902..6689d663 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp @@ -44,7 +44,8 @@ #include <QPixmap> -#include <qbluetoothdeviceinfo.h> +#include <QtCore/QLoggingCategory> +#include <QtBluetooth/QBluetoothDeviceInfo> #include <QtBluetooth/QBluetoothAddress> #include "qdeclarativebluetoothservice_p.h" @@ -91,6 +92,8 @@ \sa QBluetoothServiceDiscoveryAgent */ +Q_DECLARE_LOGGING_CATEGORY(QT_BT_QML) + class QDeclarativeBluetoothDiscoveryModelPrivate { public: @@ -214,7 +217,7 @@ QVariant QDeclarativeBluetoothDiscoveryModel::data(const QModelIndex &index, int if (discoveryMode() != DeviceDiscovery) { if (index.row() >= d->m_services.count()){ - qWarning() << "index out of bounds"; + qCWarning(QT_BT_QML) << "index out of bounds"; return QVariant(); } @@ -239,7 +242,7 @@ QVariant QDeclarativeBluetoothDiscoveryModel::data(const QModelIndex &index, int } } else { if (index.row() >= d->m_devices.count()) { - qWarning() << "index out of bounds"; + qCWarning(QT_BT_QML) << "index out of bounds"; return QVariant(); } @@ -432,7 +435,7 @@ void QDeclarativeBluetoothDiscoveryModel::setUuidFilter(QString uuid) QBluetoothUuid qbuuid(uuid); if (qbuuid.isNull()) { - qWarning() << "Invalid UUID providded " << uuid; + qCWarning(QT_BT_QML) << "Invalid UUID providded " << uuid; return; } d->m_uuid = uuid; diff --git a/src/imports/bluetooth/qdeclarativebluetoothservice.cpp b/src/imports/bluetooth/qdeclarativebluetoothservice.cpp index 7559968d..6d4e3dc0 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothservice.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothservice.cpp @@ -41,7 +41,9 @@ #include "qdeclarativebluetoothservice_p.h" -#include <qbluetoothdeviceinfo.h> +#include <QtCore/QLoggingCategory> + +#include <QtBluetooth/QBluetoothDeviceInfo> #include <QtBluetooth/QBluetoothSocket> #include <QtBluetooth/QBluetoothAddress> #include <QtBluetooth/QBluetoothServer> @@ -80,6 +82,8 @@ \endlist */ +Q_DECLARE_LOGGING_CATEGORY(QT_BT_QML) + class QDeclarativeBluetoothServicePrivate { public: @@ -269,7 +273,7 @@ bool QDeclarativeBluetoothService::isRegistered() const int QDeclarativeBluetoothServicePrivate::listen() { if (m_service->socketProtocol() == QBluetoothServiceInfo::UnknownProtocol) { - qWarning() << "Unknown protocol, can't make service" << m_protocol; + qCWarning(QT_BT_QML) << "Unknown protocol, can't make service" << m_protocol; return -1; } QBluetoothServiceInfo::Protocol serverType = QBluetoothServiceInfo::UnknownProtocol; @@ -331,7 +335,7 @@ void QDeclarativeBluetoothService::setRegistered(bool registered) protocolDescriptorList.append(QVariant::fromValue(protocol)); } else { - qWarning() << "No protocol specified for bluetooth service"; + qCWarning(QT_BT_QML) << "No protocol specified for bluetooth service"; } d->m_service->setAttribute(QBluetoothServiceInfo::ProtocolDescriptorList, protocolDescriptorList); @@ -340,7 +344,7 @@ void QDeclarativeBluetoothService::setRegistered(bool registered) emit registeredChanged(); } else { - qWarning() << "Register service failed"; + qCWarning(QT_BT_QML) << "Register service failed"; //TODO propaget this error to the user } } @@ -364,7 +368,7 @@ QDeclarativeBluetoothSocket *QDeclarativeBluetoothService::nextClient() return new QDeclarativeBluetoothSocket(socket, this, 0); } else { - qWarning() << "Socket has no pending connection, failing"; + qCWarning(QT_BT_QML) << "Socket has no pending connection, failing"; return 0; } } @@ -381,7 +385,7 @@ void QDeclarativeBluetoothService::assignNextClient(QDeclarativeBluetoothSocket return; } else { - qWarning() << "Socket has no pending connection, failing"; + qCWarning(QT_BT_QML) << "Socket has no pending connection, failing"; return; } } diff --git a/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp b/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp index a1329182..75a1b85c 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothsocket.cpp @@ -41,13 +41,13 @@ #include "qdeclarativebluetoothsocket_p.h" -#include <QPointer> -#include <QStringList> -#include <QDataStream> -#include <QByteArray> +#include <QtCore/QLoggingCategory> +#include <QtCore/QPointer> +#include <QtCore/QStringList> +#include <QtCore/QDataStream> +#include <QtCore/QByteArray> - -#include <qbluetoothdeviceinfo.h> +#include <QtBluetooth/QBluetoothDeviceInfo> #include <QtBluetooth/QBluetoothAddress> #include <QtBluetooth/QBluetoothSocket> @@ -75,6 +75,8 @@ or passing in the service return from BluetoothDiscoveryModel. */ +Q_DECLARE_LOGGING_CATEGORY(QT_BT_QML) + class QDeclarativeBluetoothSocketPrivate { public: @@ -224,7 +226,7 @@ void QDeclarativeBluetoothSocket::setConnected(bool connected) d->connect(); } else { - qWarning() << "BluetoothSocket::setConnected called before a service was set"; + qCWarning(QT_BT_QML) << "BluetoothSocket::setConnected called before a service was set"; } } @@ -341,7 +343,7 @@ QString QDeclarativeBluetoothSocket::stringData() void QDeclarativeBluetoothSocket::sendStringData(const QString &data) { if (!d->m_connected || !d->m_socket){ - qWarning() << "Writing data to unconnected socket"; + qCWarning(QT_BT_QML) << "Writing data to unconnected socket"; return; } diff --git a/src/nfc/qnx/qnxnfcmanager.cpp b/src/nfc/qnx/qnxnfcmanager.cpp index be23838e..2b644b30 100644 --- a/src/nfc/qnx/qnxnfcmanager.cpp +++ b/src/nfc/qnx/qnxnfcmanager.cpp @@ -363,7 +363,7 @@ void QNXNFCManager::setupInvokeTarget() { //Get the correct target-id QString targetId = QCoreApplication::instance()->arguments().first(); - targetId = targetId.left(targetId.lastIndexOf(".")); + targetId = targetId.left(targetId.lastIndexOf(QLatin1Char('.'))); if (BPS_SUCCESS != navigator_invoke_set_filters("20", targetId.toLatin1().constData(), filters, 1)) { qWarning() << "NFC Error setting share target filter"; |