summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2013-09-24 12:06:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-25 11:26:51 +0200
commit905987ab1d9014289f7719099f1dcc01dd865fd5 (patch)
treed1e681d43ac681ee3c6a10ed2056a1b7bf1dd60d
parent176d5208a3301ade9fea2b0681474dbff253b6a8 (diff)
Remove private and unused API from QBluetoothServiceInfoPrivate
Presumably this API was intended to update attributes while the service info object is already registered. It was not implemented anywhere. No reason to keep it. Some minor documentation fixes Change-Id: If6b4b7c37d99027d49a7af48c282725228e9a6c7 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
-rw-r--r--src/bluetooth/qbluetoothserviceinfo.cpp29
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_bluez.cpp15
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_p.cpp12
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_p.h2
-rw-r--r--src/bluetooth/qbluetoothserviceinfo_qnx.cpp15
5 files changed, 16 insertions, 57 deletions
diff --git a/src/bluetooth/qbluetoothserviceinfo.cpp b/src/bluetooth/qbluetoothserviceinfo.cpp
index 0a1d9ee5..5ff48b4e 100644
--- a/src/bluetooth/qbluetoothserviceinfo.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo.cpp
@@ -152,14 +152,14 @@ bool QBluetoothServiceInfo::isRegistered() const
}
/*!
- \fn bool QBluetoothServiceInfo::registerService()
+ \fn bool QBluetoothServiceInfo::registerService(const QBluetoothAddress &localAdapter)
Registers this service with the platform's Service Discovery Protocol (SDP) implementation,
making it findable by other devices when they perform service discovery. Returns true if the
service is successfully registered, otherwise returns false. Once registered changes to the record
cannot be made. The service must be unregistered and registered again with the changes.
- The \l localAdapter parameter determines the local Bluetooth adapter under which
+ The \a localAdapter parameter determines the local Bluetooth adapter under which
the service should be registered. If \a localAdapter is \c null the default Bluetooth adapter
will be used. If this service info object is already registered via a local adapter
and this is function is called using a different local adapter, the previous registration
@@ -192,6 +192,9 @@ bool QBluetoothServiceInfo::unregisterService()
This is a convenience function.
Sets the attribute identified by \a attributeId to \a value.
+
+ If the service information is already registered with the platform's SDP database,
+ the database entry will not be updated until \l registerService() was called again.
*/
/*!
@@ -200,6 +203,9 @@ bool QBluetoothServiceInfo::unregisterService()
This is a convenience function.
Sets the attribute identified by \a attributeId to \a value.
+
+ If the service information is already registered with the platform's SDP database,
+ the database entry will not be updated until \l registerService() was called again.
*/
/*!
@@ -208,6 +214,9 @@ bool QBluetoothServiceInfo::unregisterService()
This is a convenience function.
Sets the attribute identified by \a attributeId to \a value.
+
+ If the service information is already registered with the platform's SDP database,
+ the database entry will not be updated until \l registerService() was called again.
*/
/*!
@@ -397,20 +406,14 @@ void QBluetoothServiceInfo::setDevice(const QBluetoothDeviceInfo &device)
/*!
Sets the attribute identified by \a attributeId to \a value.
- If the service information is registered with the platforms SDP database, the database entry is also
- updated.
+ If the service information is already registered with the platform's SDP database,
+ the database entry will not be updated until \l registerService() was called again.
\sa isRegistered(), registerService()
*/
void QBluetoothServiceInfo::setAttribute(quint16 attributeId, const QVariant &value)
{
-// if (value.type() == QVariant::List)
-// qDebug() << "tried attribute with type QVariantList" << value;
-
d_ptr->attributes[attributeId] = value;
-
- if (isRegistered())
- d_ptr->setRegisteredAttribute(attributeId, value);
}
/*!
@@ -440,13 +443,13 @@ bool QBluetoothServiceInfo::contains(quint16 attributeId) const
/*!
Removes the attribute \a attributeId from the QBluetoothServiceInfo object.
+
+ If the service information is already registered with the platforms SDP database,
+ the database entry will not be updated until \l registerService() was called again.
*/
void QBluetoothServiceInfo::removeAttribute(quint16 attributeId)
{
d_ptr->attributes.remove(attributeId);
-
- if (isRegistered())
- d_ptr->removeRegisteredAttribute(attributeId);
}
/*!
diff --git a/src/bluetooth/qbluetoothserviceinfo_bluez.cpp b/src/bluetooth/qbluetoothserviceinfo_bluez.cpp
index a24e8cea..d8344589 100644
--- a/src/bluetooth/qbluetoothserviceinfo_bluez.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo_bluez.cpp
@@ -200,21 +200,6 @@ bool QBluetoothServiceInfoPrivate::unregisterService()
return true;
}
-void QBluetoothServiceInfoPrivate::setRegisteredAttribute(quint16 attributeId, const QVariant &value)
-{
- Q_UNUSED(attributeId);
- Q_UNUSED(value);
-
- registerService();
-}
-
-void QBluetoothServiceInfoPrivate::removeRegisteredAttribute(quint16 attributeId)
-{
- Q_UNUSED(attributeId);
-
- registerService();
-}
-
bool QBluetoothServiceInfoPrivate::ensureSdpConnection(const QBluetoothAddress &localAdapter)
{
if (service && currentLocalAdapter == localAdapter)
diff --git a/src/bluetooth/qbluetoothserviceinfo_p.cpp b/src/bluetooth/qbluetoothserviceinfo_p.cpp
index 51aeb75b..e5f2f4e5 100644
--- a/src/bluetooth/qbluetoothserviceinfo_p.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo_p.cpp
@@ -68,16 +68,4 @@ bool QBluetoothServiceInfoPrivate::unregisterService()
return false;
}
-
-void QBluetoothServiceInfoPrivate::setRegisteredAttribute(quint16 attributeId, const QVariant &value)
-{
- Q_UNUSED(attributeId);
- Q_UNUSED(value);
-}
-
-void QBluetoothServiceInfoPrivate::removeRegisteredAttribute(quint16 attributeId)
-{
- Q_UNUSED(attributeId);
-}
-
QT_END_NAMESPACE
diff --git a/src/bluetooth/qbluetoothserviceinfo_p.h b/src/bluetooth/qbluetoothserviceinfo_p.h
index a98cf0e9..46ae84d4 100644
--- a/src/bluetooth/qbluetoothserviceinfo_p.h
+++ b/src/bluetooth/qbluetoothserviceinfo_p.h
@@ -70,8 +70,6 @@ public:
bool unregisterService();
- void setRegisteredAttribute(quint16 attributeId, const QVariant &value);
- void removeRegisteredAttribute(quint16 attributeId);
QBluetoothDeviceInfo deviceInfo;
QMap<quint16, QVariant> attributes;
diff --git a/src/bluetooth/qbluetoothserviceinfo_qnx.cpp b/src/bluetooth/qbluetoothserviceinfo_qnx.cpp
index cd1ecfef..b744feff 100644
--- a/src/bluetooth/qbluetoothserviceinfo_qnx.cpp
+++ b/src/bluetooth/qbluetoothserviceinfo_qnx.cpp
@@ -69,21 +69,6 @@ bool QBluetoothServiceInfoPrivate::unregisterService()
return false;
}
-
-void QBluetoothServiceInfoPrivate::setRegisteredAttribute(quint16 attributeId, const QVariant &value)
-{
- Q_UNUSED(attributeId);
- Q_UNUSED(value);
-
- registerService();
-}
-
-void QBluetoothServiceInfoPrivate::removeRegisteredAttribute(quint16 attributeId)
-{
- Q_UNUSED(attributeId);
- registered = false;
-}
-
extern QHash<QBluetoothServerPrivate*, int> __fakeServerPorts;
bool QBluetoothServiceInfoPrivate::registerService(const QBluetoothAddress& localAdapter)