summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Andriot <albator78@libertysurf.fr>2013-06-13 09:19:28 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-06-13 09:19:28 -0500
commit37dd210d312a915f8acfd291292ed3600d41608e (patch)
treec39e1c0f62068030c2b43959c8769848f919b814
parent8cd17f9262dfdace115ce709db21d8d145f2919d (diff)
downloadtdmtheme-37dd210d312a915f8acfd291292ed3600d41608e.tar.gz
tdmtheme-37dd210d312a915f8acfd291292ed3600d41608e.zip
Fix tdmtheme crash
This resolves Bug 1544
-rw-r--r--src/tdmtheme.cpp26
1 files 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("<qt><strong>Copyright:</strong> %1<br/></qt>",
- theme->copyright) : "") +
- ((theme->description.length() > 0) ?
- i18n("<qt><strong>Description:</strong> %1</qt>",
- 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("<qt><strong>Copyright:</strong> %1<br/></qt>",
+ theme->copyright) : "") +
+ ((theme->description.length() > 0) ?
+ i18n("<qt><strong>Description:</strong> %1</qt>",
+ 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()