[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:07 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=b7429ed
The following commit has been merged in the master branch:
commit b7429ed2c840d43f020852a2d7d852c2bbf5bcfb
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Tue Sep 10 21:30:46 2013 +0100
Supress unused kpeople rows the proxy mode
KPeople has a tree structure for all contacts to single contacts have a root
entry and 1 child node.
This looks silly when displayed so we supress the child node.
Currently this happens in the contact list delegate.
This moves it to the model which is a bit cleaner
REVIEW: 112657
---
KTp/Models/kpeopletranslationproxy.cpp | 11 +++++++++++
KTp/Models/kpeopletranslationproxy.h | 1 +
2 files changed, 12 insertions(+)
diff --git a/KTp/Models/kpeopletranslationproxy.cpp b/KTp/Models/kpeopletranslationproxy.cpp
index a9bce37..f5ecbfe 100644
--- a/KTp/Models/kpeopletranslationproxy.cpp
+++ b/KTp/Models/kpeopletranslationproxy.cpp
@@ -154,6 +154,17 @@ QVariant KPeopleTranslationProxy::data(const QModelIndex &proxyIndex, int role)
return mapToSource(proxyIndex).data(role);
}
+int KPeopleTranslationProxy::rowCount(const QModelIndex &parent) const
+{
+ int realRowCount = QIdentityProxyModel::rowCount(parent);
+ if (realRowCount > 1) {
+ return realRowCount;
+ } else {
+ return 0;
+ }
+}
+
+
QVariant KPeopleTranslationProxy::translatePresence(const QVariant &presenceName) const
{
if (presenceName == QLatin1String("available")) {
diff --git a/KTp/Models/kpeopletranslationproxy.h b/KTp/Models/kpeopletranslationproxy.h
index 16dbd07..0dc2dec 100644
--- a/KTp/Models/kpeopletranslationproxy.h
+++ b/KTp/Models/kpeopletranslationproxy.h
@@ -33,6 +33,7 @@ public:
virtual ~KPeopleTranslationProxy();
virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const;
+ virtual int rowCount(const QModelIndex &parent) const;
private:
QVariant translatePresence(const QVariant &presenceName) const;
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list