[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:48 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-filetransfer-handler.git;a=commitdiff;h=23e0d98
The following commit has been merged in the master branch:
commit 23e0d98fa39d4899a1dcba3c5abff67fa9bbd3d9
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Fri Oct 7 16:24:44 2011 +0100
Assume that telepathy is working and is dispatching the right channels
Added more Q_ASSERTs to enforce this
---
src/filetransfer-handler.cpp | 43 +++++++++++++++++--------------------------
1 file changed, 17 insertions(+), 26 deletions(-)
diff --git a/src/filetransfer-handler.cpp b/src/filetransfer-handler.cpp
index ec3037e..69073d2 100644
--- a/src/filetransfer-handler.cpp
+++ b/src/filetransfer-handler.cpp
@@ -63,19 +63,20 @@ void FileTransferHandler::handleChannels(const Tp::MethodInvocationContextPtr<>
Q_ASSERT(channels.size() == 1);
- kDebug() << "Handling new file transfer";
+ if (KTelepathy::TelepathyHandlerApplication::newJob() >= 0) {
+ context->setFinished();
+ } else {
+ context->setFinishedWithError(QLatin1String("org.freedesktop.Telepathy.KDE.FileTransfer.Exiting"),
+ i18n("File transfer handler is exiting. Cannot start job"));
+ return;
+ }
KJob* job = NULL;
- if (Tp::IncomingFileTransferChannelPtr incomingFileTransferChannel = Tp::IncomingFileTransferChannelPtr::dynamicCast(channels.first())) {
- if (KTelepathy::TelepathyHandlerApplication::newJob() >= 0) {
- context->setFinished();
- } else {
- context->setFinishedWithError(QLatin1String("org.freedesktop.Telepathy.KDE.FileTransfer.Exiting"),
- i18n("File transfer handler is exiting. Cannot start job"));
- return;
- }
- kDebug() << "Incoming File Transfer:";
+ if (!channels.first()->isRequested()) {
+ Tp::IncomingFileTransferChannelPtr incomingFileTransferChannel = Tp::IncomingFileTransferChannelPtr::dynamicCast(channels.first());
+ Q_ASSERT(incomingFileTransferChannel);
+
kDebug() << incomingFileTransferChannel->immutableProperties();
KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
@@ -87,28 +88,18 @@ void FileTransferHandler::handleChannels(const Tp::MethodInvocationContextPtr<>
// TODO Check if directory exists
job = new HandleIncomingFileTransferChannelJob(incomingFileTransferChannel, downloadDirectory, this);
- } else if (Tp::OutgoingFileTransferChannelPtr outgoingFileTransferChannel = Tp::OutgoingFileTransferChannelPtr::dynamicCast(channels.first())) {
+ } else {
+ Tp::OutgoingFileTransferChannelPtr outgoingFileTransferChannel = Tp::OutgoingFileTransferChannelPtr::dynamicCast(channels.first());
+ Q_ASSERT(outgoingFileTransferChannel);
+
+ kDebug() << outgoingFileTransferChannel->immutableProperties();
+
if (outgoingFileTransferChannel->uri().isEmpty()) {
context->setFinishedWithError(QLatin1String(TELEPATHY_QT4_ERROR_INCONSISTENT),
i18n("Cannot handle outgoing file transfer without URI"));
}
- if (KTelepathy::TelepathyHandlerApplication::newJob() >= 0) {
- context->setFinished();
- } else {
- context->setFinishedWithError(QLatin1String("org.freedesktop.Telepathy.KDE.FileTransfer.Exiting"),
- i18n("File transfer handler is exiting. Cannot start job"));
- return;
- }
-
- kDebug() << "Outgoing File Transfer:";
- kDebug() << outgoingFileTransferChannel->immutableProperties();
-
job = new HandleOutgoingFileTransferChannelJob(outgoingFileTransferChannel, this);
- } else {
- context->setFinishedWithError(QLatin1String(TELEPATHY_QT4_ERROR_INCONSISTENT),
- i18n("Unknown channel type"));
- kDebug() << "If you are reading this, then telepathy is broken";
}
if (job) {
--
ktp-filetransfer-handler packaging
More information about the pkg-kde-commits
mailing list