From 1753f90918898c970a8997675b218dbadfd7c88a Mon Sep 17 00:00:00 2001 From: Thorvald Natvig Date: Mon, 13 Aug 2007 00:52:17 +0000 Subject: Safe HTML in Log git-svn-id: https://mumble.svn.sourceforge.net/svnroot/mumble/trunk@731 05730e5d-ab1b-0410-a4ac-84af385074fa --- src/mumble/TextToSpeech_unix.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mumble/TextToSpeech_unix.cpp') diff --git a/src/mumble/TextToSpeech_unix.cpp b/src/mumble/TextToSpeech_unix.cpp index 98d20def2..43a0fef3d 100644 --- a/src/mumble/TextToSpeech_unix.cpp +++ b/src/mumble/TextToSpeech_unix.cpp @@ -37,7 +37,7 @@ class TextToSpeechPrivate { public: TextToSpeechPrivate(); ~TextToSpeechPrivate(); - void say(QString text); + void say(const QString &text); void setVolume(int v); }; @@ -51,10 +51,8 @@ TextToSpeechPrivate::~TextToSpeechPrivate() { qpFestival.close(); } -void TextToSpeechPrivate::say(QString text) { - QTextDocument td; - td.setHtml(text); - qpFestival.write(QString::fromLatin1("(SayText \"%1\")").arg(td.toPlainText().replace(QLatin1String("\""),QLatin1String("\\\""))).toLatin1()); +void TextToSpeechPrivate::say(const QString &text) { + qpFestival.write(QString::fromLatin1("(SayText \"%1\")").arg(text.replace(QLatin1String("\""),QLatin1String("\\\""))).toLatin1()); } void TextToSpeechPrivate::setVolume(int) { @@ -69,7 +67,7 @@ TextToSpeech::~TextToSpeech() { delete d; } -void TextToSpeech::say(QString text) { +void TextToSpeech::say(const QString &text) { if (enabled) d->say(text); } -- cgit v1.2.3