diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-07 03:45:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-07 03:45:53 +0000 |
commit | 10308be19ef7fa44699562cc75946e7ea1fdf6b9 (patch) | |
tree | 4bc444c00a79e88105f2cfce5b6209994c413ca0 /kate/part/katecmds.cpp | |
parent | 307136d8eef0ba133b78ceee8e901138d4c996a1 (diff) | |
download | tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.tar.gz tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.zip |
Revert automated changes
Sorry guys, they are just not ready for prime time
Work will continue as always
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1212479 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/part/katecmds.cpp')
-rw-r--r-- | kate/part/katecmds.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/kate/part/katecmds.cpp b/kate/part/katecmds.cpp index 060a8c63c..b64b5414e 100644 --- a/kate/part/katecmds.cpp +++ b/kate/part/katecmds.cpp @@ -74,14 +74,14 @@ TQStringList KateCommands::CoreCommands::cmds() TQStringList l; l << "indent" << "unindent" << "cleanindent" << "comment" << "uncomment" << "goto" << "kill-line" - << "set-tab-width" << "set-tqreplace-tabs" << "set-show-tabs" + << "set-tab-width" << "set-replace-tabs" << "set-show-tabs" << "set-remove-trailing-space" << "set-indent-spaces" << "set-indent-width" << "set-mixed-indent" << "set-indent-mode" << "set-auto-indent" << "set-line-numbers" << "set-folding-markers" << "set-icon-border" << "set-wrap-cursor" << "set-word-wrap" << "set-word-wrap-column" - << "set-tqreplace-tabs-save" << "set-remove-trailing-space-save" + << "set-replace-tabs-save" << "set-remove-trailing-space-save" << "set-highlight" << "run-myself" << "set-show-indent"; return l; } @@ -175,7 +175,7 @@ bool KateCommands::CoreCommands::exec(Kate::View *view, cmd == "set-word-wrap-column" || cmd == "goto" ) { - // tqfind a integer value > 0 + // find a integer value > 0 if ( ! args.count() ) KCC_ERR( i18n("Missing argument. Usage: %1 <value>").arg( cmd ) ); bool ok; @@ -217,14 +217,14 @@ bool KateCommands::CoreCommands::exec(Kate::View *view, else if ( cmd == "set-icon-border" || cmd == "set-folding-markers" || cmd == "set-line-numbers" || - cmd == "set-tqreplace-tabs" || + cmd == "set-replace-tabs" || cmd == "set-remove-trailing-space" || cmd == "set-show-tabs" || cmd == "set-indent-spaces" || cmd == "set-mixed-indent" || cmd == "set-word-wrap" || cmd == "set-wrap-cursor" || - cmd == "set-tqreplace-tabs-save" || + cmd == "set-replace-tabs-save" || cmd == "set-remove-trailing-space-save" || cmd == "set-show-indent" ) { @@ -241,7 +241,7 @@ bool KateCommands::CoreCommands::exec(Kate::View *view, v->setLineNumbersOn( enable ); else if ( cmd == "set-show-indent" ) v->renderer()->setShowIndentLines( enable ); - else if ( cmd == "set-tqreplace-tabs" ) + else if ( cmd == "set-replace-tabs" ) setDocFlag( KateDocumentConfig::cfReplaceTabsDyn, enable, v->doc() ); else if ( cmd == "set-remove-trailing-space" ) setDocFlag( KateDocumentConfig::cfRemoveTrailingDyn, enable, v->doc() ); @@ -298,14 +298,14 @@ KCompletion *KateCommands::CoreCommands::completionObject( const TQString &cmd, //END CoreCommands //BEGIN SedReplace -static void tqreplace(TQString &s, const TQString &needle, const TQString &with) +static void replace(TQString &s, const TQString &needle, const TQString &with) { int pos=0; while (1) { - pos=s.tqfind(needle, pos); + pos=s.find(needle, pos); if (pos==-1) break; - s.tqreplace(pos, needle.length(), with); + s.replace(pos, needle.length(), with); pos+=with.length(); } @@ -341,16 +341,16 @@ static int backslashString(const TQString &haystack, const TQString &needle, int // exchange "\t" for the actual tab character, for example static void exchangeAbbrevs(TQString &str) { - // the format is (tqfindtqreplace)*[nullzero] + // the format is (findreplace)*[nullzero] const char *magic="a\x07t\tn\n"; while (*magic) { int index=0; - char tqreplace=magic[1]; + char replace=magic[1]; while ((index=backslashString(str, TQChar(*magic), index))!=-1) { - str.tqreplace(index, 2, TQChar(tqreplace)); + str.replace(index, 2, TQChar(replace)); index++; } magic++; @@ -359,7 +359,7 @@ static void exchangeAbbrevs(TQString &str) } int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, - const TQString &tqfind, const TQString &repOld, const TQString &delim, + const TQString &find, const TQString &repOld, const TQString &delim, bool noCase, bool repeat, uint startcol, int endcol ) { @@ -369,14 +369,14 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, // HANDLING "\n"s in PATTERN // * Create a list of patterns, splitting PATTERN on (unescaped) "\n" // * insert $s and ^s to match line ends/beginnings - // * When matching patterhs after the first one, tqreplace \N with the captured + // * When matching patterhs after the first one, replace \N with the captured // text. // * If all patterns in the list match sequentiel lines, there is a match, so // * remove line/start to line + patterns.count()-1/patterns.last.length // * handle capatures by putting them in one list. // * the existing insertion is fine, including the line calculation. - TQStringList patterns = TQStringList::split( TQRegExp("(^\\\\n|(?![^\\\\])\\\\n)"), tqfind, true ); + TQStringList patterns = TQStringList::split( TQRegExp("(^\\\\n|(?![^\\\\])\\\\n)"), find, true ); if ( patterns.count() > 1 ) { @@ -407,7 +407,7 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, TQString rep=repOld; - // now set the backreferences in the tqreplacement + // now set the backreferences in the replacement TQStringList backrefs=matcher.capturedTexts(); int refnum=1; @@ -425,7 +425,7 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, index=backslashString(rep, number, index); if (index>=0) { - rep.tqreplace(index, 2, *i); + rep.replace(index, 2, *i); index+=(*i).length(); } } @@ -433,16 +433,16 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, refnum++; } - tqreplace(rep, "\\\\", "\\"); - tqreplace(rep, "\\" + delim, delim); + replace(rep, "\\\\", "\\"); + replace(rep, "\\" + delim, delim); doc->removeText( line, startcol, line, startcol + len ); doc->insertText( line, startcol, rep ); - // TODO if tqreplace tqcontains \n, + // TODO if replace contains \n, // change the line number and // check for text that needs be searched behind the last inserted newline. - int lns = rep.tqcontains('\n'); + int lns = rep.contains('\n'); if ( lns ) { line += lns; @@ -451,8 +451,8 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, { // if ( endcol >= startcol + len ) endcol -= (startcol + len); - uint sc = rep.length() - rep.tqfindRev('\n') - 1; - matches += sedMagic( doc, line, tqfind, repOld, delim, noCase, repeat, sc, endcol ); + uint sc = rep.length() - rep.findRev('\n') - 1; + matches += sedMagic( doc, line, find, repOld, delim, noCase, repeat, sc, endcol ); } } @@ -486,16 +486,16 @@ bool KateCommands::SedReplace::exec (Kate::View *view, const TQString &cmd, TQSt TQRegExp splitter( TQString("^[$%]?s\\s*") + d + "((?:[^\\\\\\" + d + "]|\\\\.)*)\\" + d +"((?:[^\\\\\\" + d + "]|\\\\.)*)\\" + d + "[ig]{0,2}$" ); if (splitter.search(cmd)<0) return false; - TQString tqfind=splitter.cap(1); - kdDebug(13025)<< "SedReplace: tqfind=" << tqfind.latin1() <<endl; + TQString find=splitter.cap(1); + kdDebug(13025)<< "SedReplace: find=" << find.latin1() <<endl; - TQString tqreplace=splitter.cap(2); - exchangeAbbrevs(tqreplace); - kdDebug(13025)<< "SedReplace: tqreplace=" << tqreplace.latin1() <<endl; + TQString replace=splitter.cap(2); + exchangeAbbrevs(replace); + kdDebug(13025)<< "SedReplace: replace=" << replace.latin1() <<endl; - if ( tqfind.tqcontains("\\n") ) + if ( find.contains("\\n") ) { - msg = i18n("Sorry, but Kate is not able to tqreplace newlines, yet"); + msg = i18n("Sorry, but Kate is not able to replace newlines, yet"); return false; } @@ -511,7 +511,7 @@ bool KateCommands::SedReplace::exec (Kate::View *view, const TQString &cmd, TQSt uint numLines=doc->numLines(); for (int line=0; (uint)line < numLines; line++) { - res += sedMagic( doc, line, tqfind, tqreplace, d, !noCase, repeat ); + res += sedMagic( doc, line, find, replace, d, !noCase, repeat ); if ( ! repeat && res ) break; } } @@ -524,7 +524,7 @@ bool KateCommands::SedReplace::exec (Kate::View *view, const TQString &cmd, TQSt if ( startline == doc->selEndLine() ) endcol = doc->selEndCol(); - res += sedMagic( doc, startline, tqfind, tqreplace, d, !noCase, repeat, startcol, endcol ); + res += sedMagic( doc, startline, find, replace, d, !noCase, repeat, startcol, endcol ); /*if ( startcol )*/ startcol = 0; @@ -534,10 +534,10 @@ bool KateCommands::SedReplace::exec (Kate::View *view, const TQString &cmd, TQSt else // just this line { int line=view->cursorLine(); - res += sedMagic(doc, line, tqfind, tqreplace, d, !noCase, repeat); + res += sedMagic(doc, line, find, replace, d, !noCase, repeat); } - msg = i18n("1 tqreplacement done", "%n tqreplacements done",res ); + msg = i18n("1 replacement done", "%n replacements done",res ); doc->editEnd(); @@ -562,7 +562,7 @@ bool KateCommands::Character::exec (Kate::View *view, const TQString &_cmd, TQSt int base=10; if (cmd[0]=='x' || cmd.left(2)=="0x") { - cmd.tqreplace(TQRegExp("^0?x"), ""); + cmd.replace(TQRegExp("^0?x"), ""); base=16; } else if (cmd[0]=='0') @@ -578,7 +578,7 @@ bool KateCommands::Character::exec (Kate::View *view, const TQString &_cmd, TQSt view->insertText(TQString(buf)); } else - { // do the tqunicode thing + { // do the unicode thing TQChar c(number); view->insertText(TQString(&c, 1)); } @@ -593,13 +593,13 @@ bool KateCommands::Date::exec (Kate::View *view, const TQString &cmd, TQString & if (cmd.left(4) != "date") return false; - if (TQDateTime::tqcurrentDateTime().toString(cmd.mid(5, cmd.length()-5)).length() > 0) - view->insertText(TQDateTime::tqcurrentDateTime().toString(cmd.mid(5, cmd.length()-5))); + if (TQDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5)).length() > 0) + view->insertText(TQDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5))); else - view->insertText(TQDateTime::tqcurrentDateTime().toString("yyyy-MM-dd hh:mm:ss")); + view->insertText(TQDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); return true; } //END Date -// kate: space-indent on; indent-width 2; tqreplace-tabs on; +// kate: space-indent on; indent-width 2; replace-tabs on; |