diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
commit | a53c68f02a359d234dee62dfa3bdd12bb17b13b5 (patch) | |
tree | 5a800b73c31a1a1251ab533dc614b521f1378ce3 /kttsd/plugins | |
parent | 389971def351e67fcf01c3dbe6b83c4d721dd755 (diff) | |
download | tdeaccessibility-a53c68f02a359d234dee62dfa3bdd12bb17b13b5.tar.gz tdeaccessibility-a53c68f02a359d234dee62dfa3bdd12bb17b13b5.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kttsd/plugins')
-rw-r--r-- | kttsd/plugins/command/commandconf.cpp | 2 | ||||
-rw-r--r-- | kttsd/plugins/command/commandproc.cpp | 28 | ||||
-rw-r--r-- | kttsd/plugins/festivalint/festivalintproc.cpp | 22 | ||||
-rw-r--r-- | kttsd/plugins/flite/fliteproc.cpp | 8 | ||||
-rw-r--r-- | kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl | 2 | ||||
-rw-r--r-- | kttsd/plugins/hadifix/hadifixconfigui.ui.h | 8 | ||||
-rw-r--r-- | kttsd/plugins/hadifix/hadifixproc.cpp | 4 | ||||
-rw-r--r-- | kttsd/plugins/hadifix/initialconfig.h | 2 |
8 files changed, 38 insertions, 38 deletions
diff --git a/kttsd/plugins/command/commandconf.cpp b/kttsd/plugins/command/commandconf.cpp index 5c4605f..968c20d 100644 --- a/kttsd/plugins/command/commandconf.cpp +++ b/kttsd/plugins/command/commandconf.cpp @@ -121,7 +121,7 @@ TQString CommandConf::getTalkerCode() { // Must contain either text or file parameter, or StdIn checkbox must be checked, // otherwise, does nothing! - if ((url.tqcontains("%t") > 0) || (url.tqcontains("%f") > 0) || m_widget->stdInButton->isChecked()) + if ((url.contains("%t") > 0) || (url.contains("%f") > 0) || m_widget->stdInButton->isChecked()) { return TQString( "<voice lang=\"%1\" name=\"%2\" gender=\"%3\" />" diff --git a/kttsd/plugins/command/commandproc.cpp b/kttsd/plugins/command/commandproc.cpp index 8f8c500..d8b35d2 100644 --- a/kttsd/plugins/command/commandproc.cpp +++ b/kttsd/plugins/command/commandproc.cpp @@ -72,8 +72,8 @@ bool CommandProc::init(KConfig *config, const TQString &configGroup){ m_stdin = config->readBoolEntry("StdIn", true); m_language = config->readEntry("LanguageCode", "en"); - // Support separate synthesis if the TTS command tqcontains %w macro. - m_supportsSynth = (m_ttsCommand.tqcontains("%w")); + // Support separate synthesis if the TTS command contains %w macro. + m_supportsSynth = (m_ttsCommand.contains("%w")); TQString codecString = config->readEntry("Codec", "Local"); m_codec = codecNameToCodec(codecString); @@ -147,7 +147,7 @@ void CommandProc::synth(const TQString& inputText, const TQString& suggestedFile TQString escText = KShellProcess::quote(text); // 1.c) create a temporary file for the text, if %f macro is used. - if (command.tqcontains("%f")) + if (command.contains("%f")) { KTempFile tempFile(locateLocal("tmp", "commandplugin-"), ".txt"); TQTextStream* fs = tempFile.textStream(); @@ -162,7 +162,7 @@ void CommandProc::synth(const TQString& inputText, const TQString& suggestedFile TQValueStack<bool> stack; bool issinglequote=false; bool isdoublequote=false; - int notqreplace=0; + int noreplace=0; TQRegExp re_noquote("(\"|'|\\\\|`|\\$\\(|\\$\\{|\\(|\\{|\\)|\\}|%%|%t|%f|%l|%w)"); TQRegExp re_singlequote("('|%%|%t|%f|%l|%w)"); TQRegExp re_doublequote("(\"|\\\\|`|\\$\\(|\\$\\{|%%|%t|%f|%l|%w)"); @@ -178,18 +178,18 @@ void CommandProc::synth(const TQString& inputText, const TQString& suggestedFile { // assert(isdoublequote == false) stack.push(isdoublequote); - if (notqreplace > 0) + if (noreplace > 0) // count nested braces when within ${...} - notqreplace++; + noreplace++; i++; } else if (command[i]=='$') { stack.push(isdoublequote); isdoublequote = false; - if ((notqreplace > 0) || (command[i+1]=='{')) + if ((noreplace > 0) || (command[i+1]=='{')) // count nested braces when within ${...} - notqreplace++; + noreplace++; i+=2; } else if ((command[i]==')') || (command[i]=='}')) @@ -199,9 +199,9 @@ void CommandProc::synth(const TQString& inputText, const TQString& suggestedFile isdoublequote = stack.pop(); else qWarning("Parse error."); - if (notqreplace > 0) + if (noreplace > 0) // count nested braces when within ${...} - notqreplace--; + noreplace--; i++; } else if (command[i]=='\'') @@ -219,7 +219,7 @@ void CommandProc::synth(const TQString& inputText, const TQString& suggestedFile else if (command[i]=='`') { // Replace all `...` with safer $(...) - command.tqreplace (i, 1, "$("); + command.replace (i, 1, "$("); TQRegExp re_backticks("(`|\\\\`|\\\\\\\\|\\\\\\$)"); for ( int i2=re_backticks.search(command,i+2); i2!=-1; @@ -228,7 +228,7 @@ void CommandProc::synth(const TQString& inputText, const TQString& suggestedFile { if (command[i2] == '`') { - command.tqreplace (i2, 1, ")"); + command.replace (i2, 1, ")"); i2=command.length(); // leave loop } else @@ -239,7 +239,7 @@ void CommandProc::synth(const TQString& inputText, const TQString& suggestedFile } // Leave i unchanged! We need to process "$(" } - else if (notqreplace == 0) // do not replace macros within ${...} + else if (noreplace == 0) // do not replace macros within ${...} { TQString match, v; @@ -269,7 +269,7 @@ void CommandProc::synth(const TQString& inputText, const TQString& suggestedFile else if (issinglequote) v="'"+v+"'"; - command.tqreplace (i, match.length(), v); + command.replace (i, match.length(), v); i+=v.length(); } else diff --git a/kttsd/plugins/festivalint/festivalintproc.cpp b/kttsd/plugins/festivalint/festivalintproc.cpp index 2b4aea3..bc37d1e 100644 --- a/kttsd/plugins/festivalint/festivalintproc.cpp +++ b/kttsd/plugins/festivalint/festivalintproc.cpp @@ -257,7 +257,7 @@ void FestivalIntProc::synth( // If we just started Festival, or rate changed, tell festival. if (m_runningTime != time) { TQString timeMsg; - if (voiceCode.tqcontains("_hts") > 0) + if (voiceCode.contains("_hts") > 0) { // Map 50% to 200% onto 0 to 1000. // slider = alpha * (log(percent)-log(50)) @@ -304,14 +304,14 @@ void FestivalIntProc::synth( int len = saidText.length(); while (len > c_tooLong) { - len = saidText.tqfindRev(", ", len - (c_tooLong * 2 / 3), true); + len = saidText.findRev(", ", len - (c_tooLong * 2 / 3), true); if (len != -1) { TQString c = saidText.mid(len+2, 1); if (c != c.upper()) { - saidText.tqreplace(len, 2, ". "); - saidText.tqreplace(len+2, 1, c.upper()); + saidText.replace(len, 2, ". "); + saidText.replace(len+2, 1, c.upper()); kdDebug() << "FestivalIntProc::synth: Splitting long sentence at " << len << endl; // kdDebug() << saidText << endl; } @@ -319,11 +319,11 @@ void FestivalIntProc::synth( } // Encode quotation characters. - saidText.tqreplace("\\\"", "#!#!"); - saidText.tqreplace("\"", "\\\""); - saidText.tqreplace("#!#!", "\\\""); + saidText.replace("\\\"", "#!#!"); + saidText.replace("\"", "\\\""); + saidText.replace("#!#!", "\\\""); // Remove certain comment characters. - saidText.tqreplace("--", ""); + saidText.replace("--", ""); // Ok, let's rock. if (synthFilename.isNull()) @@ -502,7 +502,7 @@ void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) { TQString buf = TQString::tqfromLatin1(buffer, buflen); // kdDebug() << "FestivalIntProc::slotReceivedStdout: Received from Festival: " << buf << endl; - bool promptSeen = (buf.tqcontains("festival>") > 0); + bool promptSeen = (buf.contains("festival>") > 0); bool emitQueryVoicesFinished = false; TQStringList voiceCodesList; if (m_waitingQueryVoices && m_outputQueue.isEmpty()) @@ -515,7 +515,7 @@ void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) } else { if (buf.left(1) == "(") { - int rightParen = buf.tqfind(')'); + int rightParen = buf.find(')'); if (rightParen > 0) { m_waitingQueryVoices = false; @@ -562,7 +562,7 @@ void FestivalIntProc::slotReceivedStdout(KProcess*, char* buffer, int buflen) if (emitQueryVoicesFinished) { // kdDebug() << "FestivalIntProc::slotReceivedStdout: emitting queryVoicesFinished" << endl; - m_supportsSSML = (voiceCodesList.tqcontains("rab_diphone")) ? ssYes : ssNo; + m_supportsSSML = (voiceCodesList.contains("rab_diphone")) ? ssYes : ssNo; emit queryVoicesFinished(voiceCodesList); } } diff --git a/kttsd/plugins/flite/fliteproc.cpp b/kttsd/plugins/flite/fliteproc.cpp index b71efef..e8185d5 100644 --- a/kttsd/plugins/flite/fliteproc.cpp +++ b/kttsd/plugins/flite/fliteproc.cpp @@ -129,11 +129,11 @@ void FliteProc::synth( // Encode quotation characters. TQString saidText = text; /* - saidText.tqreplace("\\\"", "#!#!"); - saidText.tqreplace("\"", "\\\""); - saidText.tqreplace("#!#!", "\\\""); + saidText.replace("\\\"", "#!#!"); + saidText.replace("\"", "\\\""); + saidText.replace("#!#!", "\\\""); // Remove certain comment characters. - saidText.tqreplace("--", ""); + saidText.replace("--", ""); saidText = "\"" + saidText + "\""; */ saidText += "\n"; diff --git a/kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl b/kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl index afa9b43..5a81c8f 100644 --- a/kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl +++ b/kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl @@ -113,7 +113,7 @@ </xsl:variable> <!-- Look for first period and space and extract corresponding substring from original. --> <xsl:choose> - <xsl:when test="tqcontains($tmp, '. ')"> + <xsl:when test="contains($tmp, '. ')"> <xsl:value-of select="substring($paragraph, 1, string-length(substring-before($tmp, '. '))+2)"/> </xsl:when> <xsl:otherwise> diff --git a/kttsd/plugins/hadifix/hadifixconfigui.ui.h b/kttsd/plugins/hadifix/hadifixconfigui.ui.h index cc6632c..ff9d381 100644 --- a/kttsd/plugins/hadifix/hadifixconfigui.ui.h +++ b/kttsd/plugins/hadifix/hadifixconfigui.ui.h @@ -53,14 +53,14 @@ void HadifixConfigUI::init () { void HadifixConfigUI::addVoice (const TQString &filename, bool isMale) { if (isMale) { - if (!maleVoices.tqcontains(filename)) { + if (!maleVoices.contains(filename)) { int id = voiceCombo->count(); maleVoices.insert (filename, id); voiceCombo->insertItem (male, filename, id); } } else { - if (!femaleVoices.tqcontains(filename)) { + if (!femaleVoices.contains(filename)) { int id = voiceCombo->count(); femaleVoices.insert (filename, id); voiceCombo->insertItem (female, filename, id); @@ -93,7 +93,7 @@ TQString HadifixConfigUI::getVoiceFilename() { int curr = voiceCombo->currentItem(); TQString filename = voiceCombo->text(curr); - if (defaultVoices.tqcontains(curr)) + if (defaultVoices.contains(curr)) filename = defaultVoices[curr]; return filename; @@ -103,7 +103,7 @@ bool HadifixConfigUI::isMaleVoice() { int curr = voiceCombo->currentItem(); TQString filename = getVoiceFilename(); - if (maleVoices.tqcontains(filename)) + if (maleVoices.contains(filename)) return maleVoices[filename] == curr; else return false; diff --git a/kttsd/plugins/hadifix/hadifixproc.cpp b/kttsd/plugins/hadifix/hadifixproc.cpp index 3e4b4ee..ad2cf21 100644 --- a/kttsd/plugins/hadifix/hadifixproc.cpp +++ b/kttsd/plugins/hadifix/hadifixproc.cpp @@ -377,9 +377,9 @@ HadifixProc::VoiceGender HadifixProc::determineGender(TQString mbrola, TQString else { if (output != 0) *output = speech.stdOut; - if (speech.stdOut.tqcontains("female", false)) + if (speech.stdOut.contains("female", false)) result = FemaleGender; - else if (speech.stdOut.tqcontains("male", false)) + else if (speech.stdOut.contains("male", false)) result = MaleGender; else result = NoGender; diff --git a/kttsd/plugins/hadifix/initialconfig.h b/kttsd/plugins/hadifix/initialconfig.h index 62ff659..1db8eb2 100644 --- a/kttsd/plugins/hadifix/initialconfig.h +++ b/kttsd/plugins/hadifix/initialconfig.h @@ -100,7 +100,7 @@ TQStringList findVoices(TQString mbrolaExec, const TQString &hadifixDataPath) { // 2b) search near the hadifix data path info.setFile(hadifixDataPath + "../../mbrola"); TQString mbrolaPath = info.dirPath (true) + "/mbrola"; - if (!list.tqcontains(mbrolaPath)) + if (!list.contains(mbrolaPath)) list += mbrolaPath; // 2c) broaden the search by adding subdirs (with a depth of 2) |