[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:12:55 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=c65e44b

The following commit has been merged in the master branch:
commit c65e44bfa690dd659e4a4e109551fc89176b2357
Author: Roman Nazarenko <me at jtalk.me>
Date:   Wed Mar 13 16:32:21 2013 +0600

    Enable drag-and-drop regardless of grouping settings.
    
    REVIEW: 109454
    BUG: 315787
---
 contact-list-widget.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/contact-list-widget.cpp b/contact-list-widget.cpp
index bd67fb9..8c6edd7 100644
--- a/contact-list-widget.cpp
+++ b/contact-list-widget.cpp
@@ -565,11 +565,6 @@ void ContactListWidget::mousePressEvent(QMouseEvent *event)
     d->shouldDrag = false;
     d->dragSourceGroup.clear();
 
-    // no drag when grouping by accounts
-    if (d->model->groupMode() == KTp::ContactsModel::AccountGrouping) {
-        return;
-    }
-
     // if no contact, no drag
     if (index.data(KTp::RowTypeRole).toInt() != KTp::ContactRowType) {
         return;
@@ -727,6 +722,11 @@ void ContactListWidget::dropEvent(QDropEvent *event)
                 continue;
             }
 
+            if (d->model->groupMode() != KTp::ContactsModel::GroupGrouping) {
+                // If contacts grouping is disabled, dropping inside the contact list makes no sense.
+                continue;
+            }
+
             if (index.data(KTp::RowTypeRole).toInt() == KTp::GroupRowType) {
                 // contact is dropped on a group, so take it's name
                 targetGroup = index.data(KTp::IdRole).toString();
@@ -788,6 +788,8 @@ void ContactListWidget::dragEnterEvent(QDragEnterEvent *event)
 
 void ContactListWidget::dragMoveEvent(QDragMoveEvent *event)
 {
+    Q_D(ContactListWidget);
+
     QModelIndex index = indexAt(event->pos());
     setDropIndicatorRect(QRect());
 
@@ -800,7 +802,9 @@ void ContactListWidget::dragMoveEvent(QDragMoveEvent *event)
         setDropIndicatorRect(visualRect(index));
     } else if (event->mimeData()->hasFormat("application/vnd.telepathy.contact") &&
                (index.data(KTp::RowTypeRole).toInt() == KTp::GroupRowType ||
-                index.data(KTp::RowTypeRole).toInt() == KTp::ContactRowType)) {
+                index.data(KTp::RowTypeRole).toInt() == KTp::ContactRowType)
+               && d->model->groupMode() == KTp::ContactsModel::GroupGrouping) {
+        // Contacts dropping is only allowed if groups are enabled in appearance settings.
         event->acceptProposedAction();
         setDropIndicatorRect(visualRect(index));
     } else {

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list