X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/edf8be2dffa671faabf0fbf6e93b72441f20da5c..d6488887ecf69d7f192b94de8dce34fae0b7eb76:/src/dolphiniconsview.cpp diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index 1e2e66f5a..61179a3ac 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -215,17 +215,12 @@ void DolphinIconsView::dragMoveEvent(QDragMoveEvent* event) const QModelIndex index = indexAt(event->pos()); setDirtyRegion(m_dropRect); - if(!index.isValid()) { - m_dropRect.setSize(QSize()); // set as invalid - } else { - KFileItem item = itemForIndex(index); - if (item.isNull()) { - kWarning(7007) << "Invalid item returned for index"; - } else if (itemForIndex(index).isDir()) { + m_dropRect.setSize(QSize()); // set as invalid + if (index.isValid()) { + const KFileItem item = itemForIndex(index); + if (!item.isNull() && item.isDir()) { m_dropRect = visualRect(index); - } else { - m_dropRect.setSize(QSize()); // set as invalid - } + } } setDirtyRegion(m_dropRect); }