[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:41 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-filetransfer-handler.git;a=commitdiff;h=323b233
The following commit has been merged in the master branch:
commit 323b233728e4169825d920daf891e774179ca5b3
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date: Wed Sep 28 19:35:19 2011 +0100
Add a description for the KJob
This automatically sets the open file button at the end of the file
transfer.
FEATURE: 282213
---
src/handle-incoming-file-transfer-channel-job.cpp | 8 ++++++++
src/handle-outgoing-file-transfer-channel-job.cpp | 4 ++++
src/main.cpp | 1 +
3 files changed, 13 insertions(+)
diff --git a/src/handle-incoming-file-transfer-channel-job.cpp b/src/handle-incoming-file-transfer-channel-job.cpp
index 6912a88..5bfc4a7 100644
--- a/src/handle-incoming-file-transfer-channel-job.cpp
+++ b/src/handle-incoming-file-transfer-channel-job.cpp
@@ -33,6 +33,8 @@
#include <TelepathyQt4/IncomingFileTransferChannel>
#include <TelepathyQt4/PendingReady>
#include <TelepathyQt4/PendingOperation>
+#include <TelepathyQt4/Contact>
+
class HandleIncomingFileTransferChannelJobPrivate : public KTelepathy::TelepathyBaseJobPrivate
{
@@ -204,6 +206,12 @@ void HandleIncomingFileTransferChannelJobPrivate::__k__start()
file = new QFile(url.toLocalFile(), q->parent());
kDebug() << "Saving file as" << file->fileName();
+ // We must emit the description here and not later because if
+ // setUriOperation fails and we won't know there the file is saved.
+ 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* setUriOperation = channel->setUri(url.url());
q->connect(setUriOperation,
SIGNAL(finished(Tp::PendingOperation*)),
diff --git a/src/handle-outgoing-file-transfer-channel-job.cpp b/src/handle-outgoing-file-transfer-channel-job.cpp
index 05cf7b9..bcc343b 100644
--- a/src/handle-outgoing-file-transfer-channel-job.cpp
+++ b/src/handle-outgoing-file-transfer-channel-job.cpp
@@ -31,6 +31,7 @@
#include <TelepathyQt4/OutgoingFileTransferChannel>
#include <TelepathyQt4/PendingReady>
#include <TelepathyQt4/PendingOperation>
+#include <TelepathyQt4/Contact>
class HandleOutgoingFileTransferChannelJobPrivate : public KTelepathy::TelepathyBaseJobPrivate
{
@@ -138,6 +139,9 @@ void HandleOutgoingFileTransferChannelJobPrivate::__k__start()
q->connect(channel.data(),
SIGNAL(transferredBytesChanged(qulonglong)),
SLOT(__k__onFileTransferChannelTransferredBytesChanged(qulonglong)));
+ Q_EMIT q->description(q, i18n("Outgoing file transfer"),
+ qMakePair<QString, QString>(i18n("To"), channel->targetContact()->alias()),
+ qMakePair<QString, QString>(i18n("Filename"), channel->uri()));
if (channel->state() == Tp::FileTransferStateAccepted) {
QTimer::singleShot(0, q, SLOT(__k__provideFile()));
diff --git a/src/main.cpp b/src/main.cpp
index cc9a998..9732eaa 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -48,6 +48,7 @@ int main(int argc, char* argv[])
channelFactory->addFeaturesForOutgoingFileTransfers(Tp::FileTransferChannel::FeatureCore);
Tp::ContactFactoryPtr contactFactory = Tp::ContactFactory::create();
+ contactFactory->addFeature(Tp::Contact::FeatureAlias);
Tp::ClientRegistrarPtr registrar = Tp::ClientRegistrar::create(accountFactory,
connectionFactory,
--
ktp-filetransfer-handler packaging
More information about the pkg-kde-commits
mailing list