]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Keep consistent all views. Peter, if you decide to revert the change that David did...
authorRafael Fernández López <ereslibre@kde.org>
Tue, 18 Dec 2007 20:17:57 +0000 (20:17 +0000)
committerRafael Fernández López <ereslibre@kde.org>
Tue, 18 Dec 2007 20:17:57 +0000 (20:17 +0000)
way. Anyway, detailed and columns view were buggy since it did never accept the dragging events, so you were never able to drop on the detailed or column view.

CCMAIL: peter.penz@gmx.at
CCMAIL: faure@kde.org

svn path=/trunk/KDE/kdebase/apps/; revision=750155

src/dolphincolumnwidget.cpp
src/dolphindetailsview.cpp

index 9a500df6b379f234e198256c97aebaf4a24e1cc1..ab7945ea721099278bbd23a26d6a8c3e9e583a12 100644 (file)
@@ -247,6 +247,20 @@ void DolphinColumnWidget::dragMoveEvent(QDragMoveEvent* event)
         }
     }
     setDirtyRegion(m_dropRect);
+
+    bool destIsDir = false;
+    if (index.isValid()) {
+        const KFileItem item = itemForIndex(index);
+        if (!item.isNull() && item.isDir()) {
+            m_dropRect = visualRect(index);
+            destIsDir = true;
+        }
+    } else { // dropping on viewport
+        destIsDir = true;
+    }
+    if (destIsDir && event->mimeData()->hasUrls()) {
+        event->acceptProposedAction();
+    }
 }
 
 void DolphinColumnWidget::dropEvent(QDropEvent* event)
index 46752fc95a39870bac6a84256d8cded1678ee1dc..f58b4cd1e2545090b27c5ae45645b74d624f3f10 100644 (file)
@@ -278,6 +278,20 @@ void DolphinDetailsView::dragMoveEvent(QDragMoveEvent* event)
         }
         setDirtyRegion(m_dropRect);
     }
+
+    bool destIsDir = false;
+    if (index.isValid()) {
+        const KFileItem item = itemForIndex(index);
+        if (!item.isNull() && item.isDir()) {
+            m_dropRect = visualRect(index);
+            destIsDir = true;
+        }
+    } else { // dropping on viewport
+        destIsDir = true;
+    }
+    if (destIsDir && event->mimeData()->hasUrls()) {
+        event->acceptProposedAction();
+    }
 }
 
 void DolphinDetailsView::dropEvent(QDropEvent* event)