* highlight the item we are dragging over

* if the KFileItem droped on doesn't accept drops, don't pass it in to doDrop (fixes crash)

svn path=/trunk/KDE/kdebase/apps/; revision=819371
This commit is contained in:
Aaron J. Seigo 2008-06-11 05:49:35 +00:00
parent 1041104333
commit 605ba7360a

View file

@ -856,6 +856,13 @@ void FolderView::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
void FolderView::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
{
const QModelIndex index = indexAt(event->pos());
if (index.isValid()) {
QRectF dirtyRect = visualRect(index) | visualRect(m_hoveredIndex);
m_hoveredIndex = index;
update(dirtyRect);
}
event->accept();
}
@ -870,6 +877,9 @@ void FolderView::dropEvent(QGraphicsSceneDragDropEvent *event)
const QModelIndex index = indexAt(event->pos());
if (index.isValid()) {
item = m_model->itemForIndex(index);
if (!item.acceptsDrops()) {
item = KFileItem();
}
}
QDropEvent ev(event->screenPos(), event->dropAction(), event->mimeData(),