diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-08-22 13:52:51 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-08-25 15:03:10 +0200 |
commit | d02f13307fed0bdbdf928a6b44325e8658b7c24c (patch) | |
tree | a7b9a7beed655768d984ddaf9416c92c8a780ce8 /src/bluetooth/qbluetoothsocket_bluez.cpp | |
parent | 2b5027a808e4cf525926058542786167dfed24ea (diff) |
Make QBluetoothSocket's _q_writeNotify & _q_readNotify private
These two functions are really only needed by Linux style socket code.
There is no need for other platforms to implement them as dummy too.
It simplifies the code somewhat.
Change-Id: I3e0aced8d9f7b590d1c6aaa60f97bd060ee8f4b4
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'src/bluetooth/qbluetoothsocket_bluez.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothsocket_bluez.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/bluetooth/qbluetoothsocket_bluez.cpp b/src/bluetooth/qbluetoothsocket_bluez.cpp index 50fa0272..3be1125b 100644 --- a/src/bluetooth/qbluetoothsocket_bluez.cpp +++ b/src/bluetooth/qbluetoothsocket_bluez.cpp @@ -110,9 +110,9 @@ bool QBluetoothSocketPrivate::ensureNativeSocket(QBluetoothServiceInfo::Protocol Q_Q(QBluetoothSocket); readNotifier = new QSocketNotifier(socket, QSocketNotifier::Read); - QObject::connect(readNotifier, SIGNAL(activated(int)), q, SLOT(_q_readNotify())); + QObject::connect(readNotifier, SIGNAL(activated(int)), this, SLOT(_q_readNotify())); connectWriteNotifier = new QSocketNotifier(socket, QSocketNotifier::Write, q); - QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), q, SLOT(_q_writeNotify())); + QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), this, SLOT(_q_writeNotify())); connectWriteNotifier->setEnabled(false); readNotifier->setEnabled(false); @@ -232,8 +232,6 @@ void QBluetoothSocketPrivate::_q_writeNotify() } } -// TODO: move to private backend? - void QBluetoothSocketPrivate::_q_readNotify() { Q_Q(QBluetoothSocket); @@ -483,7 +481,7 @@ qint64 QBluetoothSocketPrivate::writeData(const char *data, qint64 maxSize) if(txBuffer.size() == 0) { connectWriteNotifier->setEnabled(true); - QMetaObject::invokeMethod(q, "_q_writeNotify", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, "_q_writeNotify", Qt::QueuedConnection); } char *txbuf = txBuffer.reserve(maxSize); @@ -547,9 +545,9 @@ bool QBluetoothSocketPrivate::setSocketDescriptor(int socketDescriptor, QBluetoo fcntl(socket, F_SETFL, flags | O_NONBLOCK); readNotifier = new QSocketNotifier(socket, QSocketNotifier::Read); - QObject::connect(readNotifier, SIGNAL(activated(int)), q, SLOT(_q_readNotify())); + QObject::connect(readNotifier, SIGNAL(activated(int)), this, SLOT(_q_readNotify())); connectWriteNotifier = new QSocketNotifier(socket, QSocketNotifier::Write, q); - QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), q, SLOT(_q_writeNotify())); + QObject::connect(connectWriteNotifier, SIGNAL(activated(int)), this, SLOT(_q_writeNotify())); q->setSocketState(socketState); q->setOpenMode(openMode); |