summaryrefslogtreecommitdiffstats
path: root/src/kdmtheme.cpp
diff options
context:
space:
mode:
authorFrancois Andriot <[email protected]>2013-06-13 09:19:28 -0500
committerSlávek Banko <[email protected]>2013-07-04 18:08:43 +0200
commit28924e5596286f04bd67c3cad77a401cbb1b039e (patch)
treec87eabf0d42667a7cdbcea7562f17d6576d30f06 /src/kdmtheme.cpp
parentad005579fbe65ce973048f01b369cef6ae89a454 (diff)
downloadtdmtheme-28924e5596286f04bd67c3cad77a401cbb1b039e.tar.gz
tdmtheme-28924e5596286f04bd67c3cad77a401cbb1b039e.zip
Fix tdmtheme crash
This resolves Bug 1544 (cherry picked from commit 37dd210d312a915f8acfd291292ed3600d41608e)
Diffstat (limited to 'src/kdmtheme.cpp')
-rw-r--r--src/kdmtheme.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/kdmtheme.cpp b/src/kdmtheme.cpp
index e9dd1fd..cf9fdf3 100644
--- a/src/kdmtheme.cpp
+++ b/src/kdmtheme.cpp
@@ -268,16 +268,22 @@ void KDMThemeWidget::insertTheme( const TQString &_theme )
void KDMThemeWidget::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 KDMThemeWidget::installNewTheme()