[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9
Maximiliano Curia
maxy at moszumanska.debian.org
Mon May 9 09:08:42 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=43e53b9
The following commit has been merged in the master branch:
commit 43e53b9b0d08c81ef7541363c3fba4a7ebc83694
Author: Aleix Pol <aleixpol at kde.org>
Date: Wed Feb 11 18:56:18 2015 +0100
Expose the contact Uri for a contact
Make it possible to know what's the uri for a contact, especially useful
for being able to construct a PersonData instance from the model.
---
KTp/Models/kpeopletranslationproxy.cpp | 2 ++
KTp/types.h | 2 ++
kpeople/datasourceplugin/im-persons-data-source.cpp | 6 +++++-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/KTp/Models/kpeopletranslationproxy.cpp b/KTp/Models/kpeopletranslationproxy.cpp
index 8e5f191..f6967da 100644
--- a/KTp/Models/kpeopletranslationproxy.cpp
+++ b/KTp/Models/kpeopletranslationproxy.cpp
@@ -82,6 +82,8 @@ QVariant KPeopleTranslationProxy::data(const QModelIndex &proxyIndex, int role)
// return sourceIndex.data(PersonsModel::PhotosRole);
case KTp::ContactAvatarPixmapRole:
return sourceIndex.data(KPeople::PersonsModel::PhotoRole);
+ case KTp::ContactUriRole:
+ return contact->customProperty(S_KPEOPLE_PROPERTY_CONTACT_URI);
case KTp::IdRole:
return contact->customProperty(S_KPEOPLE_PROPERTY_CONTACT_ID);
case KTp::ContactIsBlockedRole:
diff --git a/KTp/types.h b/KTp/types.h
index 7d80fc2..27eb897 100644
--- a/KTp/types.h
+++ b/KTp/types.h
@@ -81,6 +81,7 @@ namespace KTp
ContactCanVideoCallRole, ///< bool. You and contact can both video call
ContactTubesRole, ///< stringlist. common supported dbus + stream services between you and contact
+ ContactUriRole,
ContactVCardRole, ///< VCard of the contact in KContacts::Addresse format; KPeople only at the moment
//heading roles
@@ -93,6 +94,7 @@ namespace KTp
static const QString S_KPEOPLE_PROPERTY_ACCOUNT_PATH = QStringLiteral("telepathy-accountPath");
static const QString S_KPEOPLE_PROPERTY_CONTACT_ID = QStringLiteral("telepathy-contactId");
+static const QString S_KPEOPLE_PROPERTY_CONTACT_URI = QStringLiteral("telepathy-contactUri");
static const QString S_KPEOPLE_PROPERTY_PRESENCE = QStringLiteral("telepathy-presence");
static const QString S_KPEOPLE_PROPERTY_IS_BLOCKED = QStringLiteral("telepathy-isBlocked");
diff --git a/kpeople/datasourceplugin/im-persons-data-source.cpp b/kpeople/datasourceplugin/im-persons-data-source.cpp
index b76db6e..77cb67f 100644
--- a/kpeople/datasourceplugin/im-persons-data-source.cpp
+++ b/kpeople/datasourceplugin/im-persons-data-source.cpp
@@ -213,6 +213,8 @@ void KTpAllContacts::loadCache(const QString &accountId)
const QString uri = QLatin1String("ktp://") + accountId + QLatin1Char('?') + contactId;
+ addressee->insertProperty(S_KPEOPLE_PROPERTY_CONTACT_URI, uri);
+
QMap<QString, AbstractContact::Ptr>::const_iterator it = m_contactVCards.constFind(uri);
if (it != m_contactVCards.constEnd()) {
Q_EMIT contactChanged(uri, addressee);
@@ -290,7 +292,9 @@ void KTpAllContacts::onAllKnownContactsChanged(const Tp::Contacts &contactsAdded
AbstractContact::Ptr vcard = m_contactVCards.value(uri);
bool added = false;
if (!vcard) {
- vcard = AbstractContact::Ptr(new TelepathyContact);
+ QExplicitlySharedDataPointer<TelepathyContact> tpc(new TelepathyContact);
+ vcard = AbstractContact::Ptr(tpc);
+ tpc->insertProperty(S_KPEOPLE_PROPERTY_CONTACT_URI, uri);
m_contactVCards[uri] = vcard;
added = true;
}
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list