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 | 36c36b53a129509d56fdaa0a7c9fcbcacd0c5826 (patch) | |
tree | 629d3942958745660e36c30b0d6139af9459c0f8 /kommander/widget | |
parent | 929d7ae4f69d62b8f1f6d3506adf75f017753935 (diff) | |
download | tdewebdev-36c36b53a129509d56fdaa0a7c9fcbcacd0c5826.tar.gz tdewebdev-36c36b53a129509d56fdaa0a7c9fcbcacd0c5826.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/widget')
-rw-r--r-- | kommander/widget/expression.cpp | 2 | ||||
-rw-r--r-- | kommander/widget/functionlib.cpp | 18 | ||||
-rw-r--r-- | kommander/widget/invokeclass.cpp | 4 | ||||
-rw-r--r-- | kommander/widget/kommanderfunctions.cpp | 10 | ||||
-rw-r--r-- | kommander/widget/kommanderwidget.cpp | 16 | ||||
-rw-r--r-- | kommander/widget/myprocess.cpp | 2 | ||||
-rw-r--r-- | kommander/widget/parser.cpp | 14 | ||||
-rw-r--r-- | kommander/widget/parserdata.cpp | 6 |
8 files changed, 36 insertions, 36 deletions
diff --git a/kommander/widget/expression.cpp b/kommander/widget/expression.cpp index 350646e1..d29d94e8 100644 --- a/kommander/widget/expression.cpp +++ b/kommander/widget/expression.cpp @@ -57,7 +57,7 @@ Expression& Expression::operator=(const TQString& s) m_parts.append(TQVariant(s.mid(start, i - start).toDouble())); else m_parts.append(TQVariant(s.mid(start, i - start).toInt())); - } else if (single.tqcontains(s[i])) + } else if (single.contains(s[i])) m_parts.append(TQVariant(TQString(s[i++]))); else if (s[i] == '\"') { diff --git a/kommander/widget/functionlib.cpp b/kommander/widget/functionlib.cpp index 90a8ef28..da699bd2 100644 --- a/kommander/widget/functionlib.cpp +++ b/kommander/widget/functionlib.cpp @@ -52,7 +52,7 @@ static ParseNode f_stringLength(Parser*, const ParameterList& params) static ParseNode f_stringContains(Parser*, const ParameterList& params) { - return params[0].toString().tqcontains(params[1].toString()); + return params[0].toString().contains(params[1].toString()); } static ParseNode f_stringCompare(Parser*, const ParameterList& params) @@ -71,12 +71,12 @@ static ParseNode f_stringCompare(Parser*, const ParameterList& params) static ParseNode f_stringFind(Parser*, const ParameterList& params) { - return params[0].toString().tqfind(params[1].toString(), params.count() == 3 ? params[2].toInt() : 0); + return params[0].toString().find(params[1].toString(), params.count() == 3 ? params[2].toInt() : 0); } static ParseNode f_stringFindRev(Parser*, const ParameterList& params) { - return params[0].toString().tqfindRev(params[1].toString(), + return params[0].toString().findRev(params[1].toString(), params.count() == 3 ? params[2].toInt() : params[0].toString().length()); } @@ -102,7 +102,7 @@ static ParseNode f_stringRemove(Parser*, const ParameterList& params) static ParseNode f_stringReplace(Parser*, const ParameterList& params) { - return params[0].toString().tqreplace(params[1].toString(), params[2].toString()); + return params[0].toString().replace(params[1].toString(), params[2].toString()); } static ParseNode f_stringLower(Parser*, const ParameterList& params) @@ -354,7 +354,7 @@ static ParseNode f_dcop(Parser*, const ParameterList& params) else if (*it == "bool") byteDataStream << (bool)params[i++].toInt(); else if (*it == TQSTRINGLIST_OBJECT_NAME_STRING) - if (params[i].toString().tqfind('\n') != -1) + if (params[i].toString().find('\n') != -1) byteDataStream << TQStringList::split("\n", params[i++].toString(), true); else byteDataStream << TQStringList::split("\\n", params[i++].toString(), true); @@ -648,7 +648,7 @@ static ParseNode f_arrayIndexedRemoveElements(Parser* P, const ParameterList& pa return ParseNode(); //out of index range for (int i = 0; i < count; i++) { - if (keys.tqcontains(TQString::number(i)) != 1) + if (keys.contains(TQString::number(i)) != 1) return ParseNode(); //array is not indexed } for (int i = key; i <= key + num; i++) @@ -910,15 +910,15 @@ static ParseNode f_write_setting(Parser* parser, const ParameterList& params) void ParserData::registerStandardFunctions() { registerFunction("str_length", Function(&f_stringLength, ValueInt, ValueString)); - registerFunction("str_tqcontains", Function(&f_stringContains, ValueInt, ValueString, ValueString)); + registerFunction("str_contains", Function(&f_stringContains, ValueInt, ValueString, ValueString)); registerFunction("str_compare", Function(&f_stringCompare, ValueInt, ValueString, ValueString)); - registerFunction("str_tqfind", Function(&f_stringFind, ValueInt, ValueString, ValueString, ValueInt, 2)); + registerFunction("str_find", Function(&f_stringFind, ValueInt, ValueString, ValueString, ValueInt, 2)); registerFunction("str_findrev", Function(&f_stringFindRev, ValueInt, ValueString, ValueString, ValueInt, 2)); registerFunction("str_left", Function(&f_stringLeft, ValueString, ValueString, ValueInt)); registerFunction("str_right", Function(&f_stringRight, ValueString, ValueString, ValueInt)); registerFunction("str_mid", Function(&f_stringMid, ValueString, ValueString, ValueInt, ValueInt, 2)); registerFunction("str_remove", Function(&f_stringRemove, ValueString, ValueString, ValueString)); - registerFunction("str_tqreplace", Function(&f_stringReplace, ValueString, ValueString, ValueString, ValueString)); + registerFunction("str_replace", Function(&f_stringReplace, ValueString, ValueString, ValueString, ValueString)); registerFunction("str_lower", Function(&f_stringLower, ValueString, ValueString)); registerFunction("str_upper", Function(&f_stringUpper, ValueString, ValueString)); registerFunction("str_section", Function(&f_stringSection, ValueString, ValueString, ValueString, ValueInt, ValueInt, 3)); diff --git a/kommander/widget/invokeclass.cpp b/kommander/widget/invokeclass.cpp index ec08dfff..a82a5305 100644 --- a/kommander/widget/invokeclass.cpp +++ b/kommander/widget/invokeclass.cpp @@ -23,7 +23,7 @@ InvokeClass::InvokeClass(TQObject *tqparent):TQObject(tqparent) void InvokeClass::invokeSlot(TQObject *object, const TQString& slot, TQStringList args) { TQString invokeName = slot; - invokeName = invokeName.mid(invokeName.tqfind('(')); + invokeName = invokeName.mid(invokeName.find('(')); invokeName.prepend(TQString::number(TQSIGNAL_CODE) + "invoke"); TQString slotName = TQString::number(TQSLOT_CODE) + slot; connect(this, invokeName.ascii(), object, slotName.ascii()); @@ -33,7 +33,7 @@ void InvokeClass::invokeSlot(TQObject *object, const TQString& slot, TQStringLis else { TQString slotArgStr = slot.section(TQRegExp("\\(|\\)"), 1); - uint argNum = slotArgStr.tqcontains(',') + 1; + uint argNum = slotArgStr.contains(',') + 1; for (uint i = args.count(); i < argNum; i++) args << ""; //poor man's invokeMetaObject diff --git a/kommander/widget/kommanderfunctions.cpp b/kommander/widget/kommanderfunctions.cpp index 0ddcb951..701b5e01 100644 --- a/kommander/widget/kommanderfunctions.cpp +++ b/kommander/widget/kommanderfunctions.cpp @@ -114,7 +114,7 @@ TQString KommanderWidget::evalFunction(const TQString& function, const TQStringL TQString KommanderWidget::evalExecBlock(const TQStringList& args, const TQString& s, int& pos) { - int f = s.tqfind("@execEnd", pos); + int f = s.find("@execEnd", pos); if (f == -1) { printError(i18n("Unterminated @execBegin ... @execEnd block.")); @@ -131,7 +131,7 @@ TQString KommanderWidget::evalExecBlock(const TQStringList& args, const TQString TQString KommanderWidget::evalForEachBlock(const TQStringList& args, const TQString& s, int& pos) { - int f = s.tqfind("@end", pos); + int f = s.find("@end", pos); //FIXME: better detection of block boundaries if (f == -1) { @@ -157,7 +157,7 @@ TQString KommanderWidget::evalForEachBlock(const TQStringList& args, const TQStr TQString KommanderWidget::evalForBlock(const TQStringList& args, const TQString& s, int& pos) { - int f = s.tqfind("@end", pos); + int f = s.find("@end", pos); //FIXME: better detection of block boundaries if (f == -1) { @@ -193,7 +193,7 @@ TQString KommanderWidget::evalForBlock(const TQStringList& args, const TQString& TQString KommanderWidget::evalIfBlock(const TQStringList& args, const TQString& s, int& pos) { - int f = s.tqfind("@endif", pos); + int f = s.find("@endif", pos); //FIXME: better detection of block boundaries; add error message if (f == -1) { @@ -214,7 +214,7 @@ TQString KommanderWidget::evalIfBlock(const TQStringList& args, const TQString& TQString KommanderWidget::evalSwitchBlock(const TQStringList& args, const TQString& s, int& pos) { - int f = s.tqfind("@end", pos); + int f = s.find("@end", pos); //FIXME: better detection of block boundaries; add error message if (f == -1) { diff --git a/kommander/widget/kommanderwidget.cpp b/kommander/widget/kommanderwidget.cpp index 6c9540be..793be627 100644 --- a/kommander/widget/kommanderwidget.cpp +++ b/kommander/widget/kommanderwidget.cpp @@ -74,7 +74,7 @@ TQStringList KommanderWidget::associatedText() const bool KommanderWidget::hasAssociatedText() { - int index = states().tqfindIndex(currentState()); + int index = states().findIndex(currentState()); if (index == -1 || m_associatedText[index].isEmpty()) return false; return true; @@ -113,7 +113,7 @@ void KommanderWidget::setDisplayStates(const TQStringList& a_displayStates) TQString KommanderWidget::evalAssociatedText() // expands and returns associated text as a string { - int index = ( states().tqfindIndex( currentState()) ); + int index = ( states().findIndex( currentState()) ); if (index == -1) { printError(i18n("Invalid state for associated text.")); @@ -143,7 +143,7 @@ TQString KommanderWidget::evalAssociatedText(const TQString& a_text) int pos = 0, baseTextLength = a_text.length(); while (pos < baseTextLength) { - int ident = a_text.tqfind(ESCCHAR, pos); + int ident = a_text.find(ESCCHAR, pos); if (ident == -1) { evalText += a_text.mid(pos); break; @@ -164,7 +164,7 @@ TQString KommanderWidget::evalAssociatedText(const TQString& a_text) if (identifier.isEmpty()) { if (pos < baseTextLength && a_text[pos] == '#') { // comment - int newpos = a_text.tqfind('\n', pos+1); + int newpos = a_text.find('\n', pos+1); if (newpos == -1) newpos = a_text.length(); if (pos > 1 && a_text[pos-2] == '\n') @@ -260,7 +260,7 @@ TQString KommanderWidget::DCOPQuery(const TQStringList& a_query) // parse function arguments TQString function = a_query[2], pTypes; function.remove(' '); - int start = function.tqfind('('); + int start = function.find('('); bool ok = false; if (start != -1) pTypes = parseBrackets(function, start, ok); @@ -296,7 +296,7 @@ TQString KommanderWidget::DCOPQuery(const TQStringList& a_query) else if (argTypes[i] == "bool") byteDataStream << (bool)(a_query[i+3] != "false" && a_query[i+3] != "false" && a_query[i+3] != "0"); else if (argTypes[i] == TQSTRINGLIST_OBJECT_NAME_STRING) - if (a_query[i+3].tqfind('\n') != -1) + if (a_query[i+3].find('\n') != -1) byteDataStream << TQStringList::split("\n", a_query[i+3], true); else byteDataStream << TQStringList::split("\\n", a_query[i+3], true); @@ -616,7 +616,7 @@ int KommanderWidget::parseBlockBoundary(const TQString& s, int from, const TQStr int shortest = -1; for (uint i=0; i<args.count(); i++) { - int match = s.tqfind(args[i], from); + int match = s.find(args[i], from); if (shortest > match || shortest == -1) shortest = match; } @@ -632,7 +632,7 @@ TQString KommanderWidget::substituteVariable(TQString text, TQString variable, T int newpos, pos = 0; while (true) { - newpos = text.tqfind(var, pos); + newpos = text.find(var, pos); if (newpos != -1) { newtext += text.mid(pos, newpos-pos); diff --git a/kommander/widget/myprocess.cpp b/kommander/widget/myprocess.cpp index 4914a95a..90d2caf0 100644 --- a/kommander/widget/myprocess.cpp +++ b/kommander/widget/myprocess.cpp @@ -74,7 +74,7 @@ TQString MyProcess::run(const TQString& a_command, const TQString& a_shell) // Look for shell if (at.startsWith("#!")) { - int eol = at.tqfind("\n"); + int eol = at.find("\n"); if (eol == -1) eol = at.length(); shellName = at.mid(2, eol-1).stripWhiteSpace(); diff --git a/kommander/widget/parser.cpp b/kommander/widget/parser.cpp index 07ffb88c..848507bb 100644 --- a/kommander/widget/parser.cpp +++ b/kommander/widget/parser.cpp @@ -24,7 +24,7 @@ using namespace Parse; TQString unescape(TQString s) { - return s.tqreplace("\\\"", "\"").tqreplace("\\t", "\t").tqreplace("\\n", "\n").tqreplace("\\\\", "\\"); + return s.replace("\\\"", "\"").replace("\\t", "\t").replace("\\n", "\n").replace("\\\\", "\\"); } Parser::Parser(ParserData* pData) : m_data(pData), m_start(0), m_error(TQString()), m_errorPosition(0), @@ -814,9 +814,9 @@ void Parser::setVariable(const TQString& name, ParseNode value) ParseNode Parser::variable(const TQString& name) const { if (isGlobal(name)) - return m_globalVariables.tqcontains(name) ? m_globalVariables[name] : ParseNode(); + return m_globalVariables.contains(name) ? m_globalVariables[name] : ParseNode(); else - return m_variables.tqcontains(name) ? m_variables[name] : ParseNode(); + return m_variables.contains(name) ? m_variables[name] : ParseNode(); } bool Parser::isGlobal(const TQString& name) const @@ -826,7 +826,7 @@ bool Parser::isGlobal(const TQString& name) const bool Parser::isVariable(const TQString& name) const { - return m_variables.tqcontains(name) || m_globalVariables.tqcontains(name); + return m_variables.contains(name) || m_globalVariables.contains(name); } void Parser::unsetVariable(const TQString& key) @@ -847,7 +847,7 @@ const TQMap<TQString, ParseNode>& Parser::array(const TQString& name) const bool Parser::isArray(const TQString& name) const { - return m_arrays.tqcontains(name) || m_globalArrays.tqcontains(name); + return m_arrays.contains(name) || m_globalArrays.contains(name); } void Parser::setArray(const TQString& name, const TQString& key, ParseNode value) @@ -881,9 +881,9 @@ ParseNode Parser::arrayValue(const TQString& name, const TQString& key) const if (!isArray(name)) return ParseNode(); if (isGlobal(name)) - return m_globalArrays[name].tqcontains(key) ? m_globalArrays[name][key] : ParseNode(); + return m_globalArrays[name].contains(key) ? m_globalArrays[name][key] : ParseNode(); else - return m_arrays[name].tqcontains(key) ? m_arrays[name][key] : ParseNode(); + return m_arrays[name].contains(key) ? m_arrays[name][key] : ParseNode(); } diff --git a/kommander/widget/parserdata.cpp b/kommander/widget/parserdata.cpp index b5346fd4..274d7220 100644 --- a/kommander/widget/parserdata.cpp +++ b/kommander/widget/parserdata.cpp @@ -19,7 +19,7 @@ using namespace Parse; KeywordGroup ParserData::keywordGroup(Keyword k) const { - if (m_groups.tqcontains(k)) + if (m_groups.contains(k)) return m_groups[k]; else return GroupMisc; @@ -28,7 +28,7 @@ KeywordGroup ParserData::keywordGroup(Keyword k) const Keyword ParserData::stringToKeyword(const TQString& s) const { TQString k = s.lower(); - if (m_keywords.tqcontains(k)) + if (m_keywords.contains(k)) return m_keywords[k]; else return Variable; @@ -116,7 +116,7 @@ ParserData::ParserData() bool ParserData::isFunction(const TQString& name) const { - return m_functions.tqcontains(name.lower()); + return m_functions.contains(name.lower()); } const Function& ParserData::function(const TQString& name) const |