diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bluetooth/qbluetoothserviceinfo.cpp | 36 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothserviceinfo.h | 8 |
2 files changed, 25 insertions, 19 deletions
diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp index 3a864b3c..84655b77 100644 --- a/src/bluetooth/qbluetoothserviceinfo.cpp +++ b/src/bluetooth/qbluetoothserviceinfo.cpp @@ -332,18 +332,6 @@ bool QBluetoothServiceInfo::unregisterService() */ /*! - \fn QList<QBluetoothUuid> QBluetoothServiceInfo::serviceClassUuids() const - - This is a convenience function. It is equivalent to calling - attribute(QBluetoothServiceInfo::ServiceClassIds).value<QList<QBluetoothUuid> >(). - - Returns a list of UUIDs describing the service classes that this service conforms to. - - \sa attribute() -*/ - - -/*! Construct a new invalid QBluetoothServiceInfo; */ QBluetoothServiceInfo::QBluetoothServiceInfo() @@ -514,6 +502,30 @@ QBluetoothServiceInfo::Sequence QBluetoothServiceInfo::protocolDescriptor(QBluet } /*! + Returns a list of UUIDs describing the service classes that this service conforms to. + + This is a convenience function. It is equivalent to calling + attribute(QBluetoothServiceInfo::ServiceClassIds).value<QBluetoothServiceInfo::Sequence>() + and subsequently iterating over its QBluetoothUuid entries. + + \sa attribute() +*/ +QList<QBluetoothUuid> QBluetoothServiceInfo::serviceClassUuids() const +{ + QList<QBluetoothUuid> results; + + const QVariant var = attribute(QBluetoothServiceInfo::ServiceClassIds); + if (!var.isValid()) + return results; + + const QBluetoothServiceInfo::Sequence seq = var.value<QBluetoothServiceInfo::Sequence>(); + for (int i = 0; i < seq.count(); i++) + results.append(seq.at(i).value<QBluetoothUuid>()); + + return results; +} + +/*! Makes a copy of the \a other and assigns it to this QBluetoothServiceInfo object. The two copies continue to share the same service and registration details. */ diff --git a/src/bluetooth/qbluetoothserviceinfo.h b/src/bluetooth/qbluetoothserviceinfo.h index 0e6555c0..4d3b8612 100644 --- a/src/bluetooth/qbluetoothserviceinfo.h +++ b/src/bluetooth/qbluetoothserviceinfo.h @@ -141,7 +141,7 @@ public: inline void setServiceUuid(const QBluetoothUuid &uuid); inline QBluetoothUuid serviceUuid() const; - inline QList<QBluetoothUuid> serviceClassUuids() const; + QList<QBluetoothUuid> serviceClassUuids() const; QBluetoothServiceInfo &operator=(const QBluetoothServiceInfo &other); @@ -228,12 +228,6 @@ inline QBluetoothUuid QBluetoothServiceInfo::serviceUuid() const { return attribute(ServiceId).value<QBluetoothUuid>(); } - -inline QList<QBluetoothUuid> QBluetoothServiceInfo::serviceClassUuids() const -{ - return attribute(ServiceClassIds).value<QList<QBluetoothUuid> >(); -} - QT_END_NAMESPACE #endif |