Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7cab490c authored by Matthijs Tijink's avatar Matthijs Tijink Committed by Nicolas Fella

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
parent f145ef88
......@@ -35,6 +35,7 @@ QSharedPointer<QIODevice> BluetoothDownloadJob::payload() const
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);
}
......@@ -40,7 +40,8 @@ FileTransferJob::FileTransferJob(const QSharedPointer<QIODevice>& origin, qint64
, m_size(size)
{
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()) {
qCWarning(KDECONNECT_CORE) << "Destination QUrl" << m_destination << "lacks a scheme. Setting its scheme to 'file'.";
m_destination.setScheme(QStringLiteral("file"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment