summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2021-08-24 12:42:24 +0200
committerAndreas Buhr <andreas.buhr@qt.io>2021-09-01 08:52:16 +0200
commit87cdb77e726b529058e426a591cb552ad8dc1cf8 (patch)
treeb8e80dc40684e9e81911b283d954062f74c036ed
parent381fb6335b268535391b33e701b889ad086c1dca (diff)
Rename QBluetoothSocketPrivate to QBluetoothSocketPrivateDarwin
The macOS implementation of the private class of QBluetoothSocket was named "QBluetoothSocketPrivate" with no hint in the name that it is the macOS implementation. This patch renames it to "QBluetoothSocketPrivateDarwin". We have chosen "Darwin" as suffix as most macOS specific classes have "Darwin" in their name. Change-Id: I888f3e447a9bbbd00f55fe126cd3cc14211faa58 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--src/bluetooth/qbluetoothserver_bluez.cpp2
-rw-r--r--src/bluetooth/qbluetoothserver_macos.mm4
-rw-r--r--src/bluetooth/qbluetoothsocket.cpp2
-rw-r--r--src/bluetooth/qbluetoothsocket.h2
-rw-r--r--src/bluetooth/qbluetoothsocket_macos.mm58
-rw-r--r--src/bluetooth/qbluetoothsocket_macos_p.h6
6 files changed, 37 insertions, 37 deletions
diff --git a/src/bluetooth/qbluetoothserver_bluez.cpp b/src/bluetooth/qbluetoothserver_bluez.cpp
index 15610dbb..4733f581 100644
--- a/src/bluetooth/qbluetoothserver_bluez.cpp
+++ b/src/bluetooth/qbluetoothserver_bluez.cpp
@@ -187,7 +187,7 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port)
/* Negative socket descriptor is not always an error case
* Another cause could be a call to close()/abort()
* Check whether we can recover by re-creating the socket
- * we should really call Bluez::QBluetoothSocketPrivate::ensureNativeSocket
+ * we should really call Bluez::QBluetoothSocketPrivateDarwin::ensureNativeSocket
* but a re-creation of the socket will do as well.
*/
diff --git a/src/bluetooth/qbluetoothserver_macos.mm b/src/bluetooth/qbluetoothserver_macos.mm
index c6286c3f..0c363e7d 100644
--- a/src/bluetooth/qbluetoothserver_macos.mm
+++ b/src/bluetooth/qbluetoothserver_macos.mm
@@ -390,10 +390,10 @@ QBluetoothSocket *QBluetoothServer::nextPendingConnection()
d_ptr->pendingConnections.pop_front();
if (d_ptr->serverType == ServiceInfo::RfcommProtocol) {
- if (!static_cast<QBluetoothSocketPrivate *>(newSocket->d_ptr)->setRFCOMChannel(channel.getAs<IOBluetoothRFCOMMChannel>()))
+ if (!static_cast<QBluetoothSocketPrivateDarwin *>(newSocket->d_ptr)->setRFCOMChannel(channel.getAs<IOBluetoothRFCOMMChannel>()))
return nullptr;
} else {
- if (!static_cast<QBluetoothSocketPrivate *>(newSocket->d_ptr)->setL2CAPChannel(channel.getAs<IOBluetoothL2CAPChannel>()))
+ if (!static_cast<QBluetoothSocketPrivateDarwin *>(newSocket->d_ptr)->setL2CAPChannel(channel.getAs<IOBluetoothL2CAPChannel>()))
return nullptr;
}
diff --git a/src/bluetooth/qbluetoothsocket.cpp b/src/bluetooth/qbluetoothsocket.cpp
index 902a35f6..b2168dfd 100644
--- a/src/bluetooth/qbluetoothsocket.cpp
+++ b/src/bluetooth/qbluetoothsocket.cpp
@@ -271,7 +271,7 @@ static QBluetoothSocketBasePrivate *createSocketPrivate()
#elif defined(QT_WINRT_BLUETOOTH)
return new QBluetoothSocketPrivateWinRT();
#elif defined(QT_OSX_BLUETOOTH)
- return new QBluetoothSocketPrivate();
+ return new QBluetoothSocketPrivateDarwin();
#else
return new QBluetoothSocketPrivateDummy();
#endif
diff --git a/src/bluetooth/qbluetoothsocket.h b/src/bluetooth/qbluetoothsocket.h
index 90bdac56..6a34fd7b 100644
--- a/src/bluetooth/qbluetoothsocket.h
+++ b/src/bluetooth/qbluetoothsocket.h
@@ -62,7 +62,7 @@ class Q_BLUETOOTH_EXPORT QBluetoothSocket : public QIODevice
friend class QBluetoothServer;
friend class QBluetoothServerPrivate;
- friend class QBluetoothSocketPrivate;
+ friend class QBluetoothSocketPrivateDarwin;
friend class QBluetoothSocketPrivateAndroid;
friend class QBluetoothSocketPrivateBluez;
friend class QBluetoothSocketPrivateBluezDBus;
diff --git a/src/bluetooth/qbluetoothsocket_macos.mm b/src/bluetooth/qbluetoothsocket_macos.mm
index 993fc57f..714f788a 100644
--- a/src/bluetooth/qbluetoothsocket_macos.mm
+++ b/src/bluetooth/qbluetoothsocket_macos.mm
@@ -68,17 +68,17 @@ using ObjCRFCOMMChannel = QT_MANGLE_NAMESPACE(DarwinBTRFCOMMChannel);
} // unnamed namespace
-QBluetoothSocketPrivate::QBluetoothSocketPrivate()
+QBluetoothSocketPrivateDarwin::QBluetoothSocketPrivateDarwin()
: writeChunk(std::numeric_limits<UInt16>::max())
{
q_ptr = nullptr;
}
-QBluetoothSocketPrivate::~QBluetoothSocketPrivate()
+QBluetoothSocketPrivateDarwin::~QBluetoothSocketPrivateDarwin()
{
}
-bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothServiceInfo::Protocol type)
+bool QBluetoothSocketPrivateDarwin::ensureNativeSocket(QBluetoothServiceInfo::Protocol type)
{
// For now - very simplistic, we don't call it in this file, public class
// only calls it in a ctor, setting the protocol RFCOMM (in case of Android)
@@ -88,24 +88,24 @@ bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothServiceInfo::Protocol
return type != QBluetoothServiceInfo::UnknownProtocol;
}
-QString QBluetoothSocketPrivate::localName() const
+QString QBluetoothSocketPrivateDarwin::localName() const
{
const QBluetoothLocalDevice device;
return device.name();
}
-QBluetoothAddress QBluetoothSocketPrivate::localAddress() const
+QBluetoothAddress QBluetoothSocketPrivateDarwin::localAddress() const
{
const QBluetoothLocalDevice device;
return device.address();
}
-quint16 QBluetoothSocketPrivate::localPort() const
+quint16 QBluetoothSocketPrivateDarwin::localPort() const
{
return 0;
}
-QString QBluetoothSocketPrivate::peerName() const
+QString QBluetoothSocketPrivateDarwin::peerName() const
{
QT_BT_MAC_AUTORELEASEPOOL;
@@ -124,7 +124,7 @@ QString QBluetoothSocketPrivate::peerName() const
return QString();
}
-QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const
+QBluetoothAddress QBluetoothSocketPrivateDarwin::peerAddress() const
{
BluetoothDeviceAddress addr = {};
if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
@@ -138,7 +138,7 @@ QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const
return DarwinBluetooth::qt_address(&addr);
}
-quint16 QBluetoothSocketPrivate::peerPort() const
+quint16 QBluetoothSocketPrivateDarwin::peerPort() const
{
if (socketType == QBluetoothServiceInfo::RfcommProtocol) {
if (rfcommChannel)
@@ -151,7 +151,7 @@ quint16 QBluetoothSocketPrivate::peerPort() const
return 0;
}
-void QBluetoothSocketPrivate::abort()
+void QBluetoothSocketPrivateDarwin::abort()
{
// Can never be called while we're in connectToService:
Q_ASSERT_X(!isConnecting, Q_FUNC_INFO, "internal inconsistency - "
@@ -169,7 +169,7 @@ void QBluetoothSocketPrivate::abort()
}
-void QBluetoothSocketPrivate::close()
+void QBluetoothSocketPrivateDarwin::close()
{
// Can never be called while we're in connectToService:
Q_ASSERT_X(!isConnecting, Q_FUNC_INFO, "internal inconsistency - "
@@ -180,7 +180,7 @@ void QBluetoothSocketPrivate::close()
}
-qint64 QBluetoothSocketPrivate::writeData(const char *data, qint64 maxSize)
+qint64 QBluetoothSocketPrivateDarwin::writeData(const char *data, qint64 maxSize)
{
Q_ASSERT_X(data, Q_FUNC_INFO, "invalid data (null)");
Q_ASSERT_X(maxSize > 0, Q_FUNC_INFO, "invalid data size");
@@ -203,7 +203,7 @@ qint64 QBluetoothSocketPrivate::writeData(const char *data, qint64 maxSize)
return maxSize;
}
-qint64 QBluetoothSocketPrivate::readData(char *data, qint64 maxSize)
+qint64 QBluetoothSocketPrivateDarwin::readData(char *data, qint64 maxSize)
{
if (!data)
return 0;
@@ -220,22 +220,22 @@ qint64 QBluetoothSocketPrivate::readData(char *data, qint64 maxSize)
return 0;
}
-qint64 QBluetoothSocketPrivate::bytesAvailable() const
+qint64 QBluetoothSocketPrivateDarwin::bytesAvailable() const
{
return buffer.size();
}
-bool QBluetoothSocketPrivate::canReadLine() const
+bool QBluetoothSocketPrivateDarwin::canReadLine() const
{
return buffer.canReadLine();
}
-qint64 QBluetoothSocketPrivate::bytesToWrite() const
+qint64 QBluetoothSocketPrivateDarwin::bytesToWrite() const
{
return txBuffer.size();
}
-bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType,
+bool QBluetoothSocketPrivateDarwin::setSocketDescriptor(int socketDescriptor, QBluetoothServiceInfo::Protocol socketType,
QBluetoothSocket::SocketState socketState, QIODevice::OpenMode openMode)
{
Q_UNUSED(socketDescriptor);
@@ -248,7 +248,7 @@ bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoo
return true;
}
-void QBluetoothSocketPrivate::connectToServiceHelper(const QBluetoothAddress &address, quint16 port,
+void QBluetoothSocketPrivateDarwin::connectToServiceHelper(const QBluetoothAddress &address, quint16 port,
QIODevice::OpenMode openMode)
{
Q_UNUSED(address);
@@ -256,7 +256,7 @@ void QBluetoothSocketPrivate::connectToServiceHelper(const QBluetoothAddress &ad
Q_UNUSED(openMode);
}
-void QBluetoothSocketPrivate::connectToService(const QBluetoothServiceInfo &service, QIODevice::OpenMode openMode)
+void QBluetoothSocketPrivateDarwin::connectToService(const QBluetoothServiceInfo &service, QIODevice::OpenMode openMode)
{
Q_ASSERT(q_ptr);
@@ -299,7 +299,7 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothServiceInfo &serv
}
}
-void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid,
+void QBluetoothSocketPrivateDarwin::connectToService(const QBluetoothAddress &address, const QBluetoothUuid &uuid,
QIODevice::OpenMode openMode)
{
Q_ASSERT(q_ptr);
@@ -328,7 +328,7 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address,
q_ptr->doDeviceDiscovery(service, openMode);
}
-void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address, quint16 port,
+void QBluetoothSocketPrivateDarwin::connectToService(const QBluetoothAddress &address, quint16 port,
QIODevice::OpenMode mode)
{
Q_ASSERT(q_ptr);
@@ -414,7 +414,7 @@ void QBluetoothSocketPrivate::connectToService(const QBluetoothAddress &address,
}
}
-void QBluetoothSocketPrivate::_q_writeNotify()
+void QBluetoothSocketPrivateDarwin::_q_writeNotify()
{
Q_ASSERT_X(socketType == QBluetoothServiceInfo::L2capProtocol
|| socketType == QBluetoothServiceInfo::RfcommProtocol,
@@ -448,7 +448,7 @@ void QBluetoothSocketPrivate::_q_writeNotify()
close();
}
-bool QBluetoothSocketPrivate::setRFCOMChannel(void *generic)
+bool QBluetoothSocketPrivateDarwin::setRFCOMChannel(void *generic)
{
// A special case "constructor": on OS X we do not have a real listening socket,
// instead a bluetooth server "listens" for channel open notifications and
@@ -473,7 +473,7 @@ bool QBluetoothSocketPrivate::setRFCOMChannel(void *generic)
return rfcommChannel;
}
-bool QBluetoothSocketPrivate::setL2CAPChannel(void *generic)
+bool QBluetoothSocketPrivateDarwin::setL2CAPChannel(void *generic)
{
// A special case "constructor": on OS X we do not have a real listening socket,
// instead a bluetooth server "listens" for channel open notifications and
@@ -498,7 +498,7 @@ bool QBluetoothSocketPrivate::setL2CAPChannel(void *generic)
return l2capChannel;
}
-void QBluetoothSocketPrivate::setChannelError(IOReturn errorCode)
+void QBluetoothSocketPrivateDarwin::setChannelError(IOReturn errorCode)
{
Q_UNUSED(errorCode);
@@ -513,7 +513,7 @@ void QBluetoothSocketPrivate::setChannelError(IOReturn errorCode)
}
}
-void QBluetoothSocketPrivate::channelOpenComplete()
+void QBluetoothSocketPrivateDarwin::channelOpenComplete()
{
Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)");
@@ -528,7 +528,7 @@ void QBluetoothSocketPrivate::channelOpenComplete()
}
}
-void QBluetoothSocketPrivate::channelClosed()
+void QBluetoothSocketPrivateDarwin::channelClosed()
{
Q_ASSERT_X(q_ptr, Q_FUNC_INFO, "invalid q_ptr (null)");
@@ -546,7 +546,7 @@ void QBluetoothSocketPrivate::channelClosed()
}
}
-void QBluetoothSocketPrivate::readChannelData(void *data, std::size_t size)
+void QBluetoothSocketPrivateDarwin::readChannelData(void *data, std::size_t size)
{
Q_ASSERT_X(data, Q_FUNC_INFO, "invalid data (null)");
Q_ASSERT_X(size, Q_FUNC_INFO, "invalid data size (0)");
@@ -562,7 +562,7 @@ void QBluetoothSocketPrivate::readChannelData(void *data, std::size_t size)
} // else connectToService must check and emit readyRead!
}
-void QBluetoothSocketPrivate::writeComplete()
+void QBluetoothSocketPrivateDarwin::writeComplete()
{
_q_writeNotify();
}
diff --git a/src/bluetooth/qbluetoothsocket_macos_p.h b/src/bluetooth/qbluetoothsocket_macos_p.h
index cdc3f55a..567ff522 100644
--- a/src/bluetooth/qbluetoothsocket_macos_p.h
+++ b/src/bluetooth/qbluetoothsocket_macos_p.h
@@ -77,14 +77,14 @@ QT_BEGIN_NAMESPACE
class QBluetoothAddress;
-class QBluetoothSocketPrivate : public QBluetoothSocketBasePrivate, public DarwinBluetooth::ChannelDelegate
+class QBluetoothSocketPrivateDarwin : public QBluetoothSocketBasePrivate, public DarwinBluetooth::ChannelDelegate
{
friend class QBluetoothSocket;
friend class QBluetoothServer;
public:
- QBluetoothSocketPrivate();
- ~QBluetoothSocketPrivate();
+ QBluetoothSocketPrivateDarwin();
+ ~QBluetoothSocketPrivateDarwin();
//
bool ensureNativeSocket(QBluetoothServiceInfo::Protocol type) override;