mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-02 14:45:04 +00:00
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:
parent
a46551d63e
commit
745401c643
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue