From a7d01a4f0d5bdd56749e674e71d32caaa3a065b3 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Tue, 30 Jul 2013 17:44:28 +0200 Subject: Clean up for OPP - Remove Operation enum, because we only support put requests - Add the request to the transfer reply - Move startOPP to the private area Task-number: QTBUG-32726 Change-Id: If7dae547326cb74dcdd6449c08dc0d91fb8a78b2 Reviewed-by: Alex Blasche --- src/bluetooth/qbluetoothtransferreply_bluez.cpp | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/bluetooth/qbluetoothtransferreply_bluez.cpp') diff --git a/src/bluetooth/qbluetoothtransferreply_bluez.cpp b/src/bluetooth/qbluetoothtransferreply_bluez.cpp index 3e270d96..c8797894 100644 --- a/src/bluetooth/qbluetoothtransferreply_bluez.cpp +++ b/src/bluetooth/qbluetoothtransferreply_bluez.cpp @@ -57,11 +57,13 @@ static const QLatin1String agentPath("/qt/agent"); QT_BEGIN_NAMESPACE_BLUETOOTH -QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, QObject *parent) +QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, const QBluetoothTransferRequest &request, + QObject *parent) : QBluetoothTransferReply(parent), tempfile(0), source(input), m_running(false), m_finished(false), m_size(0), m_error(QBluetoothTransferReply::NoError), m_errorStr(), m_transfer_path() { + setRequest(request); client = new OrgOpenobexClientInterface(QLatin1String("org.openobex.client"), QLatin1String("/"), QDBusConnection::sessionBus()); @@ -78,6 +80,8 @@ QBluetoothTransferReplyBluez::QBluetoothTransferReplyBluez(QIODevice *input, QOb // res = QDBusConnection::sessionBus().registerService("org.qt.bt"); if(!res) qDebug() << "Failed Creating dbus objects"; + + QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection); } /*! @@ -141,7 +145,7 @@ void QBluetoothTransferReplyBluez::startOPP(QString filename) QVariantMap device; QStringList files; - device.insert(QString::fromLatin1("Destination"), address.toString()); + device.insert(QString::fromLatin1("Destination"), request().address().toString()); files << filename; QDBusObjectPath path(m_agent_path); @@ -209,7 +213,7 @@ void QBluetoothTransferReplyBluez::Error(const QDBusObjectPath &in0, const QStri void QBluetoothTransferReplyBluez::Progress(const QDBusObjectPath &in0, qulonglong in1) { Q_UNUSED(in0); - emit uploadProgress(in1, m_size); + emit transferProgress(in1, m_size); } void QBluetoothTransferReplyBluez::Release() @@ -255,21 +259,6 @@ void QBluetoothTransferReplyBluez::abort() } } -void QBluetoothTransferReplyBluez::setAddress(const QBluetoothAddress &destination) -{ - address = destination; -} - -qint64 QBluetoothTransferReplyBluez::readData(char*, qint64) -{ - return 0; -} - -qint64 QBluetoothTransferReplyBluez::writeData(const char*, qint64) -{ - return 0; -} - #include "moc_qbluetoothtransferreply_bluez_p.cpp" QT_END_NAMESPACE_BLUETOOTH -- cgit v1.2.3