[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:12:20 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=2410625

The following commit has been merged in the master branch:
commit 2410625de3a23ffbf3fb97f16d562d330bf6e32d
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Fri Feb 1 18:50:32 2013 +0100

    Last bunch of porting \o/
---
 contact-delegate.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/contact-delegate.cpp b/contact-delegate.cpp
index 4dd7162..923be5e 100644
--- a/contact-delegate.cpp
+++ b/contact-delegate.cpp
@@ -34,6 +34,7 @@
 #include <KGlobalSettings>
 #include <KDE/KLocale>
 
+#include <KTp/types.h>
 #include <KTp/presence.h>
 
 ContactDelegate::ContactDelegate(QObject * parent)
@@ -68,7 +69,7 @@ void ContactDelegate::paintContact(QPainter *painter, const QStyleOptionViewItem
     iconRect.moveTo(QPoint(iconRect.x() + m_spacing, iconRect.y() + m_spacing));
 
     QPixmap avatar;
-    avatar.load(index.data(ContactsModel::AvatarRole).toString());
+    avatar.load(index.data(KTp::ContactAvatarPathRole).toString());
 
     bool noContactAvatar = avatar.isNull();
 
@@ -91,12 +92,10 @@ void ContactDelegate::paintContact(QPainter *painter, const QStyleOptionViewItem
         painter->drawPath(roundedPath);
     }
 
-    KTp::Presence presence = index.data(ContactsModel::PresenceRole).value<KTp::Presence>();
-
     // This value is used to set the correct width for the username and the presence message.
     int rightIconsWidth = m_presenceIconSize + m_spacing;
 
-    QPixmap icon = presence.icon().pixmap(KIconLoader::SizeSmallMedium);
+    QPixmap icon = KIcon(index.data(KTp::ContactPresenceIconRole).toString()).pixmap(KIconLoader::SizeSmallMedium);
 
     QRect statusIconRect = optV4.rect;
     statusIconRect.setSize(QSize(m_presenceIconSize, m_presenceIconSize));
@@ -106,7 +105,7 @@ void ContactDelegate::paintContact(QPainter *painter, const QStyleOptionViewItem
     painter->drawPixmap(statusIconRect, icon);
 
     // Right now we only check for 'phone', as that's the most interesting type.
-    if (index.data(ContactsModel::ClientTypesRole).toStringList().contains(QLatin1String("phone"))) {
+    if (index.data(KTp::ContactClientTypesRole).toStringList().contains(QLatin1String("phone"))) {
         // Additional space is needed for the icons, don't add too much spacing between the two icons
         rightIconsWidth += m_presenceIconSize + m_spacing / 2;
 
@@ -157,7 +156,7 @@ void ContactDelegate::paintContact(QPainter *painter, const QStyleOptionViewItem
 
     painter->setFont(KGlobalSettings::smallestReadableFont());
     painter->drawText(statusMsgRect,
-                      statusFontMetrics.elidedText(presence.statusMessage().simplified(),
+                      statusFontMetrics.elidedText(index.data(KTp::ContactPresenceMessageRole).toString().trimmed(),
                                                    Qt::ElideRight, statusMsgRect.width()));
 
     painter->restore();

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list