From: Frank Reininghaus Date: Wed, 17 Nov 2010 15:10:12 +0000 (+0000) Subject: Verify that the pointer m_extensionsFactory is not 0 before X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/857b04711ad0f2860761558a18906e8c7891319f?ds=inline Verify that the pointer m_extensionsFactory is not 0 before dereferencing it. Fixes a possible crash when initialising the Details View in Konqueror, caused by an indirect resizing the of columns before the DolphinDetailsView constructor is finished. CCBUG: 257035 svn path=/trunk/KDE/kdebase/apps/; revision=1198138 --- diff --git a/src/views/dolphindetailsview.cpp b/src/views/dolphindetailsview.cpp index 3b197115e..2d0d522ac 100644 --- a/src/views/dolphindetailsview.cpp +++ b/src/views/dolphindetailsview.cpp @@ -675,8 +675,12 @@ KFileItemDelegate::Information DolphinDetailsView::infoForColumn(int columnIndex void DolphinDetailsView::adjustMaximumSizeForEditing(const QModelIndex& index) { - // Make sure that the full width of the "Name" column is available for "Rename Inline" - m_extensionsFactory->fileItemDelegate()->setMaximumSize(QTreeView::visualRect(index).size()); + // Make sure that the full width of the "Name" column is available for "Rename Inline". + // Before we do that, we have to check if m_extensionsFactory has been initialised because + // it is possible that we end up here before the constructor is finished (see bug 257035) + if (m_extensionsFactory) { + m_extensionsFactory->fileItemDelegate()->setMaximumSize(QTreeView::visualRect(index).size()); + } } #include "dolphindetailsview.moc"