summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/configure.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-04-22 15:38:41 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-04-22 15:38:41 +0000
commit4d25fb8fe1a3525f20cc1298e87a83ea6b68e003 (patch)
tree26c6d61e8b55c893ab1e79db5cf71625695c4d58 /rbutil/rbutilqt/configure.cpp
parent88e68ec5b0315748936380df892472d6eb9dbf4c (diff)
downloadrockbox-4d25fb8fe1a3525f20cc1298e87a83ea6b68e003.tar.gz
rockbox-4d25fb8fe1a3525f20cc1298e87a83ea6b68e003.tar.bz2
rockbox-4d25fb8fe1a3525f20cc1298e87a83ea6b68e003.zip
Fix "Test TTS" button not working.
Make sure the temporary file doesn't get destroyed before it has been played. Fixes the "Test TTS" button not giving a test playback anymore for TTS systems that cannot do the playback themselves. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29760 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/configure.cpp')
-rw-r--r--rbutil/rbutilqt/configure.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp
index 0ace229ee5..5c02cd8d7b 100644
--- a/rbutil/rbutilqt/configure.cpp
+++ b/rbutil/rbutilqt/configure.cpp
@@ -754,8 +754,9 @@ void Config::testTts()
}
QString filename;
+ QTemporaryFile file(this);
+ // keep filename empty if the TTS can do speaking for itself.
if(!(tts->capabilities() & TTSBase::CanSpeak)) {
- QTemporaryFile file(this);
file.open();
filename = file.fileName();
file.close();
@@ -771,7 +772,7 @@ void Config::testTts()
return;
}
tts->stop();
- if(!(tts->capabilities() & TTSBase::CanSpeak)) {
+ if(!filename.isEmpty()) {
#if defined(Q_OS_LINUX)
QString exe = Utils::findExecutable("aplay");
if(exe == "") exe = Utils::findExecutable("play");