From 37dd210d312a915f8acfd291292ed3600d41608e Mon Sep 17 00:00:00 2001 From: Francois Andriot Date: Thu, 13 Jun 2013 09:19:28 -0500 Subject: Fix tdmtheme crash This resolves Bug 1544 --- src/tdmtheme.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/tdmtheme.cpp b/src/tdmtheme.cpp index 8451810..644f9cd 100644 --- a/src/tdmtheme.cpp +++ b/src/tdmtheme.cpp @@ -268,16 +268,22 @@ void TDMThemeWidget::insertTheme( const TQString &_theme ) void TDMThemeWidget::updateInfoView( ThemeData *theme ) { - info->setText( - ((theme->copyright.length() > 0) ? - i18n("Copyright: %1
", - theme->copyright) : "") + - ((theme->description.length() > 0) ? - i18n("Description: %1", - theme->description) : "") ); - preview->setPixmap( theme->path + '/' + theme->screenShot ); - preview->setText( theme->screenShot.isEmpty() ? - "Screenshot not available" : TQString() ); + if(theme) { + info->setText( + ((theme->copyright.length() > 0) ? + i18n("Copyright: %1
", + theme->copyright) : "") + + ((theme->description.length() > 0) ? + i18n("Description: %1", + theme->description) : "") ); + preview->setPixmap( theme->path + '/' + theme->screenShot ); + preview->setText( theme->screenShot.isEmpty() ? + i18n("Screenshot not available") : TQString() ); + } else { + info->setText(i18n("No theme selected.")); + preview->setPixmap(NULL); + preview->setText(i18n("Screenshot not available")); + } } void TDMThemeWidget::installNewTheme() -- cgit v1.2.1