aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppTransferManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/QXmppTransferManager.cpp')
-rw-r--r--src/client/QXmppTransferManager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/QXmppTransferManager.cpp b/src/client/QXmppTransferManager.cpp
index 6fb2da75..0784279e 100644
--- a/src/client/QXmppTransferManager.cpp
+++ b/src/client/QXmppTransferManager.cpp
@@ -1307,7 +1307,7 @@ QXmppTransferJob *QXmppTransferManager::sendFile(const QString &jid, const QStri
fileInfo.setDescription(description);
// open file
- QIODevice *device = new QFile(filePath);
+ QIODevice *device = new QFile(filePath, this);
if (!device->open(QIODevice::ReadOnly))
{
warning(QString("Could not read from %1").arg(filePath));
@@ -1342,6 +1342,7 @@ QXmppTransferJob *QXmppTransferManager::sendFile(const QString &jid, const QStri
/// Returns 0 if the \a jid is not valid.
///
/// \note The recipient's \a jid must be a full JID with a resource, for instance "user@host/resource".
+/// \note The ownership of the \a device should be managed by the caller.
///
QXmppTransferJob *QXmppTransferManager::sendFile(const QString &jid, QIODevice *device, const QXmppTransferFileInfo &fileInfo, const QString &sid)
@@ -1361,8 +1362,6 @@ QXmppTransferJob *QXmppTransferManager::sendFile(const QString &jid, QIODevice *
job->d->sid = sid;
job->d->fileInfo = fileInfo;
job->d->iodevice = device;
- if (device)
- device->setParent(job);
// check file is open
if (!device || !device->isReadable())