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
This commit is contained in:
Dominik Riebeling 2011-04-22 15:38:41 +00:00
parent 88e68ec5b0
commit 4d25fb8fe1

View file

@ -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");