┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRafael Fernández López <[email protected]>2007-12-18 20:17:57 +0000
committerRafael Fernández López <[email protected]>2007-12-18 20:17:57 +0000
commit0ae60ef79bd44991a68fb8b1723fd807055f0307 (patch)
tree58d072bf873ff7d19cc4418efc6e00c1fd6069ab /src
parent00bded7c8d9c97dcaf726347d663032de3402b03 (diff)
Keep consistent all views. Peter, if you decide to revert the change that David did on dolphiniconsview, do the revert here too. It really makes things very clear this
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: [email protected] CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=750155
Diffstat (limited to 'src')
-rw-r--r--src/dolphincolumnwidget.cpp14
-rw-r--r--src/dolphindetailsview.cpp14
2 files changed, 28 insertions, 0 deletions
diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp
index 9a500df6b..ab7945ea7 100644
--- a/src/dolphincolumnwidget.cpp
+++ b/src/dolphincolumnwidget.cpp
@@ -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)
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index 46752fc95..f58b4cd1e 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -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)