[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:06:57 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=25bbc84
The following commit has been merged in the master branch:
commit 25bbc84f6eda5dc31906071f242d028aa9b96e07
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date: Tue Jul 2 14:55:18 2013 +0200
Make sure the id for pixmap cache is correct
Fixes displaying subcontacts avatars
Reviewed-by: David Edmundson
---
KTp/Models/kpeopletranslationproxy.cpp | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/KTp/Models/kpeopletranslationproxy.cpp b/KTp/Models/kpeopletranslationproxy.cpp
index 561a273..933eafd 100644
--- a/KTp/Models/kpeopletranslationproxy.cpp
+++ b/KTp/Models/kpeopletranslationproxy.cpp
@@ -184,12 +184,20 @@ QPixmap KPeopleTranslationProxy::contactPixmap(const QModelIndex &index) const
QPixmap avatar;
int presenceType = index.data(KTp::ContactPresenceTypeRole).toInt();
- const QVariantList ids = index.data(KTp::IdRole).toList();
+ //we need contact's ID to generate proper cache key for this contact
QString id;
- if (!ids.isEmpty()) {
- id = ids.first().toString();
+ if (index.data(KTp::RowTypeRole).toInt() == KTp::PersonRowType) {
+ //persons return ids as list of child contacts ids
+ const QVariantList ids = index.data(KTp::IdRole).toList();
+ if (!ids.isEmpty()) {
+ id = ids.first().toString();
+ }
+ } else {
+ //contact returns id as string
+ id = index.data(KTp::IdRole).toString();
}
+ //key for the pixmap cache, so we can look up the avatar
const QString keyCache = id + (presenceType == Tp::ConnectionPresenceTypeOffline ? QLatin1String("-offline") : QLatin1String("-online"));
//check pixmap cache for the avatar, if not present, load the avatar
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list