summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothtransferreply_bluez.cpp
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2013-07-30 17:44:28 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-01 11:27:52 +0200
commita7d01a4f0d5bdd56749e674e71d32caaa3a065b3 (patch)
treebdeda051d19bff1dc0d7e23d3930a490309e884b /src/bluetooth/qbluetoothtransferreply_bluez.cpp
parent7b1622fc3f00b64b608670c8d3691b0e3fbb71bc (diff)
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 <alexander.blasche@digia.com>
Diffstat (limited to 'src/bluetooth/qbluetoothtransferreply_bluez.cpp')
-rw-r--r--src/bluetooth/qbluetoothtransferreply_bluez.cpp25
1 files changed, 7 insertions, 18 deletions
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