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


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=6864e5a

The following commit has been merged in the master branch:
commit 6864e5a72557e65832dbd8cab377e9267e24e983
Author: Alin M Elena <alinm.elena at gmail.com>
Date:   Fri Mar 15 11:12:31 2013 +0000

    fixes gray avatars
    REVIEW: 109490
    BUG: 316743
---
 KTp/contact.cpp | 11 ++++++-----
 KTp/contact.h   |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/KTp/contact.cpp b/KTp/contact.cpp
index 84ae642..33ab04f 100644
--- a/KTp/contact.cpp
+++ b/KTp/contact.cpp
@@ -108,12 +108,13 @@ QPixmap KTp::Contact::avatarPixmap()
 {
     QPixmap avatar;
     QString file = avatarData().fileName;
+    QString avatarToken;
 
     //if the user is offline, look into the cache for avatar
     if (file.isEmpty() && presence().type() == Tp::ConnectionPresenceTypeOffline) {
         KConfig config(QLatin1String("ktelepathy-avatarsrc"));
         KConfigGroup avatarTokenGroup = config.group(id());
-        QString avatarToken = avatarTokenGroup.readEntry(QLatin1String("avatarToken"));
+        avatarToken = avatarTokenGroup.readEntry(QLatin1String("avatarToken"));
 
         if (!avatarToken.isEmpty()) {
             avatar.load(buildAvatarPath(avatarToken));
@@ -127,9 +128,9 @@ QPixmap KTp::Contact::avatarPixmap()
     }
 
     if (presence().type() == Tp::ConnectionPresenceTypeOffline) {
-        if (!QPixmapCache::find(keyCache(),avatar)){
+        if (!QPixmapCache::find(keyCache(avatarToken),avatar)){
             avatarToGray(avatar);
-            QPixmapCache::insert(keyCache(), avatar);
+            QPixmapCache::insert(keyCache(avatarToken), avatar);
         }
     }
 
@@ -150,9 +151,9 @@ void KTp::Contact::avatarToGray(QPixmap &avatar)
     avatar.setAlphaChannel(alpha);
 }
 
-QString KTp::Contact::keyCache() const
+QString KTp::Contact::keyCache(const QString &avatarToken) const
 {
-    return avatarToken()+QLatin1String("-offline");
+    return avatarToken+QLatin1String("-offline");
 }
 
 QString KTp::Contact::buildAvatarPath(const QString &avatarToken)
diff --git a/KTp/contact.h b/KTp/contact.h
index 32af16b..5eea8c1 100644
--- a/KTp/contact.h
+++ b/KTp/contact.h
@@ -52,7 +52,7 @@ Q_SIGNALS:
 
 private:
     void avatarToGray(QPixmap &avatar);
-    QString keyCache() const;
+    QString keyCache(const QString &avatarHash) const;
     QString buildAvatarPath(const QString &avatarToken);
 
 };

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list