[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:11:58 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-filetransfer-handler.git;a=commitdiff;h=d29a8b1
The following commit has been merged in the master branch:
commit d29a8b101f44b762d51c86a7fd758f0d4ce8cdda
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Sun Dec 18 00:37:35 2011 +0100
Handle initialOffsetDefined signal
---
src/handle-incoming-file-transfer-channel-job.cpp | 21 ++++++++++++++++++++-
src/handle-incoming-file-transfer-channel-job.h | 1 +
src/handle-outgoing-file-transfer-channel-job.cpp | 17 ++++++++++++++++-
src/handle-outgoing-file-transfer-channel-job.h | 1 +
4 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/src/handle-incoming-file-transfer-channel-job.cpp b/src/handle-incoming-file-transfer-channel-job.cpp
index e218e6d..0205a82 100644
--- a/src/handle-incoming-file-transfer-channel-job.cpp
+++ b/src/handle-incoming-file-transfer-channel-job.cpp
@@ -55,6 +55,7 @@ class HandleIncomingFileTransferChannelJobPrivate : public KTp::TelepathyBaseJob
bool __k__kill();
void __k__onSetUriOperationFinished(Tp::PendingOperation* op);
+ void __k__onInitialOffsetDefined(qulonglong offset);
void __k__onFileTransferChannelStateChanged(Tp::FileTransferState state, Tp::FileTransferStateChangeReason reason);
void __k__onFileTransferChannelTransferredBytesChanged(qulonglong count);
void __k__onAcceptFileFinished(Tp::PendingOperation* op);
@@ -140,6 +141,9 @@ void HandleIncomingFileTransferChannelJobPrivate::init()
SIGNAL(invalidated(Tp::DBusProxy *, const QString &, const QString &)),
SLOT(__k__onInvalidated()));
q->connect(channel.data(),
+ SIGNAL(initialOffsetDefined(qulonglong)),
+ SLOT(__k__onInitialOffsetDefined(qulonglong)));
+ q->connect(channel.data(),
SIGNAL(stateChanged(Tp::FileTransferState, Tp::FileTransferStateChangeReason)),
SLOT(__k__onFileTransferChannelStateChanged(Tp::FileTransferState, Tp::FileTransferStateChangeReason)));
q->connect(channel.data(),
@@ -159,10 +163,11 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__start()
return;
}
+ offset = 0;
+
KUrl url(downloadDirectory);
url.addPath(channel->fileName());
url.setScheme(QLatin1String("file"));
- kDebug() << "File name:" << url;
// We set the description here and then whe update it if path is changed.
Q_EMIT q->description(q, i18n("Incoming file transfer"),
@@ -262,6 +267,20 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__onSetUriOperationFinished
SLOT(__k__onAcceptFileFinished(Tp::PendingOperation*)));
}
+void HandleIncomingFileTransferChannelJobPrivate::__k__onInitialOffsetDefined(qulonglong offset)
+{
+ kDebug();
+ Q_Q(HandleIncomingFileTransferChannelJob);
+
+ for (int i=0; i<30; i++)
+ 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
+ file->seek(offset);
+ q->setProcessedAmount(KJob::Bytes, offset);
+}
+
void HandleIncomingFileTransferChannelJobPrivate::__k__onFileTransferChannelStateChanged(Tp::FileTransferState state,
Tp::FileTransferStateChangeReason stateReason)
{
diff --git a/src/handle-incoming-file-transfer-channel-job.h b/src/handle-incoming-file-transfer-channel-job.h
index 9cc7ad9..f6c7701 100644
--- a/src/handle-incoming-file-transfer-channel-job.h
+++ b/src/handle-incoming-file-transfer-channel-job.h
@@ -41,6 +41,7 @@ class HandleIncomingFileTransferChannelJob : public KTp::TelepathyBaseJob
Q_PRIVATE_SLOT(d_func(), void __k__kill())
Q_PRIVATE_SLOT(d_func(), void __k__onSetUriOperationFinished(Tp::PendingOperation* op))
+ Q_PRIVATE_SLOT(d_func(), void __k__onInitialOffsetDefined(qulonglong offset))
Q_PRIVATE_SLOT(d_func(), void __k__onFileTransferChannelStateChanged(Tp::FileTransferState state, Tp::FileTransferStateChangeReason reason))
Q_PRIVATE_SLOT(d_func(), void __k__onFileTransferChannelTransferredBytesChanged(qulonglong count))
Q_PRIVATE_SLOT(d_func(), void __k__onAcceptFileFinished(Tp::PendingOperation* op))
diff --git a/src/handle-outgoing-file-transfer-channel-job.cpp b/src/handle-outgoing-file-transfer-channel-job.cpp
index c4d61c0..162e4ac 100644
--- a/src/handle-outgoing-file-transfer-channel-job.cpp
+++ b/src/handle-outgoing-file-transfer-channel-job.cpp
@@ -44,6 +44,7 @@ class HandleOutgoingFileTransferChannelJobPrivate : public KTp::TelepathyBaseJob
Tp::OutgoingFileTransferChannelPtr channel;
QFile* file;
KUrl uri;
+ qulonglong offset;
void init();
void provideFile();
@@ -51,6 +52,7 @@ class HandleOutgoingFileTransferChannelJobPrivate : public KTp::TelepathyBaseJob
void __k__start();
bool __k__kill();
+ void __k__onInitialOffsetDefined(qulonglong offset);
void __k__onFileTransferChannelStateChanged(Tp::FileTransferState state, Tp::FileTransferStateChangeReason reason);
void __k__onFileTransferChannelTransferredBytesChanged(qulonglong count);
void __k__onProvideFileFinished(Tp::PendingOperation* op);
@@ -92,7 +94,8 @@ bool HandleOutgoingFileTransferChannelJob::doKill()
}
HandleOutgoingFileTransferChannelJobPrivate::HandleOutgoingFileTransferChannelJobPrivate()
- : file(0)
+ : file(0),
+ offset(0)
{
kDebug();
}
@@ -153,6 +156,9 @@ void HandleOutgoingFileTransferChannelJobPrivate::init()
SIGNAL(invalidated(Tp::DBusProxy *, const QString &, const QString &)),
SLOT(__k__onInvalidated()));
q->connect(channel.data(),
+ SIGNAL(initialOffsetDefined(qulonglong)),
+ SLOT(__k__onInitialOffsetDefined(qulonglong)));
+ q->connect(channel.data(),
SIGNAL(stateChanged(Tp::FileTransferState, Tp::FileTransferStateChangeReason)),
SLOT(__k__onFileTransferChannelStateChanged(Tp::FileTransferState, Tp::FileTransferStateChangeReason)));
q->connect(channel.data(),
@@ -193,6 +199,15 @@ bool HandleOutgoingFileTransferChannelJobPrivate::__k__kill()
return true;
}
+void HandleOutgoingFileTransferChannelJobPrivate::__k__onInitialOffsetDefined(qulonglong offset)
+{
+ kDebug();
+ Q_Q(HandleOutgoingFileTransferChannelJob);
+
+ this->offset = offset;
+ q->setProcessedAmount(KJob::Bytes, offset);
+}
+
void HandleOutgoingFileTransferChannelJobPrivate::__k__onFileTransferChannelStateChanged(Tp::FileTransferState state,
Tp::FileTransferStateChangeReason stateReason)
{
diff --git a/src/handle-outgoing-file-transfer-channel-job.h b/src/handle-outgoing-file-transfer-channel-job.h
index f51d53b..f4b52f1 100644
--- a/src/handle-outgoing-file-transfer-channel-job.h
+++ b/src/handle-outgoing-file-transfer-channel-job.h
@@ -37,6 +37,7 @@ class HandleOutgoingFileTransferChannelJob : public KTp::TelepathyBaseJob
Q_DECLARE_PRIVATE(HandleOutgoingFileTransferChannelJob)
// // Our Q_PRIVATE_SLOTS who perform the real job
+ Q_PRIVATE_SLOT(d_func(), void __k__onInitialOffsetDefined(qulonglong offset))
Q_PRIVATE_SLOT(d_func(), void __k__onFileTransferChannelStateChanged(Tp::FileTransferState state, Tp::FileTransferStateChangeReason reason))
Q_PRIVATE_SLOT(d_func(), void __k__onFileTransferChannelTransferredBytesChanged(qulonglong count))
Q_PRIVATE_SLOT(d_func(), void __k__onProvideFileFinished(Tp::PendingOperation* op))
--
ktp-filetransfer-handler packaging
More information about the pkg-kde-commits
mailing list