[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:02 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-filetransfer-handler.git;a=commitdiff;h=2e9e090
The following commit has been merged in the master branch:
commit 2e9e090791d2e42fddaec02feefb48adda3be142
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Sun Dec 18 02:39:31 2011 +0100
Register incoming file transfer job only after it is accepted
---
src/handle-incoming-file-transfer-channel-job.cpp | 32 ++++++++++++++---------
src/handle-incoming-file-transfer-channel-job.h | 1 +
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/src/handle-incoming-file-transfer-channel-job.cpp b/src/handle-incoming-file-transfer-channel-job.cpp
index 4aa2fe6..ed241ef 100644
--- a/src/handle-incoming-file-transfer-channel-job.cpp
+++ b/src/handle-incoming-file-transfer-channel-job.cpp
@@ -64,6 +64,7 @@ class HandleIncomingFileTransferChannelJobPrivate : public KTp::TelepathyBaseJob
void __k__onInitialOffsetDefined(qulonglong offset);
void __k__onFileTransferChannelStateChanged(Tp::FileTransferState state, Tp::FileTransferStateChangeReason reason);
void __k__onFileTransferChannelTransferredBytesChanged(qulonglong count);
+ void __k__acceptFile();
void __k__onAcceptFileFinished(Tp::PendingOperation* op);
void __k__onCancelOperationFinished(Tp::PendingOperation* op);
void __k__onInvalidated();
@@ -91,10 +92,7 @@ HandleIncomingFileTransferChannelJob::~HandleIncomingFileTransferChannelJob()
void HandleIncomingFileTransferChannelJob::start()
{
kDebug();
- KIO::getJobTracker()->registerJob(this);
- // KWidgetJobTracker has an internal timer of 500 ms, if we don't wait here
- // when the job description is emitted it won't be ready
- QTimer::singleShot(500, this, SLOT(__k__start()));
+ QTimer::singleShot(0, this, SLOT(__k__start()));
}
bool HandleIncomingFileTransferChannelJob::doKill()
@@ -178,11 +176,6 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__start()
partUrl.addPath(url.fileName() + QLatin1String(".part"));
partUrl.setScheme(QLatin1String("file"));
- // We set the description here and then whe update it if path is changed.
- Q_EMIT q->description(q, i18n("Incoming file transfer"),
- qMakePair<QString, QString>(i18n("From"), channel->targetContact()->alias()),
- qMakePair<QString, QString>(i18n("Filename"), url.toLocalFile()));
-
QFileInfo fileInfo(url.toLocalFile()); // TODO check if it is a dir?
if (fileInfo.exists()) {
renameDialog = new KIO::RenameDialog(0,
@@ -234,10 +227,6 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__onRenameDialogFinished(in
return;
case KIO::R_RENAME:
url = renameDialog.data()->newDestUrl();
- // url is changed, we update it here
- Q_EMIT q->description(q, i18n("Incoming file transfer"),
- qMakePair<QString, QString>(i18n("From"), channel->targetContact()->alias()),
- qMakePair<QString, QString>(i18n("Filename"), url.toLocalFile()));
break;
case KIO::R_OVERWRITE:
break;
@@ -374,6 +363,23 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__onSetUriOperationFinished
kWarning() << "Unable to set the URI -" << op->errorName() << ":" << op->errorMessage();
}
+ KIO::getJobTracker()->registerJob(q);
+ // KWidgetJobTracker has an internal timer of 500 ms, if we don't wait here
+ // when the job description is emitted it won't be ready
+ // We set the description here and then whe update it if path is changed.
+
+ QTimer::singleShot(500, q, SLOT(__k__acceptFile()));
+}
+
+void HandleIncomingFileTransferChannelJobPrivate::__k__acceptFile()
+{
+ kDebug();
+ Q_Q(HandleIncomingFileTransferChannelJob);
+
+ Q_EMIT q->description(q, i18n("Incoming file transfer"),
+ qMakePair<QString, QString>(i18n("From"), channel->targetContact()->alias()),
+ qMakePair<QString, QString>(i18n("Filename"), url.toLocalFile()));
+
Tp::PendingOperation* acceptFileOperation = channel->acceptFile(offset, file);
q->connect(acceptFileOperation,
SIGNAL(finished(Tp::PendingOperation*)),
diff --git a/src/handle-incoming-file-transfer-channel-job.h b/src/handle-incoming-file-transfer-channel-job.h
index cc4334e..f47ffa5 100644
--- a/src/handle-incoming-file-transfer-channel-job.h
+++ b/src/handle-incoming-file-transfer-channel-job.h
@@ -46,6 +46,7 @@ class HandleIncomingFileTransferChannelJob : public KTp::TelepathyBaseJob
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__acceptFile())
Q_PRIVATE_SLOT(d_func(), void __k__onAcceptFileFinished(Tp::PendingOperation* op))
Q_PRIVATE_SLOT(d_func(), void __k__onCancelOperationFinished(Tp::PendingOperation* op))
Q_PRIVATE_SLOT(d_func(), void __k__onInvalidated())
--
ktp-filetransfer-handler packaging
More information about the pkg-kde-commits
mailing list