[SCM] ktp-filetransfer-handler packaging branch, master, updated. debian/15.12.1-2-226-g825cd93
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:12:04 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-filetransfer-handler.git;a=commitdiff;h=58d368a
The following commit has been merged in the master branch:
commit 58d368a61ee32588ede1d5d81923c5ef908589ef
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Sun Dec 18 12:33:06 2011 +0100
Show a message if file transfer cannot be resumed
---
src/handle-incoming-file-transfer-channel-job.cpp | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/handle-incoming-file-transfer-channel-job.cpp b/src/handle-incoming-file-transfer-channel-job.cpp
index 7645b46..6e20c66 100644
--- a/src/handle-incoming-file-transfer-channel-job.cpp
+++ b/src/handle-incoming-file-transfer-channel-job.cpp
@@ -49,6 +49,7 @@ class HandleIncomingFileTransferChannelJobPrivate : public KTp::TelepathyBaseJob
QFile* file;
KUrl url, partUrl;
qulonglong offset;
+ bool isResuming;
QWeakPointer<KIO::RenameDialog> renameDialog;
void init();
@@ -104,7 +105,8 @@ bool HandleIncomingFileTransferChannelJob::doKill()
HandleIncomingFileTransferChannelJobPrivate::HandleIncomingFileTransferChannelJobPrivate()
: file(0),
- offset(0)
+ offset(0),
+ isResuming(false)
{
kDebug();
}
@@ -305,6 +307,7 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__onResumeDialogFinished(in
{
QFileInfo fileInfo(partUrl.toLocalFile());
offset = fileInfo.size();
+ isResuming = true;
break;
}
case KIO::R_OVERWRITE:
@@ -388,13 +391,18 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__acceptFile()
void HandleIncomingFileTransferChannelJobPrivate::__k__onInitialOffsetDefined(qulonglong offset)
{
- kDebug();
+ kDebug() << "__k__onInitialOffsetDefined" << offset;
Q_Q(HandleIncomingFileTransferChannelJob);
- kDebug() << "__k__onInitialOffsetDefined" << offset;
- this->offset = offset;
// Some protocols do not support resuming file transfers, therefore we need
- // To connect to this method to set the real
+ // to use to this method to set the real offset
+ if (isResuming && offset == 0) {
+ kDebug() << "Impossible to resume file. Restarting.";
+ Q_EMIT q->infoMessage(q, i18n("Impossible to resume file transfer. Restarting."));
+ }
+
+ this->offset = offset;
+
file->seek(offset);
q->setProcessedAmount(KJob::Bytes, offset);
}
--
ktp-filetransfer-handler packaging
More information about the pkg-kde-commits
mailing list