diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-09-16 14:14:10 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-09-19 14:32:07 +0200 |
commit | 38181b23286ed154c2e9c2e563a48304286566cb (patch) | |
tree | 343831fe3de77cc19f1e2e9c5539760525b59737 /src/bluetooth/qbluetoothtransferreply_bluez.cpp | |
parent | ea917cfce56186ac7cddddd701cfb83f8127a751 (diff) |
Remove not needed invokeMethod() calls when emitting finished() signal
Internally the transfer reply starts via QueuedConnection. Therefore the
finished signal doesn't have to be delayed even further. In addition
document the tight restriction when being interested in signals from
QBluetoothtransferReply.
Change-Id: I0358140e96e1e9709158310c493f34ea5e40582a
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothtransferreply_bluez.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothtransferreply_bluez.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/bluetooth/qbluetoothtransferreply_bluez.cpp b/src/bluetooth/qbluetoothtransferreply_bluez.cpp index 066cab7c..ae29ce37 100644 --- a/src/bluetooth/qbluetoothtransferreply_bluez.cpp +++ b/src/bluetooth/qbluetoothtransferreply_bluez.cpp @@ -121,7 +121,7 @@ bool QBluetoothTransferReplyBluez::start() m_running = false; emit QBluetoothTransferReply::error(m_error); - QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); + emit finished(this); return false; } @@ -139,7 +139,7 @@ bool QBluetoothTransferReplyBluez::start() m_running = false; emit QBluetoothTransferReply::error(m_error); - QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); + emit finished(this); return false; } if (request().address().isNull()) { @@ -149,7 +149,7 @@ bool QBluetoothTransferReplyBluez::start() m_running = false; emit QBluetoothTransferReply::error(m_error); - QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); + emit finished(this); return false; } m_size = file->size(); @@ -207,8 +207,7 @@ void QBluetoothTransferReplyBluez::sessionCreated(QDBusPendingCallWatcher *watch m_running = false; emit QBluetoothTransferReply::error(m_error); - QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, - Q_ARG(QBluetoothTransferReply*, this)); + emit finished(this); watcher->deleteLater(); return; @@ -239,8 +238,7 @@ void QBluetoothTransferReplyBluez::sessionStarted(QDBusPendingCallWatcher *watch cleanupSession(); emit QBluetoothTransferReply::error(m_error); - QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, - Q_ARG(QBluetoothTransferReply *, this)); + emit finished(this); watcher->deleteLater(); return; @@ -292,8 +290,7 @@ void QBluetoothTransferReplyBluez::sessionChanged(const QString &interface, cleanupSession(); - QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, - Q_ARG(QBluetoothTransferReply*, this)); + emit finished(this); } // ignore "active", "queued" & "suspended" status } qCDebug(QT_BT_BLUEZ) << "Transfer update:" << interface << changed_properties; @@ -346,8 +343,7 @@ void QBluetoothTransferReplyBluez::sendReturned(QDBusPendingCallWatcher *watcher } emit QBluetoothTransferReply::error(m_error); - // allow time for the developer to connect to the signal - QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this)); + emit finished(this); } } |