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/dolphincolumnwidget.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/dolphincolumnwidget.cpp')
| -rw-r--r-- | src/dolphincolumnwidget.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index 1a7f712f3..677215972 100644 --- a/src/dolphincolumnwidget.cpp +++ b/src/dolphincolumnwidget.cpp @@ -227,10 +227,13 @@ void DolphinColumnWidget::dragMoveEvent(QDragMoveEvent* event) // TODO: remove this code when the issue #160611 is solved in Qt 4.4 const QModelIndex index = indexAt(event->pos()); setDirtyRegion(m_dropRect); - if (itemForIndex(index).isDir()) { - m_dropRect = visualRect(index); - } else { - m_dropRect.setSize(QSize()); // set as invalid + + m_dropRect.setSize(QSize()); // set as invalid + if (index.isValid()) { + const KFileItem item = itemForIndex(index); + if (!item.isNull() && item.isDir()) { + m_dropRect = visualRect(index); + } } setDirtyRegion(m_dropRect); } |
