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


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

The following commit has been merged in the master branch:
commit 67959b454303257cd5ae639784dfc2d12d663d51
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Wed Jul 24 15:04:24 2013 +0200

    Return accountForObjectPath only for offline contacts
---
 KTp/Models/kpeopletranslationproxy.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/KTp/Models/kpeopletranslationproxy.cpp b/KTp/Models/kpeopletranslationproxy.cpp
index 8a1c2d9..a9bce37 100644
--- a/KTp/Models/kpeopletranslationproxy.cpp
+++ b/KTp/Models/kpeopletranslationproxy.cpp
@@ -56,11 +56,6 @@ QVariant KPeopleTranslationProxy::data(const QModelIndex &proxyIndex, int role)
         return QVariant();
     }
 
-    if (role == KTp::AccountRole) {
-        QString accountPath = mapToSource(proxyIndex).data(PersonsModel::UserRole).toString();
-        imPlugin->accountManager()->accountForObjectPath(accountPath);
-    }
-
     switch (role) {
         case KTp::ContactPresenceTypeRole:
             return translatePresence(mapToSource(proxyIndex).data(PersonsModel::PresenceTypeRole));
@@ -118,6 +113,9 @@ QVariant KPeopleTranslationProxy::data(const QModelIndex &proxyIndex, int role)
 
     if (!contact.isNull()) {
         switch (role) {
+            case KTp::AccountRole:
+                return QVariant::fromValue<Tp::AccountPtr>(imPlugin->accountForContact(contact));
+                break;
             case KTp::ContactRole:
                 return QVariant::fromValue<KTp::ContactPtr>(contact);
                 break;
@@ -143,6 +141,13 @@ QVariant KPeopleTranslationProxy::data(const QModelIndex &proxyIndex, int role)
                 return contact->clientTypes();
                 break;
         }
+    } else if (contact.isNull() && role == KTp::AccountRole) {
+        QVariant accountPath = mapToSource(proxyIndex).data(PersonsModel::UserRole);
+        if (accountPath.type() == QVariant::List) {
+            return QVariant::fromValue<Tp::AccountPtr>(imPlugin->accountManager()->accountForObjectPath(accountPath.toList().first().toString()));
+        } else {
+            return QVariant::fromValue<Tp::AccountPtr>(imPlugin->accountManager()->accountForObjectPath(accountPath.toString()));
+        }
     }
 //     }
 

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list