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


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

The following commit has been merged in the master branch:
commit 110773b4ebfc94844e9dd2f0e4ab0ea84ff5ef2c
Author: George Goldberg <grundleborg at googlemail.com>
Date:   Sat Feb 14 21:28:48 2009 +0000

    Display the accounts under the categories VALID and INVALID in the accounts list view.
    
    svn path=/trunk/playground/network/telepathy-accounts-kcm/; revision=926230
---
 KTp/Models/accounts-list-model.cpp | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/KTp/Models/accounts-list-model.cpp b/KTp/Models/accounts-list-model.cpp
index e99398c..d3512f2 100644
--- a/KTp/Models/accounts-list-model.cpp
+++ b/KTp/Models/accounts-list-model.cpp
@@ -22,6 +22,7 @@
 
 #include "account-item.h"
 
+#include <kcategorizedsortfilterproxymodel.h>
 #include <kdebug.h>
 
 #include <TelepathyQt4/Client/Account>
@@ -52,12 +53,38 @@ QVariant AccountsListModel::data(const QModelIndex &index, int role) const
 {
     // FIXME: This is a basic implementation just so I can see what's going
     // on while developing this code further. Needs expanding.
-    if(role == Qt::DisplayRole)
+    QVariant data;
+
+    switch(role)
     {
-        return QVariant(m_readyAccounts.at(index.row())->account()->displayName());
+    case Qt::DisplayRole:
+        data = QVariant(m_readyAccounts.at(index.row())->account()->displayName());
+        break;
+    case KCategorizedSortFilterProxyModel::CategoryDisplayRole:
+        if(m_readyAccounts.at(index.row())->account()->isValidAccount())
+        {
+            data = QVariant(QString("Valid Accounts"));
+        }
+        else
+        {
+            data = QVariant(QString("Invalid Accounts"));
+        }
+        break;
+    case KCategorizedSortFilterProxyModel::CategorySortRole:
+        if(m_readyAccounts.at(index.row())->account()->isValidAccount())
+        {
+            data = QVariant(4);
+        }
+        else
+        {
+            data = QVariant(5);
+        }
+        break;
+    default:
+        break;
     }
 
-    return QVariant();
+    return data;
 }
 
 void AccountsListModel::addAccount(Telepathy::Client::Account *account)

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list