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


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

The following commit has been merged in the master branch:
commit 30e9ba702348fe82fa62ee55606d8bd8fc4372ee
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Thu Jan 3 11:47:16 2013 +0000

    Namespace and d-pointer AccountsTreeProxyModel
---
 KTp/Models/accounts-tree-proxy-model.cpp | 28 ++++++++++++++++++----------
 KTp/Models/accounts-tree-proxy-model.h   | 16 +++++++++++-----
 2 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/KTp/Models/accounts-tree-proxy-model.cpp b/KTp/Models/accounts-tree-proxy-model.cpp
index 5a2e64f..15651b3 100644
--- a/KTp/Models/accounts-tree-proxy-model.cpp
+++ b/KTp/Models/accounts-tree-proxy-model.cpp
@@ -21,17 +21,25 @@
 #include "contacts-model.h"
 
 #include <TelepathyQt/Account>
+#include <TelepathyQt/AccountManager>
 
 #include <KIcon>
 
-AccountsTreeProxyModel::AccountsTreeProxyModel(QAbstractItemModel *sourceModel, const Tp::AccountManagerPtr &accountManager) :
-    AbstractGroupingProxyModel(sourceModel),
-    m_accountManager(accountManager)
+
+class KTp::AccountsTreeProxyModel::Private
 {
+public:
+    Tp::AccountManagerPtr accountManager;
+};
 
+KTp::AccountsTreeProxyModel::AccountsTreeProxyModel(QAbstractItemModel *sourceModel, const Tp::AccountManagerPtr &accountManager) :
+    AbstractGroupingProxyModel(sourceModel),
+    d(new Private())
+{
+    d->accountManager = accountManager;
 }
 
-QSet<QString> AccountsTreeProxyModel::groupsForIndex(const QModelIndex &sourceIndex) const
+QSet<QString> KTp::AccountsTreeProxyModel::groupsForIndex(const QModelIndex &sourceIndex) const
 {
     const Tp::AccountPtr account = sourceIndex.data(ContactsModel::AccountRole).value<Tp::AccountPtr>();
     if (account) {
@@ -42,34 +50,34 @@ QSet<QString> AccountsTreeProxyModel::groupsForIndex(const QModelIndex &sourceIn
 }
 
 
-QVariant AccountsTreeProxyModel::dataForGroup(const QString &group, int role) const
+QVariant KTp::AccountsTreeProxyModel::dataForGroup(const QString &group, int role) const
 {
     Tp::AccountPtr account;
     switch(role) {
     case Qt::DisplayRole:
-        account = m_accountManager->accountForObjectPath(group);
+        account = d->accountManager->accountForObjectPath(group);
         if (account) {
             return account->normalizedName();
         }
         break;
     case ContactsModel::IconRole:
-        account = m_accountManager->accountForObjectPath(group);
+        account = d->accountManager->accountForObjectPath(group);
         if (account) {
             return account->iconName();
         }
         break;
     case ContactsModel::AccountRole:
-        return QVariant::fromValue(m_accountManager->accountForObjectPath(group));
+        return QVariant::fromValue(d->accountManager->accountForObjectPath(group));
     case ContactsModel::TypeRole:
         return ContactsModel::AccountRowType;
     case ContactsModel::EnabledRole:
-        account = m_accountManager->accountForObjectPath(group);
+        account = d->accountManager->accountForObjectPath(group);
         if (account) {
             return account->isEnabled();
         }
         return true;
     case ContactsModel::ConnectionStatusRole:
-        account = m_accountManager->accountForObjectPath(group);
+        account = d->accountManager->accountForObjectPath(group);
         if (account) {
             return account->connectionStatus();
         }
diff --git a/KTp/Models/accounts-tree-proxy-model.h b/KTp/Models/accounts-tree-proxy-model.h
index 7b4eae4..ff19de1 100644
--- a/KTp/Models/accounts-tree-proxy-model.h
+++ b/KTp/Models/accounts-tree-proxy-model.h
@@ -16,15 +16,17 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef ACCOUNTSTREEPROXYMODEL_H
-#define ACCOUNTSTREEPROXYMODEL_H
+#ifndef KTP_ACCOUNTS_TREE_PROXY_MODEL_H
+#define KTP_ACCOUNTS_TREE_PROXY_MODEL_H
 
 #include "abstract-grouping-proxy-model.h"
 
-#include <TelepathyQt/AccountManager>
-
 #include <KTp/ktp-export.h>
 
+#include <TelepathyQt/Types>
+
+namespace KTp {
+
 class KTP_EXPORT AccountsTreeProxyModel : public KTp::AbstractGroupingProxyModel
 {
     Q_OBJECT
@@ -34,7 +36,11 @@ public:
     virtual QSet<QString> groupsForIndex(const QModelIndex &sourceIndex) const;
     virtual QVariant dataForGroup(const QString &group, int role) const;
 private:
-    Tp::AccountManagerPtr m_accountManager;
+    class Private;
+    Private *d;
+
 };
 
+}
+
 #endif // ACCOUNTSTREEPROXYMODEL_H

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list