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


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

The following commit has been merged in the master branch:
commit 98531390633edb5bf596343b701622ca3d14c978
Author: Keith Rusler <xzekecomax at gmail.com>
Date:   Mon Mar 21 11:58:46 2011 +0100

    Add contact context menu by Keith Rusler <comawhite>
---
 models/accounts-model.cpp | 11 +++++++++++
 models/accounts-model.h   |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/models/accounts-model.cpp b/models/accounts-model.cpp
index 266828a..366c46f 100644
--- a/models/accounts-model.cpp
+++ b/models/accounts-model.cpp
@@ -234,6 +234,17 @@ Tp::AccountPtr AccountsModel::accountForIndex(const QModelIndex &index) const
     }
 }
 
+Tp::ContactPtr AccountsModel::contactForIndex(const QModelIndex& index) const
+{
+    TreeNode *contactNode = mPriv->node(index);
+    ContactModelItem *item = qobject_cast<ContactModelItem *>(contactNode);
+    if (item) {
+        return item->contact();
+    } else {
+        return Tp::ContactPtr();
+    }
+}
+
 Tp::AccountPtr AccountsModel::accountForContactIndex(const QModelIndex& index) const
 {
     TreeNode *contactNode = mPriv->node(index);
diff --git a/models/accounts-model.h b/models/accounts-model.h
index 319d537..42cc2b2 100644
--- a/models/accounts-model.h
+++ b/models/accounts-model.h
@@ -94,6 +94,8 @@ public:
     virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
     virtual QVariant data(const QModelIndex &index, int role) const;
     Tp::AccountPtr accountForIndex(const QModelIndex &index) const;
+    Tp::ContactPtr contactForIndex(const QModelIndex &index) const;
+
     Tp::AccountPtr accountForContactIndex(const QModelIndex &index) const;
 
     virtual Qt::ItemFlags flags(const QModelIndex &index) const;

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list