]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Verify that the pointer m_extensionsFactory is not 0 before
authorFrank Reininghaus <frank78ac@googlemail.com>
Wed, 17 Nov 2010 15:10:12 +0000 (15:10 +0000)
committerFrank Reininghaus <frank78ac@googlemail.com>
Wed, 17 Nov 2010 15:10:12 +0000 (15:10 +0000)
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

src/views/dolphindetailsview.cpp

index 3b197115e6fc75fb6ef4d2901ef165a42ddf54d2..2d0d522acd3cdd38eb070b9a813c2a634cc0883b 100644 (file)
@@ -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"