mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-20 00:41:23 +00:00
It is a valid usecase that the model can be 0 when destructing a view.
svn path=/trunk/KDE/kdebase/apps/; revision=1184156
This commit is contained in:
parent
7e864a72b1
commit
af820f077b
|
@ -197,9 +197,13 @@ KFileItem DolphinViewController::itemForIndex(const QModelIndex& index) const
|
|||
Q_ASSERT(m_itemView != 0);
|
||||
|
||||
QAbstractProxyModel* proxyModel = static_cast<QAbstractProxyModel*>(m_itemView->model());
|
||||
KDirModel* dirModel = static_cast<KDirModel*>(proxyModel->sourceModel());
|
||||
const QModelIndex dirIndex = proxyModel->mapToSource(index);
|
||||
return dirModel->itemForIndex(dirIndex);
|
||||
if (proxyModel != 0) {
|
||||
KDirModel* dirModel = static_cast<KDirModel*>(proxyModel->sourceModel());
|
||||
const QModelIndex dirIndex = proxyModel->mapToSource(index);
|
||||
return dirModel->itemForIndex(dirIndex);
|
||||
}
|
||||
|
||||
return KFileItem();
|
||||
}
|
||||
|
||||
void DolphinViewController::triggerItem(const QModelIndex& index)
|
||||
|
|
Loading…
Reference in a new issue