From eac29a517cc54c610a16815fd6ec718f92f5e5ba Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 28 Nov 2007 17:07:08 +0000 Subject: fix crash during drag & drop if the file item is not available (thanks to John Tapsell for the original fix in dolphiniconsview.cpp!) svn path=/trunk/KDE/kdebase/apps/; revision=742703 --- src/dolphiniconsview.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to '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); } -- cgit v1.3