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/command | |
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/command')
-rw-r--r-- | kttsd/plugins/command/commandconf.cpp | 2 | ||||
-rw-r--r-- | kttsd/plugins/command/commandproc.cpp | 28 |
2 files changed, 15 insertions, 15 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 |