From 8e188908b00785c7b8eb642a24513b8d100251df Mon Sep 17 00:00:00 2001 From: bluebrother Date: Fri, 22 Apr 2011 15:38:41 +0000 Subject: [PATCH] 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 --- rbutil/rbutilqt/configure.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index 0ace229ee..5c02cd8d7 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"); -- 2.11.4.GIT