commit dfac47cb284ffe7e97a99670b890ed8e4c4d4416 Author: Montel Laurent <montel@kde.org> Date: Wed Apr 3 15:22:59 2013 +0200 Fix Bug 317780 - KMail crash trying to Clone or Create new Theme FIXED-IN: 4.10.3 BUG: 317780 diff --git a/messagelist/utils/themeeditor.cpp b/messagelist/utils/themeeditor.cpp index 2d26d28..5671fcd 100644 --- a/messagelist/utils/themeeditor.cpp +++ b/messagelist/utils/themeeditor.cpp @@ -411,6 +411,8 @@ void ThemePreviewWidget::setTheme( Theme * theme ) mDropIndicatorPoint2 = QPoint(); mTheme = theme; mDelegate->setTheme( theme ); + if (!mTheme) + return; mGroupHeaderSampleItem->setExpanded( true ); const QList< Theme::Column * > & columns = mTheme->columns(); @@ -1547,7 +1549,8 @@ ThemeEditor::~ThemeEditor() void ThemeEditor::editTheme( Theme *set ) { mCurrentTheme = set; - + mPreviewWidget->setTheme(mCurrentTheme); + if ( !mCurrentTheme ) { setEnabled( false ); @@ -1558,8 +1561,6 @@ void ThemeEditor::editTheme( Theme *set ) nameEdit()->setText( set->name() ); descriptionEdit()->setPlainText( set->description() ); - mPreviewWidget->setTheme( set ); - ComboBoxUtils::setIntegerOptionComboValue( mViewHeaderPolicyCombo, (int)mCurrentTheme->viewHeaderPolicy() ); mIconSizeSpinBox->setValue( set->iconSize() );