From: Peter Penz Date: Wed, 28 Feb 2007 19:38:25 +0000 (+0000) Subject: Don't use assertions here. The result of the preview might have been done although... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/745401c643d0a695f38ab8edf64b760fd3785f6c Don't use assertions here. The result of the preview might have been done although the model has changed (e. g. by changed the folder during a preview job is working) -> it's possible to get an invalid model index. svn path=/trunk/KDE/kdebase/apps/; revision=638086 --- diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index bcbb637ad..fface3f43 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -700,10 +700,11 @@ void DolphinView::generatePreviews(const KFileItemList& items) void DolphinView::showPreview(const KFileItem* item, const QPixmap& pixmap) { - const QModelIndex idx = m_dirModel->indexForItem(item); - Q_ASSERT(idx.isValid()); - Q_ASSERT(idx.column() == 0); - m_dirModel->setData(idx, pixmap, Qt::DecorationRole); + Q_ASSERT(item != 0); + const QModelIndex idx = m_dirModel->indexForItem(*item); + if (idx.isValid() && (idx.column() == 0)) { + m_dirModel->setData(idx, pixmap, Qt::DecorationRole); + } } void DolphinView::restoreContentsPos()