diff options
| author | Peter Penz <[email protected]> | 2007-11-28 17:07:08 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-11-28 17:07:08 +0000 |
| commit | eac29a517cc54c610a16815fd6ec718f92f5e5ba (patch) | |
| tree | e841d8f31bb5817054510c5e6333fa7cc9fa221f /src/dolphiniconsview.cpp | |
| parent | edf8be2dffa671faabf0fbf6e93b72441f20da5c (diff) | |
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
Diffstat (limited to 'src/dolphiniconsview.cpp')
| -rw-r--r-- | src/dolphiniconsview.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
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); } |
