mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
* 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:
parent
1041104333
commit
605ba7360a
1 changed files with 10 additions and 0 deletions
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue