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


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

The following commit has been merged in the master branch:
commit 756c6012dc0e26d251fc65bcb434c973150e0d4b
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Tue Mar 16 21:28:12 2010 +0000

    Cascade properties better to metacontacts in the case of fake-meta-contacts.
    
    svn path=/trunk/playground/network/telepathy-contactlist/; revision=1104156
---
 contact-item.cpp        |  6 ++++++
 contact-item.h          |  1 +
 contacts-list-model.cpp |  4 ++--
 meta-contact-item.cpp   | 20 +++++++++++++++++++-
 meta-contact-item.h     |  4 ++++
 5 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/contact-item.cpp b/contact-item.cpp
index 3a59c34..5db6999 100644
--- a/contact-item.cpp
+++ b/contact-item.cpp
@@ -53,6 +53,12 @@ QString ContactItem::displayName() const
     return m_imAccount.imNicknames().first();
 }
 
+QString ContactItem::accountIdentifier() const
+{
+    // Return the IM Account Identifier.
+    return m_imAccount.imIDs().first();
+}
+
 void ContactItem::updatePresenceIcon()
 {
     // First, delete the old Icon.
diff --git a/contact-item.h b/contact-item.h
index f6e2da1..7a40fd5 100644
--- a/contact-item.h
+++ b/contact-item.h
@@ -46,6 +46,7 @@ public:
     ~ContactItem();
 
     QString displayName() const;
+    QString accountIdentifier() const;
     const KIcon& presenceIcon() const;
     qint64 presenceType() const;
     QStringList groups() const;
diff --git a/contacts-list-model.cpp b/contacts-list-model.cpp
index 1b49182..56eaca4 100644
--- a/contacts-list-model.cpp
+++ b/contacts-list-model.cpp
@@ -139,7 +139,7 @@ QVariant ContactsListModel::data(const QModelIndex &index, int role) const
         switch(role)
         {
         case Qt::DisplayRole:
-            data.setValue<QString>(contactItem->displayName());
+            data.setValue<QString>(contactItem->accountIdentifier());
             break;
         case Qt::DecorationRole:
             data.setValue<QIcon>(contactItem->presenceIcon());
@@ -168,7 +168,7 @@ QVariant ContactsListModel::data(const QModelIndex &index, int role) const
             data.setValue<QString>(metaContactItem->displayName());
             break;
         case Qt::DecorationRole:
-//            data.setValue<QIcon>(contactItem->presenceIcon());
+            data.setValue<QIcon>(metaContactItem->presenceIcon());
             break;
         case ContactsListModel::PresenceTypeRole:
 //            data.setValue<qint64>(contactItem->presenceType());
diff --git a/meta-contact-item.cpp b/meta-contact-item.cpp
index 02baba7..b7844e1 100644
--- a/meta-contact-item.cpp
+++ b/meta-contact-item.cpp
@@ -24,11 +24,13 @@
 #include "contact-item.h"
 
 #include <KDebug>
+#include <KIcon>
 
 MetaContactItem::MetaContactItem(MetaContactType type, QObject *parent)
   : QObject(parent),
     AbstractTreeItem(),
-    m_type(type)
+    m_type(type),
+    m_invalidPresenceIcon(new KIcon())
 {
     if (type == RealMetaContact) {
         // A Real metacontact. Wait for the setPimoPerson to be called before
@@ -78,6 +80,22 @@ QString MetaContactItem::displayName() const
     return item->displayName();
 }
 
+const KIcon &MetaContactItem::presenceIcon() const
+{
+    // FIXME: What should we actually return here?
+    if (childItems().isEmpty()) {
+        return *m_invalidPresenceIcon;
+    }
+
+    ContactItem *item = dynamic_cast<ContactItem*>(childItems().first());
+
+    if (!item) {
+        return *m_invalidPresenceIcon;
+    }
+
+    return item->presenceIcon();
+}
+
 
 #include "meta-contact-item.moc"
 
diff --git a/meta-contact-item.h b/meta-contact-item.h
index ae1b72e..b9414ee 100644
--- a/meta-contact-item.h
+++ b/meta-contact-item.h
@@ -30,6 +30,8 @@
 
 #include <QObject>
 
+class KIcon;
+
 class MetaContactItem : public QObject,
                         public AbstractTreeItem,
                         protected NepomukSignalWatcher::Watcher
@@ -47,6 +49,7 @@ public:
     ~MetaContactItem();
 
     QString displayName() const;
+    const KIcon &presenceIcon() const;
 
     void setPimoPerson(const Nepomuk::Person &pimoPerson);
 
@@ -63,6 +66,7 @@ private:
 
     MetaContactType m_type;
     Nepomuk::Person m_pimoPerson;
+    KIcon *m_invalidPresenceIcon;
 };
 
 

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list