[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:13:43 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=f6bbd21

The following commit has been merged in the master branch:
commit f6bbd21ef059bd9f927e23a6b1d177dac486ebc0
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Thu Mar 15 01:00:29 2012 +0000

    Ability to start chats
---
 declarative-plugin/contact-list.cpp                | 22 +++++++++++++++++++++-
 .../contents/ui/ListContactDelegate.qml            |  7 +++++++
 org.kde.ktp.contactlist/metadata.desktop           |  2 +-
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/declarative-plugin/contact-list.cpp b/declarative-plugin/contact-list.cpp
index 89ce633..a8877af 100644
--- a/declarative-plugin/contact-list.cpp
+++ b/declarative-plugin/contact-list.cpp
@@ -24,6 +24,13 @@
 #include <TelepathyQt/AccountManager>
 #include <TelepathyQt/PendingReady>
 
+#include <KDebug>
+
+#include <KTp/Models/contact-model-item.h>
+#include <KTp/Models/accounts-model-item.h>
+
+#define PREFERRED_TEXTCHAT_HANDLER "org.freedesktop.Telepathy.Client.KDE.TextUi"
+
 ContactList::ContactList(QObject *parent)
     : QObject(parent),
       m_accountsModel(new AccountsModel(this)),
@@ -90,7 +97,20 @@ AccountsFilterModel * ContactList::filterModel() const
     return m_filterModel;
 }
 
-void ContactList::startChat(ContactModelItem *contact)
+void ContactList::startChat(ContactModelItem *contactItem)
 {
+    
+    Tp::ContactPtr contact = contactItem->contact();
+
+    kDebug() << "Requesting chat for contact" << contact->alias();
+    Tp::AccountPtr account = m_accountsModel->accountForContactItem(contactItem);
+
+    Tp::ChannelRequestHints hints;
+    hints.setHint("org.freedesktop.Telepathy.ChannelRequest","DelegateToPreferredHandler", QVariant(true));
+
+    Tp::PendingChannelRequest *channelRequest = account->ensureTextChat(contact,
+                                                                        QDateTime::currentDateTime(),
+                                                                        PREFERRED_TEXTCHAT_HANDLER,
+                                                                        hints);
 }
 
diff --git a/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml b/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml
index 9cbb7e1..904caad 100644
--- a/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml
+++ b/org.kde.ktp.contactlist/contents/ui/ListContactDelegate.qml
@@ -127,4 +127,11 @@ Item {
                 break;
         }
     }
+    
+    MouseArea {
+        anchors.fill: parent
+        onDoubleClicked: {
+            contactList.startChat(item);
+        }
+    }
 }
diff --git a/org.kde.ktp.contactlist/metadata.desktop b/org.kde.ktp.contactlist/metadata.desktop
index 01819ef..cba1016 100644
--- a/org.kde.ktp.contactlist/metadata.desktop
+++ b/org.kde.ktp.contactlist/metadata.desktop
@@ -12,7 +12,7 @@ X-Plasma-API=declarativeappletscript
 X-Plasma-MainScript=ui/main.qml
 X-Plasma-DefaultSize=200,100
 
-X-KDE-PluginInfo-Name=telepathy_contact_list
+X-KDE-PluginInfo-Name=org.kde.ktp.contactlist
 X-KDE-PluginInfo-Category=Online Services
 X-KDE-PluginInfo-Author=David Edmundson
 X-KDE-PluginInfo-Email=kde at davidedmundson.co.uk

-- 
ktp-contact-applet packaging



More information about the pkg-kde-commits mailing list