Fix receiving payloads using a bluetooth connection
Summary: This fixes receiving payloads using the bluetooth backend. This looks like some bug in Qt, but I couldn't figure out what happens exactly (will report a bug though). Test Plan: Receiving files now works! Reviewers: #kde_connect, apol Reviewed By: #kde_connect, apol Subscribers: kdeconnect, nicolasfella, apol, #kde_connect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D12153
This commit is contained in:
parent
f145ef8833
commit
7cab490cc5
2 changed files with 4 additions and 2 deletions
|
@ -35,6 +35,7 @@ QSharedPointer<QIODevice> BluetoothDownloadJob::payload() const
|
||||||
|
|
||||||
void BluetoothDownloadJob::start()
|
void BluetoothDownloadJob::start()
|
||||||
{
|
{
|
||||||
connect(mSocket.data(), SIGNAL(disconnected()), this, SLOT(deleteLater()));
|
connect(mSocket.data(), &QBluetoothSocket::disconnected, mSocket.data(), &QBluetoothSocket::readyRead);
|
||||||
|
connect(mSocket.data(), &QBluetoothSocket::disconnected, mSocket.data(), &QBluetoothSocket::readChannelFinished);
|
||||||
mSocket->connectToService(mRemoteAddress, mTransferUuid, QIODevice::ReadOnly);
|
mSocket->connectToService(mRemoteAddress, mTransferUuid, QIODevice::ReadOnly);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,8 @@ FileTransferJob::FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64
|
||||||
, m_size(size)
|
, m_size(size)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_origin);
|
Q_ASSERT(m_origin);
|
||||||
Q_ASSERT(m_origin->isReadable());
|
//Disabled this assert: QBluetoothSocket doesn't report "->isReadable() == true" until it's connected
|
||||||
|
//Q_ASSERT(m_origin->isReadable());
|
||||||
if (m_destination.scheme().isEmpty()) {
|
if (m_destination.scheme().isEmpty()) {
|
||||||
qCWarning(KDECONNECT_CORE) << "Destination QUrl" << m_destination << "lacks a scheme. Setting its scheme to 'file'.";
|
qCWarning(KDECONNECT_CORE) << "Destination QUrl" << m_destination << "lacks a scheme. Setting its scheme to 'file'.";
|
||||||
m_destination.setScheme(QStringLiteral("file"));
|
m_destination.setScheme(QStringLiteral("file"));
|
||||||
|
|
Loading…
Reference in a new issue