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


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

The following commit has been merged in the master branch:
commit b51f880dccdad4ac229f3cdd1bfda4bd91edb0fa
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Wed May 1 13:18:37 2013 +0200

    Put the presence icon back in contact tooltip
    
    There used to be an icon in the tooltip which got lost with models
    porting. Now it's back.
    
    Reviewed-by: David Edmundson
    
    FIXED-IN: 0.6.2
    BUG: 319162
---
 tooltips/contacttooltip.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tooltips/contacttooltip.cpp b/tooltips/contacttooltip.cpp
index 7da02dd..288adfc 100644
--- a/tooltips/contacttooltip.cpp
+++ b/tooltips/contacttooltip.cpp
@@ -47,12 +47,14 @@ ContactToolTip::ContactToolTip(const QModelIndex &index) :
     QPixmap avatarPixmap(qvariant_cast<QPixmap>(index.data(KTp::ContactAvatarPixmapRole)));
     ui->avatarLabel->setPixmap(avatarPixmap.scaled(ui->avatarLabel->size(), Qt::KeepAspectRatio));
 
-    QString presenceMessage = index.data(KTp::ContactPresenceMessageRole).toString();
-    QString presenceIconPath = index.data(KTp::ContactPresenceIconRole).toString();
-    QString presenceText = index.data(KTp::ContactPresenceNameRole).toString();
+    KTp::Presence presence(Tp::Presence((Tp::ConnectionPresenceType)index.data(KTp::ContactPresenceTypeRole).toUInt(),
+                                        QString(), //the presence name is not needed, saves one call to the model
+                                        index.data(KTp::ContactPresenceMessageRole).toString()));
+
+    QString presenceMessage = presence.statusMessage();
+    QString presenceText = presence.displayString();
 
     if (index.data(KTp::ContactPresenceTypeRole).toInt() == Tp::ConnectionPresenceTypeError) {
-        presenceIconPath = KIconLoader::global()->iconPath("task-attention", 1);
         presenceText = i18nc("This is an IM user status", "Error Getting Presence");
 
         /** if the presence is error, the message might containt server's error,
@@ -62,7 +64,7 @@ ContactToolTip::ContactToolTip(const QModelIndex &index) :
         presenceMessage.clear();
     }
 
-    ui->presenceIcon->setPixmap(QPixmap(presenceIconPath));
+    ui->presenceIcon->setPixmap(presence.icon().pixmap(KIconLoader::SizeSmall, KIconLoader::SizeSmall));
     ui->presenceLabel->setText(presenceText);
     ui->presenceMessageLabel->setText(presenceMessage);
     ui->blockedLabel->setShown(index.data(KTp::ContactIsBlockedRole).toBool());
@@ -110,4 +112,4 @@ QString ContactToolTip::getTextWithHyperlinks(QString text)
     }
 
     return result;
-}
\ No newline at end of file
+}

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list