[SCM] ktp-contact-applet packaging branch, master, updated. debian/15.12.1-1-966-gde83ac5
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:19:08 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=4e8af8f
The following commit has been merged in the master branch:
commit 4e8af8f9ade45ee2a9f97d8748f3f6beab119868
Author: Alexandr Akulich <akulichalexander at gmail.com>
Date: Fri Nov 29 18:21:05 2013 +0600
Contact: Implemented files transfer by drag'n'drop.
FEATURE: 288562
REVIEW: 114132
---
contact/src/contact-wrapper.cpp | 14 ++++++++++++++
contact/src/contact-wrapper.h | 1 +
contact/src/declarative/contents/ui/Avatar.qml | 12 ++++++++++++
3 files changed, 27 insertions(+)
diff --git a/contact/src/contact-wrapper.cpp b/contact/src/contact-wrapper.cpp
index 6ff1be4..6a6af5a 100644
--- a/contact/src/contact-wrapper.cpp
+++ b/contact/src/contact-wrapper.cpp
@@ -272,6 +272,20 @@ void ContactWrapper::startFileTransfer()
}
}
+void ContactWrapper::startFileTransfer(const QVariantList &urls)
+{
+ if (!canSendFile()) {
+ return;
+ }
+
+ Q_FOREACH (const QVariant &urlVariant, urls) {
+ if (urlVariant.toUrl().isLocalFile()) {
+ Tp::PendingOperation *channelRequest = KTp::Actions::startFileTransfer(m_account, m_contact, urlVariant.toUrl());
+ connect(channelRequest, SIGNAL(finished(Tp::PendingOperation*)), this, SLOT(genericOperationFinished(Tp::PendingOperation*)));
+ }
+ }
+}
+
void ContactWrapper::setAccount(const Tp::AccountPtr& relatedAccount)
{
disconnectAccountSignals();
diff --git a/contact/src/contact-wrapper.h b/contact/src/contact-wrapper.h
index 778a7a0..0271dd4 100644
--- a/contact/src/contact-wrapper.h
+++ b/contact/src/contact-wrapper.h
@@ -97,6 +97,7 @@ public slots:
void startAudioCall();
void startVideoCall();
void startFileTransfer();
+ void startFileTransfer(const QVariantList &urls);
signals:
void accountOnlineChanged();
diff --git a/contact/src/declarative/contents/ui/Avatar.qml b/contact/src/declarative/contents/ui/Avatar.qml
index 4bdeb11..77c9774 100644
--- a/contact/src/declarative/contents/ui/Avatar.qml
+++ b/contact/src/declarative/contents/ui/Avatar.qml
@@ -19,6 +19,7 @@
import QtQuick 1.1
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
+import org.kde.draganddrop 1.0 as DnD
Item {
id: container;
@@ -45,6 +46,17 @@ Item {
source: getFrameForAvatarPresence(TelepathyContact.presenceStatus)
}
+ DnD.DropArea {
+ id: dropArea
+ anchors.fill: parent
+ enabled: TelepathyContact.canSendFile
+ onDrop: {
+ if (event.mimeData.url!="") {
+ TelepathyContact.startFileTransfer(event.mimeData.urls)
+ }
+ }
+ }
+
function getFrameForAvatarPresence(presenceStatus)
{
switch (presenceStatus) {
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list