summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/installtalkwindow.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-02-02 21:34:39 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-02-02 21:34:39 +0000
commit91a503b23e54e1f58ec3756cb21e2dd90e1763a0 (patch)
treeed6bf2db56c311a6a37099fbe7b58fbd7a3fcbea /rbutil/rbutilqt/installtalkwindow.cpp
parent51f6fb56f143107fce78fb98b0328ded59bc4710 (diff)
downloadrockbox-91a503b23e54e1f58ec3756cb21e2dd90e1763a0.tar.gz
rockbox-91a503b23e54e1f58ec3756cb21e2dd90e1763a0.tar.bz2
rockbox-91a503b23e54e1f58ec3756cb21e2dd90e1763a0.zip
Don't segfault upon opening the voice / talk creation window if the encoder setting is missing. This could happen if the configuration file is older and the user didn't re-save the settings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16202 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/installtalkwindow.cpp')
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index f7202aae40..dfe2a84c19 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -119,13 +119,20 @@ void InstallTalkWindow::setSettings(RbSettings* sett)
ui.labelTtsProfile->setText(tr("Selected TTS Engine: <b>%1</b>").arg("Invalid TTS configuration!"));
QString encoder = settings->curEncoder();
- EncBase* enc = getEncoder(encoder);
- enc->setCfg(settings);
- if(enc->configOk())
- ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg(encoder));
+ // only proceed if encoder setting is set
+ if(!encoder.isEmpty()) {
+ // FIXME: getEncoder CAN return a NULL pointer. Additional error
+ // checking is required or getEncoder should use the default engine
+ EncBase* enc = getEncoder(encoder);
+ enc->setCfg(settings);
+ if(enc->configOk())
+ ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg(encoder));
+ else
+ ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!"));
+ }
else
ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!"));
-
+
setTalkFolder(settings->lastTalkedFolder());
}