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
This commit is contained in:
Peter Penz 2007-02-28 19:38:25 +00:00
parent a46551d63e
commit 745401c643

View file

@ -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()