diff options
| author | Peter Penz <[email protected]> | 2007-02-28 19:38:25 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-02-28 19:38:25 +0000 |
| commit | 745401c643d0a695f38ab8edf64b760fd3785f6c (patch) | |
| tree | 979006d99df15f4588c65b170e9b41af4f9f02a8 /src/dolphinview.cpp | |
| parent | a46551d63efd09b34fe33766533f6f5333737f22 (diff) | |
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
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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() |
