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


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

The following commit has been merged in the master branch:
commit 05091356a676f797e6e404267186c62c4b72af2b
Author: Leon Handreke <leonh at ndreke.de>
Date:   Mon Apr 14 19:01:41 2014 +0200

    Allow selecting setting multi-selection modes in ContactViewWidget
    
    This is required for inviting multiple people at once into a chat.
    
    REVIEW: 117566
    Reviewed-by: David Edmundson <david at davidedmundson.co.uk>
---
 KTp/Widgets/contact-view-widget.cpp | 20 ++++++++++++++++++++
 KTp/Widgets/contact-view-widget.h   |  5 +++++
 2 files changed, 25 insertions(+)

diff --git a/KTp/Widgets/contact-view-widget.cpp b/KTp/Widgets/contact-view-widget.cpp
index 35b9de5..2b7961e 100644
--- a/KTp/Widgets/contact-view-widget.cpp
+++ b/KTp/Widgets/contact-view-widget.cpp
@@ -245,6 +245,16 @@ KTp::ContactPtr KTp::ContactViewWidget::selectedContact() const
     return d->contactView->currentIndex().data(KTp::ContactRole).value<KTp::ContactPtr>();
 }
 
+QList<KTp::ContactPtr> KTp::ContactViewWidget::selectedContacts() const
+{
+    QList<KTp::ContactPtr> selected;
+
+    Q_FOREACH (const QModelIndex &index, d->contactView->selectionModel()->selectedIndexes()) {
+        selected << index.data(KTp::ContactRole).value<KTp::ContactPtr>();
+    }
+    return selected;
+}
+
 void KTp::ContactViewWidget::setViewMode(QListView::ViewMode mode)
 {
     d->contactView->setViewMode(mode);
@@ -255,6 +265,16 @@ QListView::ViewMode KTp::ContactViewWidget::viewMode() const
     return d->contactView->viewMode();
 }
 
+QAbstractItemView::SelectionMode KTp::ContactViewWidget::selectionMode()
+{
+    return d->contactView->selectionMode();
+}
+
+void KTp::ContactViewWidget::setSelectionMode(QAbstractItemView::SelectionMode mode)
+{
+    d->contactView->setSelectionMode(mode);
+}
+
 KTp::ContactsFilterModel* KTp::ContactViewWidget::filter() const
 {
     return d->filterModel;
diff --git a/KTp/Widgets/contact-view-widget.h b/KTp/Widgets/contact-view-widget.h
index 1a2e763..2ddd595 100644
--- a/KTp/Widgets/contact-view-widget.h
+++ b/KTp/Widgets/contact-view-widget.h
@@ -75,9 +75,14 @@ public:
     virtual Tp::AccountPtr selectedAccount() const;
     virtual KTp::ContactPtr selectedContact() const;
 
+    virtual QList<KTp::ContactPtr> selectedContacts() const;
+
     void setViewMode(QListView::ViewMode);
     QListView::ViewMode viewMode() const;
 
+    void setSelectionMode(QAbstractItemView::SelectionMode mode);
+    QAbstractItemView::SelectionMode selectionMode();
+
 Q_SIGNALS:
     void selectionChanged(const Tp::AccountPtr &selectedAccount, const KTp::ContactPtr &selectedContact);
     void contactDoubleClicked(const Tp::AccountPtr &account, const KTp::ContactPtr &contact);

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list