summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothtransferreply_bluez.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-09-16 14:04:02 +0200
committerAlex Blasche <alexander.blasche@digia.com>2014-09-18 10:09:50 +0200
commitea917cfce56186ac7cddddd701cfb83f8127a751 (patch)
tree41ef97aba23df27474ca19322b28f9230588ce47 /src/bluetooth/qbluetoothtransferreply_bluez.cpp
parente04e8f8aec8afe130427d88a3ae891f0d1bc751f (diff)
Add missing error() signal to QBluetoothTransferReply
The signal makes error handling much more conveniant. One error situation on QNX did not emit the required finished()/errorType() signals when required. A few minor typo fixes. Task-number: QTBUG-38983 Change-Id: I89c3fbee43921c8894a0ab200ee5550e7dc44543 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothtransferreply_bluez.cpp')
-rw-r--r--src/bluetooth/qbluetoothtransferreply_bluez.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothtransferreply_bluez.cpp b/src/bluetooth/qbluetoothtransferreply_bluez.cpp
index be5fccd0..066cab7c 100644
--- a/src/bluetooth/qbluetoothtransferreply_bluez.cpp
+++ b/src/bluetooth/qbluetoothtransferreply_bluez.cpp
@@ -69,8 +69,6 @@ QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, con
setRequest(request);
setManager(parent);
- qRegisterMetaType<QBluetoothTransferReply*>("QBluetoothTransferReply*");
-
if (isBluez5()) {
m_clientBluez = new OrgBluezObexClient1Interface(QStringLiteral("org.bluez.obex"),
QStringLiteral("/org/bluez/obex"),
@@ -121,6 +119,8 @@ bool QBluetoothTransferReplyBluez::start()
m_error = QBluetoothTransferReply::IODeviceNotReadableError;
m_finished = true;
m_running = false;
+
+ emit QBluetoothTransferReply::error(m_error);
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this));
return false;
}
@@ -137,6 +137,8 @@ bool QBluetoothTransferReplyBluez::start()
m_error = QBluetoothTransferReply::FileNotFoundError;
m_finished = true;
m_running = false;
+
+ emit QBluetoothTransferReply::error(m_error);
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this));
return false;
}
@@ -145,6 +147,8 @@ bool QBluetoothTransferReplyBluez::start()
m_error = QBluetoothTransferReply::HostNotFoundError;
m_finished = true;
m_running = false;
+
+ emit QBluetoothTransferReply::error(m_error);
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection, Q_ARG(QBluetoothTransferReply*, this));
return false;
}
@@ -201,6 +205,8 @@ void QBluetoothTransferReplyBluez::sessionCreated(QDBusPendingCallWatcher *watch
m_error = QBluetoothTransferReply::HostNotFoundError;
m_finished = true;
m_running = false;
+
+ emit QBluetoothTransferReply::error(m_error);
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection,
Q_ARG(QBluetoothTransferReply*, this));
@@ -232,6 +238,7 @@ void QBluetoothTransferReplyBluez::sessionStarted(QDBusPendingCallWatcher *watch
cleanupSession();
+ emit QBluetoothTransferReply::error(m_error);
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection,
Q_ARG(QBluetoothTransferReply *, this));
@@ -276,6 +283,8 @@ void QBluetoothTransferReplyBluez::sessionChanged(const QString &interface,
if (s == QStringLiteral("error")) {
m_error = QBluetoothTransferReply::UnknownError;
m_errorStr = tr("Unknown Error");
+
+ emit QBluetoothTransferReply::error(m_error);
} else { // complete
// allow progress bar to complete
emit transferProgress(m_size, m_size);
@@ -336,6 +345,7 @@ void QBluetoothTransferReplyBluez::sendReturned(QDBusPendingCallWatcher *watcher
m_error = QBluetoothTransferReply::UnknownError;
}
+ 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));
}
@@ -376,6 +386,7 @@ void QBluetoothTransferReplyBluez::Error(const QDBusObjectPath &in0, const QStri
m_error = QBluetoothTransferReply::UnknownError;
}
+ emit QBluetoothTransferReply::error(m_error);
emit finished(this);
}
@@ -444,6 +455,7 @@ void QBluetoothTransferReplyBluez::abort()
cleanupSession();
+ emit QBluetoothTransferReply::error(m_error);
emit finished(this);
}
}