[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:09 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-desktop-applets.git;a=commitdiff;h=df9b026
The following commit has been merged in the master branch:
commit df9b026f23ec6627b06d5a36d1a1e6090b941630
Author: Alexandr Akulich <akulichalexander at gmail.com>
Date: Thu Dec 5 15:14:38 2013 +0600
Contact: Partially port ContactWrapper to newer API.
ContactWrapper: Ported to KTp::Contact.
TelepathyContact: accountForPath() -> accountForObjectPath().
REVIEW: 114137
---
contact/src/contact-wrapper.cpp | 28 +++++++++-------------
contact/src/contact-wrapper.h | 11 ++++++---
.../src/declarative/contents/ui/DropDownMenu.qml | 4 ++--
contact/src/telepathy-contact.cpp | 2 +-
4 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/contact/src/contact-wrapper.cpp b/contact/src/contact-wrapper.cpp
index 6a6af5a..ea0b20f 100644
--- a/contact/src/contact-wrapper.cpp
+++ b/contact/src/contact-wrapper.cpp
@@ -71,32 +71,25 @@ QString ContactWrapper::avatar() const
bool ContactWrapper::canSendFile() const
{
- if (m_contact && m_account) {
- return (m_contact->capabilities().fileTransfers() && m_account->capabilities().fileTransfers());
- } else {
- return false;
- }
+ return m_contact && m_contact->fileTransferCapability();
+}
+
+bool ContactWrapper::canStartTextChat() const
+{
+ return m_contact && m_contact->textChatCapability();
}
bool ContactWrapper::canStartAudioCall() const
{
- if (m_contact && m_account) {
- return (m_contact->capabilities().streamedMediaAudioCalls() && m_account->capabilities().streamedMediaAudioCalls());
- } else {
- return false;
- }
+ return m_contact && m_contact->audioCallCapability();
}
bool ContactWrapper::canStartVideoCall() const
{
- if (m_contact && m_account) {
- return (m_contact->capabilities().streamedMediaVideoCalls() && m_account->capabilities().streamedMediaVideoCalls());
- } else {
- return false;
- }
+ return m_contact && m_contact->videoCallCapability();
}
-Tp::ContactPtr ContactWrapper::contact() const
+KTp::ContactPtr ContactWrapper::contact() const
{
return m_contact;
}
@@ -172,6 +165,7 @@ void ContactWrapper::updateProperties()
emit avatarChanged();
emit canSendFileChanged();
+ emit canStartTextChatChanged();
emit canStartAudioCallChanged();
emit canStartVideoCallChanged();
@@ -301,7 +295,7 @@ void ContactWrapper::setContact(const Tp::ContactPtr& newContact)
// disconnect signals
disconnectContactSignals();
- m_contact = newContact;
+ m_contact = KTp::ContactPtr::qObjectCast(newContact);
// establish new signals
connectContactSignals();
diff --git a/contact/src/contact-wrapper.h b/contact/src/contact-wrapper.h
index 0271dd4..c86a7f3 100644
--- a/contact/src/contact-wrapper.h
+++ b/contact/src/contact-wrapper.h
@@ -23,7 +23,7 @@
#include <QtCore/QObject>
#include <TelepathyQt/Account>
-#include <TelepathyQt/Contact>
+#include <KTp/contact.h>
class ContactWrapper : public QObject
{
@@ -33,6 +33,7 @@ class ContactWrapper : public QObject
Q_PROPERTY(QString avatar READ avatar NOTIFY avatarChanged)
Q_PROPERTY(bool canSendFile READ canSendFile NOTIFY canSendFileChanged)
+ Q_PROPERTY(bool canStartTextChat READ canStartTextChat NOTIFY canStartTextChatChanged)
Q_PROPERTY(bool canStartAudioCall READ canStartAudioCall NOTIFY canStartAudioCallChanged)
Q_PROPERTY(bool canStartVideoCall READ canStartVideoCall NOTIFY canStartVideoCallChanged)
@@ -52,6 +53,9 @@ public:
/** returns whether the contact can send files */
bool canSendFile() const;
+ /** returns whether the contact support textual chat */
+ bool canStartTextChat() const;
+
/** returns whether the contact can start/receive audio calls */
bool canStartAudioCall() const;
@@ -59,7 +63,7 @@ public:
bool canStartVideoCall() const;
/** returns current contact being represented */
- Tp::ContactPtr contact() const;
+ KTp::ContactPtr contact() const;
/** returns the display name of the contact */
QString displayName() const;
@@ -104,6 +108,7 @@ signals:
void avatarChanged();
void canSendFileChanged();
+ void canStartTextChatChanged();
void canStartAudioCallChanged();
void canStartVideoCallChanged();
@@ -126,7 +131,7 @@ private:
void disconnectContactSignals();
Tp::AccountPtr m_account;
- Tp::ContactPtr m_contact;
+ KTp::ContactPtr m_contact;
QString m_tempAvatar; /** this is the path to the cached avatar for when kde-telepathy is offline */
QString m_tempContactId;
};
diff --git a/contact/src/declarative/contents/ui/DropDownMenu.qml b/contact/src/declarative/contents/ui/DropDownMenu.qml
index 234d6b9..44bfc25 100644
--- a/contact/src/declarative/contents/ui/DropDownMenu.qml
+++ b/contact/src/declarative/contents/ui/DropDownMenu.qml
@@ -34,7 +34,7 @@ Item {
width: 22;
height: 22;
- enabled: TelepathyContact.isContactOnline && TelepathyContact.presenceStatus !== "offline";
+ enabled: TelepathyContact.isContactOnline && TelepathyContact.canStartTextChat;
onClicked: {
TelepathyContact.startTextChat();
@@ -48,7 +48,7 @@ Item {
width: 22;
height: 22
- enabled: TelepathyContact.isContactOnline && TelepathyContact.canStartAudioCall && TelepathyContact.presenceStatus !== "offline";
+ enabled: TelepathyContact.isContactOnline && TelepathyContact.canStartAudioCall;
onClicked: {
TelepathyContact.startAudioCall();
diff --git a/contact/src/telepathy-contact.cpp b/contact/src/telepathy-contact.cpp
index a768d6f..0fe67d6 100644
--- a/contact/src/telepathy-contact.cpp
+++ b/contact/src/telepathy-contact.cpp
@@ -104,7 +104,7 @@ void TelepathyContact::loadConfig()
}
if (!contactId.isEmpty() && !relatedAcc.isEmpty()) {
- Tp::AccountPtr account = m_accountManager->accountForPath(relatedAcc);
+ Tp::AccountPtr account = m_accountManager->accountForObjectPath(relatedAcc);
Tp::ContactPtr contact;
// check on account. Shouldn't ever be invalid
--
ktp-contact-applet packaging
More information about the pkg-kde-commits
mailing list