From 560378aaca1784ba19806a0414a32b20c744de39 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 3 Jan 2011 04:12:51 +0000 Subject: Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1 NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kate/part/.kateconfig | 2 +- kate/part/configure.in.in | 2 +- kate/part/katearbitraryhighlight.cpp | 6 +- kate/part/katearbitraryhighlight.h | 4 +- kate/part/kateattribute.cpp | 2 +- kate/part/kateattribute.h | 2 +- kate/part/kateautoindent.cpp | 134 ++++++++-------- kate/part/kateautoindent.h | 14 +- kate/part/katebookmarks.cpp | 8 +- kate/part/katebookmarks.h | 4 +- kate/part/katebuffer.cpp | 62 ++++---- kate/part/katebuffer.h | 24 +-- kate/part/katecmds.cpp | 80 +++++----- kate/part/katecmds.h | 30 ++-- kate/part/katecodecompletion.cpp | 20 +-- kate/part/katecodecompletion.h | 8 +- kate/part/katecodefoldinghelpers.cpp | 82 +++++----- kate/part/katecodefoldinghelpers.h | 16 +- kate/part/kateconfig.cpp | 4 +- kate/part/kateconfig.h | 2 +- kate/part/katecursor.cpp | 2 +- kate/part/katecursor.h | 6 +- kate/part/katedialogs.cpp | 60 +++---- kate/part/katedialogs.h | 4 +- kate/part/katedocument.cpp | 88 +++++------ kate/part/katedocument.h | 10 +- kate/part/katedocumenthelpers.cpp | 2 +- kate/part/katefactory.cpp | 12 +- kate/part/katefactory.h | 6 +- kate/part/katefiletype.cpp | 32 ++-- kate/part/katefont.cpp | 2 +- kate/part/katehighlight.cpp | 74 ++++----- kate/part/katehighlight.h | 12 +- kate/part/katejscript.cpp | 4 +- kate/part/katejscript.h | 6 +- kate/part/katelinerange.cpp | 2 +- kate/part/kateluaindentscript.cpp | 4 +- kate/part/kateluaindentscript.h | 2 +- kate/part/kateprinter.cpp | 18 +-- kate/part/katerenderer.cpp | 22 +-- kate/part/kateschema.cpp | 76 ++++----- kate/part/kateschema.h | 6 +- kate/part/katesearch.cpp | 296 +++++++++++++++++------------------ kate/part/katesearch.h | 66 ++++---- kate/part/katespell.cpp | 6 +- kate/part/katespell.h | 4 +- kate/part/katesupercursor.cpp | 4 +- kate/part/katesupercursor.h | 8 +- kate/part/katesyntaxdocument.cpp | 4 +- kate/part/katesyntaxdocument.h | 4 +- kate/part/katetemplatehandler.cpp | 4 +- kate/part/katetextline.cpp | 54 +++---- kate/part/katetextline.h | 16 +- kate/part/kateundo.cpp | 2 +- kate/part/kateundo.h | 4 +- kate/part/kateview.cpp | 68 ++++---- kate/part/kateview.h | 26 +-- kate/part/kateviewhelpers.cpp | 14 +- kate/part/kateviewhelpers.h | 4 +- kate/part/kateviewinternal.cpp | 18 +-- kate/part/kateviewinternal.h | 12 +- kate/part/test_regression.cpp | 44 +++--- kate/part/test_regression.h | 4 +- 63 files changed, 809 insertions(+), 809 deletions(-) (limited to 'kate/part') diff --git a/kate/part/.kateconfig b/kate/part/.kateconfig index 5b0885abe..46471127e 100644 --- a/kate/part/.kateconfig +++ b/kate/part/.kateconfig @@ -1 +1 @@ -kate: space-indent on; indent-width 2; replace-tabs on; +kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/configure.in.in b/kate/part/configure.in.in index faf0717e9..204825d34 100644 --- a/kate/part/configure.in.in +++ b/kate/part/configure.in.in @@ -55,7 +55,7 @@ dnl Based on the lua check used by yzis-M3 ) - dnl find the libs name + dnl tqfind the libs name if test -z "$LUALIBH_FOUND" -o -z "$LUAH_FOUND"; then LUA_LIBS="" else diff --git a/kate/part/katearbitraryhighlight.cpp b/kate/part/katearbitraryhighlight.cpp index a9a4fe37c..a86f26a77 100644 --- a/kate/part/katearbitraryhighlight.cpp +++ b/kate/part/katearbitraryhighlight.cpp @@ -90,7 +90,7 @@ void KateArbitraryHighlight::addHighlightToView(KateSuperRangeList* list, KateVi } void KateArbitraryHighlight::slotRangeListDeleted(TQObject* obj) { - int id=m_docHLs.findRef(static_cast(obj)); + int id=m_docHLs.tqfindRef(static_cast(obj)); if (id>=0) m_docHLs.take(id); for (TQMap* >::Iterator it = m_viewHLs.begin(); it != m_viewHLs.end(); ++it) @@ -152,11 +152,11 @@ KateView* KateArbitraryHighlight::viewForRange(KateSuperRange* range) { for (TQMap* >::Iterator it = m_viewHLs.begin(); it != m_viewHLs.end(); ++it) for (KateSuperRangeList* l = (*it)->first(); l; l = (*it)->next()) - if (l->contains(range)) + if (l->tqcontains(range)) return it.key(); // This must belong to a document-global highlight return 0L; } -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katearbitraryhighlight.h b/kate/part/katearbitraryhighlight.h index 4dd5a362b..ef6e214a8 100644 --- a/kate/part/katearbitraryhighlight.h +++ b/kate/part/katearbitraryhighlight.h @@ -57,7 +57,7 @@ public: * - identical highlight for whole list * - signals for view movement */ -class KateArbitraryHighlight : public QObject +class KateArbitraryHighlight : public TQObject { Q_OBJECT @@ -84,4 +84,4 @@ private: #endif -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/kateattribute.cpp b/kate/part/kateattribute.cpp index 9ed6349f6..068d0d571 100644 --- a/kate/part/kateattribute.cpp +++ b/kate/part/kateattribute.cpp @@ -265,4 +265,4 @@ bool operator !=(const KateAttribute& h1, const KateAttribute& h2) return !(h1 == h2); } -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/kateattribute.h b/kate/part/kateattribute.h index a54279b24..7960f06b1 100644 --- a/kate/part/kateattribute.h +++ b/kate/part/kateattribute.h @@ -144,4 +144,4 @@ private: #endif -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/kateautoindent.cpp b/kate/part/kateautoindent.cpp index ed9a6169b..e2deea691 100644 --- a/kate/part/kateautoindent.cpp +++ b/kate/part/kateautoindent.cpp @@ -170,7 +170,7 @@ void KateViewIndentationAction::slotAboutToShow() popupMenu()->clear (); for (uint z=0; zinsertItem ( '&' + KateAutoIndent::modeDescription(z).replace('&', "&&"), this, TQT_SLOT(setMode(int)), 0, z); + popupMenu()->insertItem ( '&' + KateAutoIndent::modeDescription(z).tqreplace('&', "&&"), this, TQT_SLOT(setMode(int)), 0, z); popupMenu()->setItemChecked (doc->config()->indentationMode(), true); } @@ -224,55 +224,55 @@ void KateNormalIndent::updateConfig () for (uint i=0; iname; - if (name.find("Comment") != -1 && commentAttrib == 255) + if (name.tqfind("Comment") != -1 && commentAttrib == 255) { commentAttrib = i; } - else if (name.find("Region Marker") != -1 && regionAttrib == 255) + else if (name.tqfind("Region Marker") != -1 && regionAttrib == 255) { regionAttrib = i; } - else if (name.find("Symbol") != -1 && symbolAttrib == 255) + else if (name.tqfind("Symbol") != -1 && symbolAttrib == 255) { symbolAttrib = i; } - else if (name.find("Alert") != -1) + else if (name.tqfind("Alert") != -1) { alertAttrib = i; } - else if (name.find("Comment") != -1 && commentAttrib != 255 && doxyCommentAttrib == 255) + else if (name.tqfind("Comment") != -1 && commentAttrib != 255 && doxyCommentAttrib == 255) { doxyCommentAttrib = i; } - else if (name.find("Tags") != -1 && tagAttrib == 255) + else if (name.tqfind("Tags") != -1 && tagAttrib == 255) { tagAttrib = i; } - else if (name.find("Word") != -1 && wordAttrib == 255) + else if (name.tqfind("Word") != -1 && wordAttrib == 255) { wordAttrib = i; } - else if (name.find("Keyword") != -1 && keywordAttrib == 255) + else if (name.tqfind("Keyword") != -1 && keywordAttrib == 255) { keywordAttrib = i; } - else if (name.find("Normal") != -1 && normalAttrib == 255) + else if (name.tqfind("Normal") != -1 && normalAttrib == 255) { normalAttrib = i; } - else if (name.find("Extensions") != -1 && extensionAttrib == 255) + else if (name.tqfind("Extensions") != -1 && extensionAttrib == 255) { extensionAttrib = i; } - else if (name.find("Preprocessor") != -1 && preprocessorAttrib == 255) + else if (name.tqfind("Preprocessor") != -1 && preprocessorAttrib == 255) { preprocessorAttrib = i; } - else if (name.find("String") != -1 && stringAttrib == 255) + else if (name.tqfind("String") != -1 && stringAttrib == 255) { stringAttrib = i; } - else if (name.find("Char") != -1 && charAttrib == 255) + else if (name.tqfind("Char") != -1 && charAttrib == 255) { charAttrib = i; } @@ -287,7 +287,7 @@ bool KateNormalIndent::isBalanced (KateDocCursor &begin, const KateDocCursor &en pos = doc->plainKateTextLine(begin.line())->firstChar(); - // Iterate one-by-one finding opening and closing chars + // Iterate one-by-one tqfinding opening and closing chars // Assume that open and close are 'Symbol' characters while (begin < end) { @@ -449,11 +449,11 @@ void KateCSmartIndent::processLine (KateDocCursor &line) if (first == '}') { - indent = findOpeningBrace(line); + indent = tqfindOpeningBrace(line); } else if (first == ')') { - indent = findOpeningParen(line); + indent = tqfindOpeningParen(line); } else if (first == '{') { @@ -465,7 +465,7 @@ void KateCSmartIndent::processLine (KateDocCursor &line) else if (first == ':') { // Initialization lists (handle c++ and c#) - int pos = findOpeningBrace(line); + int pos = tqfindOpeningBrace(line); if (pos == 0) indent = indentWidth; else @@ -483,7 +483,7 @@ void KateCSmartIndent::processLine (KateDocCursor &line) textLine->stringAtPos (firstChar, "Q_SLOTS") || textLine->stringAtPos (firstChar, "slots")) { - indent = findOpeningBrace(line) + indentWidth; + indent = tqfindOpeningBrace(line) + indentWidth; } } else if (first == '*') @@ -493,7 +493,7 @@ void KateCSmartIndent::processLine (KateDocCursor &line) int lineEnd = textLine->lastChar(); if (lineEnd > 0 && textLine->getChar(lineEnd - 1) == '*') { - indent = findOpeningComment(line); + indent = tqfindOpeningComment(line); if (textLine->attribute(firstChar) == doxyCommentAttrib) indent++; } @@ -583,7 +583,7 @@ bool KateCSmartIndent::handleDoxygen (KateDocCursor &begin) if (last <= 0 || !(justAfterDoxygen = textLine->stringAtPos(last-1, "*/"))) insideDoxygen = true; if (justAfterDoxygen) - justAfterDoxygen &= textLine->string().find("/**") < 0; + justAfterDoxygen &= textLine->string().tqfind("/**") < 0; while (textLine->attribute(first) != doxyCommentAttrib && first <= textLine->lastChar()) first++; if (textLine->stringAtPos(first, "//")) @@ -595,7 +595,7 @@ bool KateCSmartIndent::handleDoxygen (KateDocCursor &begin) { textLine = doc->plainKateTextLine(begin.line()); first = textLine->firstChar(); - int indent = findOpeningComment(begin); + int indent = tqfindOpeningComment(begin); TQString filler = tabString (indent); bool doxygenAutoInsert = doc->config()->configFlags() & KateDocumentConfig::cfDoxygenAutoTyping; @@ -618,7 +618,7 @@ bool KateCSmartIndent::handleDoxygen (KateDocCursor &begin) { textLine = doc->plainKateTextLine(begin.line()); first = textLine->firstChar(); - int indent = findOpeningComment(begin); + int indent = tqfindOpeningComment(begin); TQString filler = tabString (indent); doc->removeText (begin.line(), 0, begin.line(), first); @@ -700,7 +700,7 @@ static inline bool colonPermitsReindent(const KateNormalIndent &indenter, { const TQString txt = line->string(0,curCol); // do we have any significant preceding colon? - for (int pos = 0; (pos = txt.find(':', pos)) >= 0; pos++) { + for (int pos = 0; (pos = txt.tqfind(':', pos)) >= 0; pos++) { if (line->attribute(pos) == indenter.symbolAttrib) // yes, it has already contributed to this line's indentation, don't // indent again @@ -722,7 +722,7 @@ void KateCSmartIndent::processChar(TQChar c) static const TQString triggers("}{)/:#n"); static const TQString firstTriggers("}{)/:#"); static const TQString lastTriggers(":n"); - if (triggers.find(c) < 0) + if (triggers.tqfind(c) < 0) return; KateView *view = doc->activeView(); @@ -748,7 +748,7 @@ void KateCSmartIndent::processChar(TQChar c) if (c == 'n') { - if (firstChar != '#' || textLine->string(curCol-5, 5) != TQString::fromLatin1("regio")) + if (firstChar != '#' || textLine->string(curCol-5, 5) != TQString::tqfromLatin1("regio")) return; } @@ -775,8 +775,8 @@ void KateCSmartIndent::processChar(TQChar c) // of the line const TQChar lastChar = textLine->getChar(textLine->lastChar()); int pos; - if (((c == firstChar && firstTriggers.find(firstChar) >= 0) - || (c == lastChar && lastTriggers.find(lastChar) >= 0)) + if (((c == firstChar && firstTriggers.tqfind(firstChar) >= 0) + || (c == lastChar && lastTriggers.tqfind(lastChar) >= 0)) && (c != ':' || colonPermitsReindent(*this, textLine, curCol))) processLine(begin); } @@ -1094,12 +1094,12 @@ uint KateCSmartIndent::calcContinue(KateDocCursor &start, KateDocCursor &end) return 0; } -uint KateCSmartIndent::findOpeningBrace(KateDocCursor &start) +uint KateCSmartIndent::tqfindOpeningBrace(KateDocCursor &start) { KateDocCursor cur = start; int count = 1; - // Move backwards 1 by 1 and find the opening brace + // Move backwards 1 by 1 and tqfind the opening brace // Return the indent of that line while (cur.moveBackward(1)) { @@ -1142,12 +1142,12 @@ bool KateCSmartIndent::firstOpeningBrace(KateDocCursor &start) return true; } -uint KateCSmartIndent::findOpeningParen(KateDocCursor &start) +uint KateCSmartIndent::tqfindOpeningParen(KateDocCursor &start) { KateDocCursor cur = start; int count = 1; - // Move backwards 1 by 1 and find the opening ( + // Move backwards 1 by 1 and tqfind the opening ( // Return the indent of that line while (cur.moveBackward(1)) { @@ -1167,7 +1167,7 @@ uint KateCSmartIndent::findOpeningParen(KateDocCursor &start) return 0; } -uint KateCSmartIndent::findOpeningComment(KateDocCursor &start) +uint KateCSmartIndent::tqfindOpeningComment(KateDocCursor &start) { KateDocCursor cur = start; @@ -1176,7 +1176,7 @@ uint KateCSmartIndent::findOpeningComment(KateDocCursor &start) { KateTextLine::Ptr textLine = doc->plainKateTextLine(cur.line()); - int pos = textLine->string().find("/*", false); + int pos = textLine->string().tqfind("/*", false); if (pos >= 0) { KateDocCursor temp(cur.line(), pos, doc); @@ -1322,7 +1322,7 @@ level; for each element that is closed, it is decreased by one. We also have a special case of opening an element on one line and then entering attributes on the following lines, in which case we would like -to see the following layout: +to see the following tqlayout: @@ -1359,7 +1359,7 @@ void KateXmlIndent::processChar (TQChar c) // only alter lines that start with a close element KateView *view = doc->activeView(); TQString text = doc->plainKateTextLine(view->cursorLine())->string(); - if(text.find(startsWithCloseTag) == -1) return; + if(text.tqfind(startsWithCloseTag) == -1) return; // process it processLine(view->cursorLine()); @@ -1404,14 +1404,14 @@ void KateXmlIndent::getLineInfo (uint line, uint &prevIndent, int &numTags, // // // requires that we discount the from the number of closed tags - if(text.find(startsWithCloseTag) != -1) ++numTags; + if(text.tqfind(startsWithCloseTag) != -1) ++numTags; // count the number of open and close tags int lastCh = 0; uint pos, len = text.length(); bool seenOpen = false; for(pos = 0; pos < len; ++pos) { - int ch = text.at(pos).unicode(); + int ch = text.at(pos).tqunicode(); switch(ch) { case '<': seenOpen = true; @@ -1443,12 +1443,12 @@ void KateXmlIndent::getLineInfo (uint line, uint &prevIndent, int &numTags, prevIndent = 0; for(uint backLine = line; backLine; ) { - // find first line with an open tag + // tqfind first line with an open tag KateTextLine::Ptr x = doc->plainKateTextLine(--backLine); - if(x->string().find('<') == -1) continue; + if(x->string().tqfind('<') == -1) continue; // recalculate the indent - if(x->string().find(unclosedDoctype) != -1) --numTags; + if(x->string().tqfind(unclosedDoctype) != -1) --numTags; getLineInfo(backLine, prevIndent, numTags, attrCol, unclosedTag); break; } @@ -1465,13 +1465,13 @@ void KateXmlIndent::getLineInfo (uint line, uint &prevIndent, int &numTags, } if(unclosedTag) { - // find the start of the next attribute, so we can align with it + // tqfind the start of the next attribute, so we can align with it do { - lastCh = text.at(++attrCol).unicode(); + lastCh = text.at(++attrCol).tqunicode(); }while(lastCh && lastCh != ' ' && lastCh != '\t'); while(lastCh == ' ' || lastCh == '\t') { - lastCh = text.at(++attrCol).unicode(); + lastCh = text.at(++attrCol).tqunicode(); } attrCol = prevLine->cursorX(attrCol, tabWidth); @@ -1499,7 +1499,7 @@ uint KateXmlIndent::processLine (uint line) if(indent < 0) indent = 0; // unindent lines that start with a close tag - if(kateLine->string().find(startsWithCloseTag) != -1) { + if(kateLine->string().tqfind(startsWithCloseTag) != -1) { indent -= indentWidth; } if(indent < 0) indent = 0; @@ -1597,7 +1597,7 @@ static TQString initialWhitespace(const KateTextLine::Ptr &line, int chars, bool return text; } -TQString KateCSAndSIndent::findOpeningCommentIndentation(const KateDocCursor &start) +TQString KateCSAndSIndent::tqfindOpeningCommentIndentation(const KateDocCursor &start) { KateDocCursor cur = start; @@ -1606,14 +1606,14 @@ TQString KateCSAndSIndent::findOpeningCommentIndentation(const KateDocCursor &st { KateTextLine::Ptr textLine = doc->plainKateTextLine(cur.line()); - int pos = textLine->string().findRev("/*"); + int pos = textLine->string().tqfindRev("/*"); // FIXME: /* inside /* is possible. This screws up in that case... if (pos >= 0) return initialWhitespace(textLine, pos); } while (cur.gotoPreviousLine()); // should never happen. - kdWarning( 13030 ) << " in a comment, but can't find the start of it" << endl; + kdWarning( 13030 ) << " in a comment, but can't tqfind the start of it" << endl; return TQString::null; } @@ -1636,13 +1636,13 @@ bool KateCSAndSIndent::handleDoxygen (KateDocCursor &begin) // note that we do need to check the start of the line, or lines ending with, say, @brief aren't // recognised. if ( !(textLine->attribute(textLine->lastChar()) == doxyCommentAttrib && !textLine->endingWith("*/")) && - !(textLine->attribute(textLine->firstChar()) == doxyCommentAttrib && !textLine->string().contains("*/")) ) + !(textLine->attribute(textLine->firstChar()) == doxyCommentAttrib && !textLine->string().tqcontains("*/")) ) return false; // our line is inside a doxygen comment. align the *'s and then maybe insert one too ... textLine = doc->plainKateTextLine(begin.line()); first = textLine->firstChar(); - TQString indent = findOpeningCommentIndentation(begin); + TQString indent = tqfindOpeningCommentIndentation(begin); bool doxygenAutoInsert = doc->config()->configFlags() & KateDocumentConfig::cfDoxygenAutoTyping; @@ -1758,9 +1758,9 @@ int KateCSAndSIndent::lastNonCommentChar( const KateDocCursor &line ) KateTextLine::Ptr textLine = doc->plainKateTextLine( line.line() ); TQString str = textLine->string(); - // find a possible start-of-comment - int p = -2; // so the first find starts at position 0 - do p = str.find( "//", p + 2 ); + // tqfind a possible start-of-comment + int p = -2; // so the first tqfind starts at position 0 + do p = str.tqfind( "//", p + 2 ); while ( p >= 0 && textLine->attribute(p) != commentAttrib && textLine->attribute(p) != doxyCommentAttrib ); // no // found? use whole string @@ -1917,8 +1917,8 @@ TQString KateCSAndSIndent::calcIndent (const KateDocCursor &begin) // if the line starts with # (but isn't a c# region thingy), no indentation at all. if( currLineFirst >= 0 && currLine->getChar(currLineFirst) == '#' ) { - if( !currLine->stringAtPos( currLineFirst+1, TQString::fromLatin1("region") ) && - !currLine->stringAtPos( currLineFirst+1, TQString::fromLatin1("endregion") ) ) + if( !currLine->stringAtPos( currLineFirst+1, TQString::tqfromLatin1("region") ) && + !currLine->stringAtPos( currLineFirst+1, TQString::tqfromLatin1("endregion") ) ) return TQString::null; } @@ -1974,10 +1974,10 @@ TQString KateCSAndSIndent::calcIndent (const KateDocCursor &begin) { #define ARRLEN( array ) ( sizeof(array)/sizeof(array[0]) ) for( uint n = 0; n < ARRLEN(scopeKeywords); ++n ) - if( textLine->stringAtPos(pos, TQString::fromLatin1(scopeKeywords[n]) ) ) + if( textLine->stringAtPos(pos, TQString::tqfromLatin1(scopeKeywords[n]) ) ) return calcIndentAfterKeyword( begin, cur, pos, false ); for( uint n = 0; n < ARRLEN(blockScopeKeywords); ++n ) - if( textLine->stringAtPos(pos, TQString::fromLatin1(blockScopeKeywords[n]) ) ) + if( textLine->stringAtPos(pos, TQString::tqfromLatin1(blockScopeKeywords[n]) ) ) return calcIndentAfterKeyword( begin, cur, pos, true ); #undef ARRLEN } @@ -2070,7 +2070,7 @@ TQString KateCSAndSIndent::calcIndentInBrace(const KateDocCursor &indentCursor, // beginning 'namespace'. that's 99% of usage, I'd guess. { if( braceFirst >= 0 && braceLine->attribute(braceFirst) == keywordAttrib && - braceLine->stringAtPos( braceFirst, TQString::fromLatin1( "namespace" ) ) ) + braceLine->stringAtPos( braceFirst, TQString::tqfromLatin1( "namespace" ) ) ) return continuationIndent(indentCursor) + whitespaceToOpenBrace; if( braceCursor.line() > 0 ) @@ -2078,7 +2078,7 @@ TQString KateCSAndSIndent::calcIndentInBrace(const KateDocCursor &indentCursor, KateTextLine::Ptr prevLine = doc->plainKateTextLine(braceCursor.line() - 1); int firstPrev = prevLine->firstChar(); if( firstPrev >= 0 && prevLine->attribute(firstPrev) == keywordAttrib && - prevLine->stringAtPos( firstPrev, TQString::fromLatin1( "namespace" ) ) ) + prevLine->stringAtPos( firstPrev, TQString::tqfromLatin1( "namespace" ) ) ) return continuationIndent(indentCursor) + whitespaceToOpenBrace; } } @@ -2112,7 +2112,7 @@ void KateCSAndSIndent::processChar(TQChar c) { // 'n' trigger is for c# regions. static const TQString triggers("}{)]/:;#n"); - if (triggers.find(c) == -1) + if (triggers.tqfind(c) == -1) return; // for historic reasons, processChar doesn't get a cursor @@ -2194,7 +2194,7 @@ void KateVarIndent::processNewline ( KateDocCursor &begin, bool /*needContinue*/ void KateVarIndent::processChar ( TQChar c ) { // process line if the c is in our list, and we are not in comment text - if ( d->triggers.contains( c ) ) + if ( d->triggers.tqcontains( c ) ) { KateTextLine::Ptr ln = doc->plainKateTextLine( doc->activeView()->cursorLine() ); if ( ln->attribute( doc->activeView()->cursorColumn()-1 ) == commentAttrib ) @@ -2211,7 +2211,7 @@ void KateVarIndent::processLine ( KateDocCursor &line ) { TQString indent; // store the indent string here - // find the first line with content that is not starting with comment text, + // tqfind the first line with content that is not starting with comment text, // and take the position from that int ln = line.line(); int pos = -1; @@ -2372,9 +2372,9 @@ void KateVarIndent::slotVariableChanged( const TQString &var, const TQString &va { d->couples = 0; TQStringList l = TQStringList::split( " ", val ); - if ( l.contains("parens") ) d->couples |= Parens; - if ( l.contains("braces") ) d->couples |= Braces; - if ( l.contains("brackets") ) d->couples |= Brackets; + if ( l.tqcontains("parens") ) d->couples |= Parens; + if ( l.tqcontains("braces") ) d->couples |= Braces; + if ( l.tqcontains("brackets") ) d->couples |= Brackets; } else if ( var == "var-indent-couple-attribute" ) { @@ -2427,7 +2427,7 @@ bool KateVarIndent::hasRelevantOpening( const KateDocCursor &end ) const else if (close = ']' ) opener = '['; else return false; - //Move backwards 1 by 1 and find the opening partner + //Move backwards 1 by 1 and tqfind the opening partner while (cur.moveBackward(1)) { if (cur.currentAttrib() == d->coupleAttrib) @@ -2540,4 +2540,4 @@ void ScriptIndentConfigPage::apply () } //END ScriptIndentConfigPage -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/kateautoindent.h b/kate/part/kateautoindent.h index 7ff1a93d2..ead48d672 100644 --- a/kate/part/kateautoindent.h +++ b/kate/part/kateautoindent.h @@ -67,7 +67,7 @@ class IndenterConfigPage : public QWidget * This baseclass is a real dummy, does nothing beside remembering the document it belongs too, * only to have the object around */ -class KateAutoIndent : public QObject +class KateAutoIndent : public TQObject { Q_OBJECT @@ -321,7 +321,7 @@ protected: TQString tabString(uint length) const; uint tabWidth; //!< The number of characters simulated for a tab - uint indentWidth; //!< The number of characters used when tabs are replaced by spaces + uint indentWidth; //!< The number of characters used when tabs are tqreplaced by spaces public: // Attributes that we should skip over or otherwise know about @@ -366,9 +366,9 @@ class KateCSmartIndent : public KateNormalIndent private: uint calcIndent (KateDocCursor &begin, bool needContinue); uint calcContinue (KateDocCursor &begin, KateDocCursor &end); - uint findOpeningBrace (KateDocCursor &start); - uint findOpeningParen (KateDocCursor &start); - uint findOpeningComment (KateDocCursor &start); + uint tqfindOpeningBrace (KateDocCursor &start); + uint tqfindOpeningParen (KateDocCursor &start); + uint tqfindOpeningComment (KateDocCursor &start); bool firstOpeningBrace (KateDocCursor &start); bool handleDoxygen (KateDocCursor &begin); @@ -459,7 +459,7 @@ class KateCSAndSIndent : public KateNormalIndent TQString calcIndentInBrace(const KateDocCursor &indentCursor, const KateDocCursor &braceCursor, int bracePos); bool handleDoxygen (KateDocCursor &begin); - TQString findOpeningCommentIndentation (const KateDocCursor &start); + TQString tqfindOpeningCommentIndentation (const KateDocCursor &start); TQString indentString; }; @@ -578,4 +578,4 @@ class ScriptIndentConfigPage : public IndenterConfigPage #endif -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katebookmarks.cpp b/kate/part/katebookmarks.cpp index ac1ee73d9..40ae5470c 100644 --- a/kate/part/katebookmarks.cpp +++ b/kate/part/katebookmarks.cpp @@ -169,14 +169,14 @@ void KateBookmarks::insertBookmarks( TQPopupMenu& menu ) TQString bText = KStringHandler::rEmSqueeze ( m_view->getDoc()->textLine( (*it)->line ), menu.fontMetrics(), 32 ); - bText.replace(re, "&&"); // kill undesired accellerators! - bText.replace('\t', ' '); // kill tabs, as they are interpreted as shortcuts + bText.tqreplace(re, "&&"); // kill undesired accellerators! + bText.tqreplace('\t', ' '); // kill tabs, as they are interpreted as shortcuts if ( m_sorting == Position ) { sortArray[i] = (*it)->line; ssort( sortArray, i ); - idx = sortArray.find( (*it)->line ) + 3; + idx = sortArray.tqfind( (*it)->line ) + 3; } menu.insertItem( @@ -284,4 +284,4 @@ void KateBookmarks::marksChanged () m_bookmarkClear->setEnabled( !m_view->getDoc()->marks().isEmpty() ); } -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katebookmarks.h b/kate/part/katebookmarks.h index 88e90ae4f..c4cdf1e1f 100644 --- a/kate/part/katebookmarks.h +++ b/kate/part/katebookmarks.h @@ -35,7 +35,7 @@ class KActionCollection; class TQPopupMenu; class TQMenuData; -class KateBookmarks : public QObject +class KateBookmarks : public TQObject { Q_OBJECT @@ -82,5 +82,5 @@ class KateBookmarks : public QObject #endif -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; // vim: noet ts=2 diff --git a/kate/part/katebuffer.cpp b/kate/part/katebuffer.cpp index 74a9ba59e..33fac3325 100644 --- a/kate/part/katebuffer.cpp +++ b/kate/part/katebuffer.cpp @@ -46,7 +46,7 @@ * loader block size, load 256 kb at once per default * if file size is smaller, fall back to file size */ -static const Q_ULONG KATE_FILE_LOADER_BS = 256 * 1024; +static const TQ_ULONG KATE_FILE_LOADER_BS = 256 * 1024; /** * KATE_AVG_BLOCK_SIZE is in characters ! @@ -54,8 +54,8 @@ static const Q_ULONG KATE_FILE_LOADER_BS = 256 * 1024; * block will max contain around BLOCK_SIZE chars or * BLOCK_LINES lines (after load, later that won't be tracked) */ -static const Q_ULONG KATE_AVG_BLOCK_SIZE = 2048 * 80; -static const Q_ULONG KATE_MAX_BLOCK_LINES = 2048; +static const TQ_ULONG KATE_AVG_BLOCK_SIZE = 2048 * 80; +static const TQ_ULONG KATE_MAX_BLOCK_LINES = 2048; /** * hl will look at the next KATE_HL_LOOKAHEAD lines @@ -172,10 +172,10 @@ class KateFileLoader // should spaces be ignored at end of line? inline bool removeTrailingSpaces () const { return m_removeTrailingSpaces; } - // internal unicode data array - inline const TQChar *unicode () const { return m_text.unicode(); } + // internal tqunicode data array + inline const TQChar *tqunicode () const { return m_text.tqunicode(); } - // read a line, return length + offset in unicode data + // read a line, return length + offset in tqunicode data void readLine (uint &offset, uint &length) { length = 0; @@ -402,7 +402,7 @@ void KateBuffer::editEnd () KateBufBlock *buf2 = 0; bool needContinue = false; - while ((buf2 = findBlock(editTagLineStart))) + while ((buf2 = tqfindBlock(editTagLineStart))) { needContinue = doHighlight (buf2, (editTagLineStart > buf2->startLine()) ? editTagLineStart : buf2->startLine(), @@ -543,7 +543,7 @@ bool KateBuffer::canEncode () kdDebug(13020) << "ENC NAME: " << codec->name() << endl; - // hardcode some unicode encodings which can encode all chars + // hardcode some tqunicode encodings which can encode all chars if ((TQString(codec->name()) == "UTF-8") || (TQString(codec->name()) == "ISO-10646-UCS-2")) return true; @@ -618,7 +618,7 @@ KateTextLine::Ptr KateBuffer::line_internal (KateBufBlock *buf, uint i) { // update hl until this line + max KATE_HL_LOOKAHEAD KateBufBlock *buf2 = 0; - while ((i >= m_lineHighlighted) && (buf2 = findBlock(m_lineHighlighted))) + while ((i >= m_lineHighlighted) && (buf2 = tqfindBlock(m_lineHighlighted))) { uint end = kMin(i + KATE_HL_LOOKAHEAD, buf2->endLine()); @@ -637,7 +637,7 @@ KateTextLine::Ptr KateBuffer::line_internal (KateBufBlock *buf, uint i) return buf->line (i - buf->startLine()); } -KateBufBlock *KateBuffer::findBlock_internal (uint i, uint *index) +KateBufBlock *KateBuffer::tqfindBlock_internal (uint i, uint *index) { uint lastLine = m_blocks[m_lastInSyncBlock]->endLine (); @@ -701,7 +701,7 @@ KateBufBlock *KateBuffer::findBlock_internal (uint i, uint *index) void KateBuffer::changeLine(uint i) { - KateBufBlock *buf = findBlock(i); + KateBufBlock *buf = tqfindBlock(i); if (!buf) return; @@ -725,9 +725,9 @@ void KateBuffer::insertLine(uint i, KateTextLine::Ptr line) uint index = 0; KateBufBlock *buf; if (i == m_lines) - buf = findBlock(i-1, &index); + buf = tqfindBlock(i-1, &index); else - buf = findBlock(i, &index); + buf = tqfindBlock(i, &index); if (!buf) return; @@ -772,7 +772,7 @@ void KateBuffer::insertLine(uint i, KateTextLine::Ptr line) void KateBuffer::removeLine(uint i) { uint index = 0; - KateBufBlock *buf = findBlock(i, &index); + KateBufBlock *buf = tqfindBlock(i, &index); if (!buf) return; @@ -849,7 +849,7 @@ void KateBuffer::setTabWidth (uint w) m_tabWidth = w; if (m_highlight && m_highlight->foldingIndentationSensitive()) - invalidateHighlighting(); + tqinvalidateHighlighting(); } } @@ -860,12 +860,12 @@ void KateBuffer::setHighlight(uint hlMode) // aha, hl will change if (h != m_highlight) { - bool invalidate = !h->noHighlighting(); + bool tqinvalidate = !h->noHighlighting(); if (m_highlight) { m_highlight->release(); - invalidate = true; + tqinvalidate = true; } h->use(); @@ -880,8 +880,8 @@ void KateBuffer::setHighlight(uint hlMode) m_highlight = h; - if (invalidate) - invalidateHighlighting(); + if (tqinvalidate) + tqinvalidateHighlighting(); // inform the document that the hl was really changed // needed to update attributes and more ;) @@ -889,7 +889,7 @@ void KateBuffer::setHighlight(uint hlMode) } } -void KateBuffer::invalidateHighlighting() +void KateBuffer::tqinvalidateHighlighting() { m_lineHighlightedMax = 0; m_lineHighlighted = 0; @@ -906,7 +906,7 @@ void KateBuffer::updatePreviousNotEmptyLine(KateBufBlock *blk,uint current_line, uint line=blk->startLine()+current_line; if (line==0) return; line--; - blk=findBlock(line); + blk=tqfindBlock(line); if (!blk) { kdDebug(13020)<<"updatePreviousNotEmptyLine: block not found, this must not happen"< &foldingList, } } -bool KateBuffer::doHighlight (KateBufBlock *buf, uint startLine, uint endLine, bool invalidate) +bool KateBuffer::doHighlight (KateBufBlock *buf, uint startLine, uint endLine, bool tqinvalidate) { // no hl around, no stuff to do if (!m_highlight) @@ -971,13 +971,13 @@ bool KateBuffer::doHighlight (KateBufBlock *buf, uint startLine, uint endLine, b //kdDebug (13020) << "HL UNTIL LINE: " << m_lineHighlighted << " MAX: " << m_lineHighlightedMax << endl; //kdDebug (13020) << "HL DYN COUNT: " << KateHlManager::self()->countDynamicCtxs() << " MAX: " << m_maxDynamicContexts << endl; - // see if there are too many dynamic contexts; if yes, invalidate HL of all documents + // see if there are too many dynamic contexts; if yes, tqinvalidate HL of all documents if (KateHlManager::self()->countDynamicCtxs() >= m_maxDynamicContexts) { { if (KateHlManager::self()->resetDynamicCtxs()) { - kdDebug (13020) << "HL invalidated - too many dynamic contexts ( >= " << m_maxDynamicContexts << ")" << endl; + kdDebug (13020) << "HL tqinvalidated - too many dynamic contexts ( >= " << m_maxDynamicContexts << ")" << endl; // avoid recursive invalidation KateHlManager::self()->setForceNoDCReset(true); @@ -988,7 +988,7 @@ bool KateBuffer::doHighlight (KateBufBlock *buf, uint startLine, uint endLine, b // doHighlight *shall* do his work. After invalidation, some highlight has // been recalculated, but *maybe not* until endLine ! So we shall force it manually... KateBufBlock *buf = 0; - while ((endLine > m_lineHighlighted) && (buf = findBlock(m_lineHighlighted))) + while ((endLine > m_lineHighlighted) && (buf = tqfindBlock(m_lineHighlighted))) { uint end = kMin(endLine, buf->endLine()); @@ -1240,7 +1240,7 @@ bool KateBuffer::doHighlight (KateBufBlock *buf, uint startLine, uint endLine, b buf->markDirty (); // tag the changed lines ! - if (invalidate) + if (tqinvalidate) emit tagLines (startLine, current_line + buf->startLine()); // emit that we have changed the folding @@ -1353,14 +1353,14 @@ void KateBufBlock::fillBlock (KateFileLoader *stream) { uint offset = 0, length = 0; stream->readLine(offset, length); - const TQChar *unicodeData = stream->unicode () + offset; + const TQChar *tqunicodeData = stream->tqunicode () + offset; // strip spaces at end of line if ( stream->removeTrailingSpaces() ) { while (length > 0) { - if (unicodeData[length-1].isSpace()) + if (tqunicodeData[length-1].isSpace()) --length; else break; @@ -1391,13 +1391,13 @@ void KateBufBlock::fillBlock (KateFileLoader *stream) memcpy(buf+pos, (char *) &length, sizeof(uint)); pos += sizeof(uint); - memcpy(buf+pos, (char *) unicodeData, sizeof(TQChar)*length); + memcpy(buf+pos, (char *) tqunicodeData, sizeof(TQChar)*length); pos += sizeof(TQChar)*length; } else { KateTextLine::Ptr textLine = new KateTextLine (); - textLine->insertText (0, length, unicodeData); + textLine->insertText (0, length, tqunicodeData); m_stringList.push_back (textLine); } @@ -1657,4 +1657,4 @@ void KateBufBlockList::removeInternal (KateBufBlock *buf) //END KateBufBlockList -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katebuffer.h b/kate/part/katebuffer.h index 602571c53..0f6672f0b 100644 --- a/kate/part/katebuffer.h +++ b/kate/part/katebuffer.h @@ -40,7 +40,7 @@ class KateFileLoader; class TQTextCodec; /** - * The KateBufBlock class contains an amount of data representing + * The KateBufBlock class tqcontains an amount of data representing * a certain number of lines. * * @author Waldo Bastian @@ -116,7 +116,7 @@ class KateBufBlock void removeLine(uint i); /** - * mark this block as dirty, will invalidate the swap data + * mark this block as dirty, will tqinvalidate the swap data * insert/removeLine will mark the block dirty itself */ void markDirty (); @@ -338,7 +338,7 @@ class KateBufBlockList * @author Waldo Bastian * @author Christoph Cullmann */ -class KateBuffer : public QObject +class KateBuffer : public TQObject { Q_OBJECT @@ -487,7 +487,7 @@ class KateBuffer : public QObject */ inline KateTextLine::Ptr line(uint i) { - KateBufBlock *buf = findBlock(i); + KateBufBlock *buf = tqfindBlock(i); if (!buf) return 0; @@ -511,7 +511,7 @@ class KateBuffer : public QObject */ inline KateTextLine::Ptr plainLine(uint i) { - KateBufBlock *buf = findBlock(i); + KateBufBlock *buf = tqfindBlock(i); if (!buf) return 0; @@ -529,7 +529,7 @@ class KateBuffer : public QObject * index pointer gets filled with index of block in m_blocks * index only valid if returned block != 0 ! */ - KateBufBlock *findBlock (uint i, uint *index = 0) + KateBufBlock *tqfindBlock (uint i, uint *index = 0) { // out of range ! if (i >= m_lines) @@ -543,10 +543,10 @@ class KateBuffer : public QObject return m_blocks[m_lastFoundBlock]; } - return findBlock_internal (i, index); + return tqfindBlock_internal (i, index); } - KateBufBlock *findBlock_internal (uint i, uint *index = 0); + KateBufBlock *tqfindBlock_internal (uint i, uint *index = 0); public: /** @@ -591,7 +591,7 @@ class KateBuffer : public QObject /** * Invalidate highlighting of whole buffer. */ - void invalidateHighlighting(); + void tqinvalidateHighlighting(); KateCodeFoldingTree *foldingTree () { return &m_regionTree; }; @@ -611,7 +611,7 @@ class KateBuffer : public QObject * @returns true when the highlighting in the next block needs to be updated, * false otherwise. */ - bool doHighlight (KateBufBlock *buf, uint from, uint to, bool invalidate); + bool doHighlight (KateBufBlock *buf, uint from, uint to, bool tqinvalidate); signals: /** @@ -648,7 +648,7 @@ class KateBuffer : public QObject uint m_lastInSyncBlock; /** - * last block found by findBlock, there to make searching faster + * last block found by tqfindBlock, there to make searching faster */ uint m_lastFoundBlock; @@ -706,4 +706,4 @@ class KateBuffer : public QObject #endif -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katecmds.cpp b/kate/part/katecmds.cpp index b64b5414e..060a8c63c 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-replace-tabs" << "set-show-tabs" + << "set-tab-width" << "set-tqreplace-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-replace-tabs-save" << "set-remove-trailing-space-save" + << "set-tqreplace-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" ) { - // find a integer value > 0 + // tqfind a integer value > 0 if ( ! args.count() ) KCC_ERR( i18n("Missing argument. Usage: %1 ").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-replace-tabs" || + cmd == "set-tqreplace-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-replace-tabs-save" || + cmd == "set-tqreplace-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-replace-tabs" ) + else if ( cmd == "set-tqreplace-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 replace(TQString &s, const TQString &needle, const TQString &with) +static void tqreplace(TQString &s, const TQString &needle, const TQString &with) { int pos=0; while (1) { - pos=s.find(needle, pos); + pos=s.tqfind(needle, pos); if (pos==-1) break; - s.replace(pos, needle.length(), with); + s.tqreplace(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 (findreplace)*[nullzero] + // the format is (tqfindtqreplace)*[nullzero] const char *magic="a\x07t\tn\n"; while (*magic) { int index=0; - char replace=magic[1]; + char tqreplace=magic[1]; while ((index=backslashString(str, TQChar(*magic), index))!=-1) { - str.replace(index, 2, TQChar(replace)); + str.tqreplace(index, 2, TQChar(tqreplace)); index++; } magic++; @@ -359,7 +359,7 @@ static void exchangeAbbrevs(TQString &str) } int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, - const TQString &find, const TQString &repOld, const TQString &delim, + const TQString &tqfind, 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, replace \N with the captured + // * When matching patterhs after the first one, tqreplace \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)"), find, true ); + TQStringList patterns = TQStringList::split( TQRegExp("(^\\\\n|(?![^\\\\])\\\\n)"), tqfind, 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 replacement + // now set the backreferences in the tqreplacement 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.replace(index, 2, *i); + rep.tqreplace(index, 2, *i); index+=(*i).length(); } } @@ -433,16 +433,16 @@ int KateCommands::SedReplace::sedMagic( KateDocument *doc, int &line, refnum++; } - replace(rep, "\\\\", "\\"); - replace(rep, "\\" + delim, delim); + tqreplace(rep, "\\\\", "\\"); + tqreplace(rep, "\\" + delim, delim); doc->removeText( line, startcol, line, startcol + len ); doc->insertText( line, startcol, rep ); - // TODO if replace contains \n, + // TODO if tqreplace tqcontains \n, // change the line number and // check for text that needs be searched behind the last inserted newline. - int lns = rep.contains('\n'); + int lns = rep.tqcontains('\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.findRev('\n') - 1; - matches += sedMagic( doc, line, find, repOld, delim, noCase, repeat, sc, endcol ); + uint sc = rep.length() - rep.tqfindRev('\n') - 1; + matches += sedMagic( doc, line, tqfind, 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 find=splitter.cap(1); - kdDebug(13025)<< "SedReplace: find=" << find.latin1() <numLines(); for (int line=0; (uint)line < numLines; line++) { - res += sedMagic( doc, line, find, replace, d, !noCase, repeat ); + res += sedMagic( doc, line, tqfind, tqreplace, 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, find, replace, d, !noCase, repeat, startcol, endcol ); + res += sedMagic( doc, startline, tqfind, tqreplace, 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, find, replace, d, !noCase, repeat); + res += sedMagic(doc, line, tqfind, tqreplace, d, !noCase, repeat); } - msg = i18n("1 replacement done", "%n replacements done",res ); + msg = i18n("1 tqreplacement done", "%n tqreplacements 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.replace(TQRegExp("^0?x"), ""); + cmd.tqreplace(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 unicode thing + { // do the tqunicode 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::currentDateTime().toString(cmd.mid(5, cmd.length()-5)).length() > 0) - view->insertText(TQDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5))); + if (TQDateTime::tqcurrentDateTime().toString(cmd.mid(5, cmd.length()-5)).length() > 0) + view->insertText(TQDateTime::tqcurrentDateTime().toString(cmd.mid(5, cmd.length()-5))); else - view->insertText(TQDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")); + view->insertText(TQDateTime::tqcurrentDateTime().toString("yyyy-MM-dd hh:mm:ss")); return true; } //END Date -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katecmds.h b/kate/part/katecmds.h index 55c8d807b..fad54e85a 100644 --- a/kate/part/katecmds.h +++ b/kate/part/katecmds.h @@ -64,11 +64,11 @@ class CoreCommands : public Kate::Command, public Kate::CommandExtension /** * -- Charles Samuels - * Support vim/sed find and replace - * s/search/replace/ find search, replace with replace on this line - * %s/search/replace/ do the same to the whole file - * s/search/replace/i do the S. and R., but case insensitively - * $s/search/replace/ do the search are replacement to the selection only + * Support vim/sed tqfind and tqreplace + * s/search/tqreplace/ tqfind search, tqreplace with tqreplace on this line + * %s/search/tqreplace/ do the same to the whole file + * s/search/tqreplace/i do the S. and R., but case insensitively + * $s/search/tqreplace/ do the search are tqreplacement to the selection only * * $s/// is currently unsupported **/ @@ -94,17 +94,17 @@ class SedReplace : public Kate::Command private: /** - * Searches one line and does the replacement in the document. - * If @p replace contains any newline characters, the reamaining part of the + * Searches one line and does the tqreplacement in the document. + * If @p tqreplace tqcontains any newline characters, the reamaining part of the * line is searched, and the @p line set to the last line number searched. - * @return the number of replacements performed. + * @return the number of tqreplacements performed. * @param doc a pointer to the document to work on * @param line the number of the line to search. This may be changed by the * function, if newlines are inserted. - * @param find A regular expression pattern to use for searching - * @param replace a template for replacement. Backspaced integers are - * replaced with captured texts from the regular expression. - * @param delim the delimiter character from the command. In the replacement + * @param tqfind A regular expression pattern to use for searching + * @param tqreplace a template for tqreplacement. Backspaced integers are + * tqreplaced with captured texts from the regular expression. + * @param delim the delimiter character from the command. In the tqreplacement * text backsplashes preceeding this character are removed. * @param nocase parameter for matching the reqular expression. * @param repeat If false, the search is stopped after the first match. @@ -113,13 +113,13 @@ class SedReplace : public Kate::Command * If it is -1, the whole line is used. */ static int sedMagic(KateDocument *doc, int &line, - const TQString &find, const TQString &replace, const TQString &delim, + const TQString &tqfind, const TQString &tqreplace, const TQString &delim, bool noCase, bool repeat, uint startcol=0, int endcol=-1); }; /** - * insert a unicode or ascii character + * insert a tqunicode or ascii character * base 9+1: 1234 * hex: 0x1234 or x1234 * octal: 01231 @@ -175,4 +175,4 @@ class Date : public Kate::Command } // namespace KateCommands #endif -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katecodecompletion.cpp b/kate/part/katecodecompletion.cpp index cee99f9d4..6fecd4c9e 100644 --- a/kate/part/katecodecompletion.cpp +++ b/kate/part/katecodecompletion.cpp @@ -47,7 +47,7 @@ /** * This class is used as the codecompletion listbox. It can be resized according to its contents, - * therfor the needed size is provided by sizeHint(); + * therfor the needed size is provided by tqsizeHint(); *@short Listbox showing codecompletion *@author Jonas B. Jacobi */ @@ -61,7 +61,7 @@ class KateCCListBox : public QListBox { } - TQSize sizeHint() const + TQSize tqsizeHint() const { int count = this->count(); int height = 20; @@ -124,7 +124,7 @@ KateCodeCompletion::KateCodeCompletion( KateView* view ) m_completionListBox->installEventFilter( this ); - m_completionPopup->resize(m_completionListBox->sizeHint() + TQSize(2,2)); + m_completionPopup->resize(m_completionListBox->tqsizeHint() + TQSize(2,2)); m_completionPopup->installEventFilter( this ); m_completionPopup->setFocusProxy( m_view->m_viewInternal ); @@ -305,7 +305,7 @@ void KateCodeCompletion::updateBox( bool ) } kdDebug(13035)<<"KateCodeCompletion::updateBox: Resizing widget"<resize(m_completionListBox->sizeHint() + TQSize(2,2)); + m_completionPopup->resize(m_completionListBox->tqsizeHint() + TQSize(2,2)); TQPoint p = m_view->mapToGlobal( m_view->cursorCoordinates() ); int x = p.x(); int y = p.y() ; @@ -384,7 +384,7 @@ void KateCodeCompletion::showComment() m_completionListBox->ensureCurrentVisible(); finalPoint.setY( - m_completionListBox->viewport()->mapToGlobal(m_completionListBox->itemRect( + m_completionListBox->viewport()->mapToGlobal(m_completionListBox->tqitemRect( m_completionListBox->item(m_completionListBox->currentItem())).topLeft()).y()); m_commentLabel->move(finalPoint); @@ -398,8 +398,8 @@ KateArgHint::KateArgHint( KateView* parent, const char* name ) setPaletteForegroundColor( Qt::black ); labelDict.setAutoDelete( true ); - layout = new TQVBoxLayout( this, 1, 2 ); - layout->setAutoAdd( true ); + tqlayout = new TQVBoxLayout( this, 1, 2 ); + tqlayout->setAutoAdd( true ); editorView = parent; m_markCurrentFunction = true; @@ -460,8 +460,8 @@ void KateArgHint::cursorPositionChanged( KateView* view, int line, int col ) TQRegExp chrconst_rx( "'[^']*'" ); text = text - .replace( strconst_rx, "\"\"" ) - .replace( chrconst_rx, "''" ); + .tqreplace( strconst_rx, "\"\"" ) + .tqreplace( chrconst_rx, "''" ); int index = 0; while( index < (int)text.length() ){ @@ -563,4 +563,4 @@ void KateArgHint::adjustSize( ) move( screen.x() + screen.width() - width(), y() ); } -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katecodecompletion.h b/kate/part/katecodecompletion.h index 34d620599..52fd6c70f 100644 --- a/kate/part/katecodecompletion.h +++ b/kate/part/katecodecompletion.h @@ -57,14 +57,14 @@ class KateCodeCompletionCommentLabel : public QLabel setAutoMask( false ); setFrameStyle( TQFrame::Plain | TQFrame::Box ); setLineWidth( 1 ); - setAlignment( AlignAuto | AlignTop ); + tqsetAlignment( AlignAuto | AlignTop ); polish(); setText(text); adjustSize(); } }; -class KateCodeCompletion : public QObject +class KateCodeCompletion : public TQObject { Q_OBJECT @@ -156,9 +156,9 @@ class KateArgHint: public QFrame int m_currentCol; KateView* editorView; TQIntDict labelDict; - TQLayout* layout; + TQLayout* tqlayout; }; #endif -// kate: space-indent on; indent-width 2; replace-tabs on; +// kate: space-indent on; indent-width 2; tqreplace-tabs on; diff --git a/kate/part/katecodefoldinghelpers.cpp b/kate/part/katecodefoldinghelpers.cpp index 91b4da88a..78db2ad15 100644 --- a/kate/part/katecodefoldinghelpers.cpp +++ b/kate/part/katecodefoldinghelpers.cpp @@ -217,10 +217,10 @@ void KateCodeFoldingTree::getLineInfo(KateLineInfo *info, unsigned int line) { KateCodeFoldingNode *node = m_root.child(i); - if ((node->startLineRel<=line) && (line<=node->startLineRel+node->endLineRel)) // we found a node, which contains the given line -> do a complete lookup + if ((node->startLineRel<=line) && (line<=node->startLineRel+node->endLineRel)) // we found a node, which tqcontains the given line -> do a complete lookup { info->topLevel = false; //we are definitly not toplevel - findAllNodesOpenedOrClosedAt(line); //lookup all nodes, which start or and at the given line + tqfindAllNodesOpenedOrClosedAt(line); //lookup all nodes, which start or and at the given line for ( KateCodeFoldingNode *node = nodesForLine.first(); node; node = nodesForLine.next() ) { @@ -253,7 +253,7 @@ void KateCodeFoldingTree::getLineInfo(KateLineInfo *info, unsigned int line) } -KateCodeFoldingNode *KateCodeFoldingTree::findNodeForLine(unsigned int line) +KateCodeFoldingNode *KateCodeFoldingTree::tqfindNodeForLine(unsigned int line) { if (m_root.noChildren()) // does we have child list + nodes ? return &m_root; @@ -266,7 +266,7 @@ KateCodeFoldingNode *KateCodeFoldingTree::findNodeForLine(unsigned int line) if ((node->startLineRel<=line) && (line<=node->startLineRel+node->endLineRel)) { // a region surounds the line, look in the next deeper hierarchy step - return findNodeForLineDescending(node,line,0); + return tqfindNodeForLineDescending(node,line,0); } } @@ -274,7 +274,7 @@ KateCodeFoldingNode *KateCodeFoldingTree::findNodeForLine(unsigned int line) } -KateCodeFoldingNode *KateCodeFoldingTree::findNodeForLineDescending ( KateCodeFoldingNode *node, +KateCodeFoldingNode *KateCodeFoldingTree::tqfindNodeForLineDescending ( KateCodeFoldingNode *node, unsigned int line, unsigned int offset, bool oneStepOnly ) { if (node->noChildren()) @@ -289,22 +289,22 @@ KateCodeFoldingNode *KateCodeFoldingTree::findNodeForLineDescending ( KateCodeFo if ((subNode->startLineRel+offset<=line) && (line<=subNode->endLineRel+subNode->startLineRel+offset)) //warning fix me for invalid ends { - // a subnode contains the line. + // a subnode tqcontains the line. // if oneStepOnly is true, we don't want to search for the deepest node, just return the found one if (oneStepOnly) return subNode; else - return findNodeForLineDescending (subNode,line,offset); // look into the next deeper hierarchy step + return tqfindNodeForLineDescending (subNode,line,offset); // look into the next deeper hierarchy step } } return node; // the current node has no sub nodes, or the line couldn'te be found within a subregion } -KateCodeFoldingNode *KateCodeFoldingTree::findNodeForPosition(unsigned int line, unsigned int column) +KateCodeFoldingNode *KateCodeFoldingTree::tqfindNodeForPosition(unsigned int line, unsigned int column) { - KateCodeFoldingNode *node=findNodeForLine(line); + KateCodeFoldingNode *node=tqfindNodeForLine(line); if (node==&m_root) return &m_root; @@ -395,11 +395,11 @@ void KateCodeFoldingTree::updateLine(unsigned int line, something_changed = false; - findAndMarkAllNodesforRemovalOpenedOrClosedAt(line); + tqfindAndMarkAllNodesforRemovalOpenedOrClosedAt(line); if (regionChanges->isEmpty()) { - // KateCodeFoldingNode *node=findNodeForLine(line); + // KateCodeFoldingNode *node=tqfindNodeForLine(line); // if (node->type!=0) // if (getStartLine(node)+node->endLineRel==line) removeEnding(node,line); } @@ -421,7 +421,7 @@ void KateCodeFoldingTree::updateLine(unsigned int line, regionChanges->resize (regionChanges->size()-2); int insertPos=-1; - KateCodeFoldingNode *node = findNodeForLine(line); + KateCodeFoldingNode *node = tqfindNodeForLine(line); if (data<0) { @@ -445,7 +445,7 @@ void KateCodeFoldingTree::updateLine(unsigned int line, if ((getStartLine(node)==line) && (node->type!=0)) { - insertPos=node->parentNode->findChild(node); + insertPos=node->parentNode->tqfindChild(node); node = node->parentNode; } else @@ -467,7 +467,7 @@ void KateCodeFoldingTree::updateLine(unsigned int line, { if (correctEndings(data,node,line,charPos,insertPos)) { - insertPos=node->parentNode->findChild(node)+1; + insertPos=node->parentNode->tqfindChild(node)+1; node=node->parentNode; } else @@ -484,7 +484,7 @@ void KateCodeFoldingTree::updateLine(unsigned int line, something_changed = true; node->appendChild(newNode); addOpening(newNode, data, regionChanges, line,charPos); - insertPos = node->findChild(newNode)+1; + insertPos = node->tqfindChild(newNode)+1; } else { @@ -538,7 +538,7 @@ bool KateCodeFoldingTree::removeOpening(KateCodeFoldingNode *node,unsigned int l } KateCodeFoldingNode *parent = node->parentNode; - int mypos = parent->findChild(node); + int mypos = parent->tqfindChild(node); if (mypos > -1) { @@ -553,7 +553,7 @@ bool KateCodeFoldingTree::removeOpening(KateCodeFoldingNode *node,unsigned int l } // remove the node - //mypos = parent->findChild(node); + //mypos = parent->tqfindChild(node); bool endLineValid = node->endLineValid; int endLineRel = node->endLineRel; uint endCol=node->endCol; @@ -583,7 +583,7 @@ bool KateCodeFoldingTree::removeEnding(KateCodeFoldingNode *node,unsigned int /* if (node->type < 0) { // removes + deletes - int i = parent->findChild (node); + int i = parent->tqfindChild (node); if (i >= 0) { KateCodeFoldingNode *child = parent->takeChild(i); @@ -594,7 +594,7 @@ bool KateCodeFoldingTree::removeEnding(KateCodeFoldingNode *node,unsigned int /* return true; } - int mypos = parent->findChild(node); + int mypos = parent->tqfindChild(node); int count = parent->childCount(); for (int i=mypos+1; iinsertChild(insertPos,newNode); - // find correct position + // tqfind correct position return false; } else @@ -728,7 +728,7 @@ bool KateCodeFoldingTree::correctEndings(signed char data, KateCodeFoldingNode * if (node->parentNode) { - correctEndings(data,node->parentNode,bakEndLine, bakEndCol,node->parentNode->findChild(node)+1); // ???? + correctEndings(data,node->parentNode,bakEndLine, bakEndCol,node->parentNode->tqfindChild(node)+1); // ???? } else { @@ -742,7 +742,7 @@ bool KateCodeFoldingTree::correctEndings(signed char data, KateCodeFoldingNode * void KateCodeFoldingTree::moveSubNodesUp(KateCodeFoldingNode *node) { - int mypos = node->parentNode->findChild(node); + int mypos = node->parentNode->tqfindChild(node); int removepos=-1; int count = node->childCount(); for (int i=0; iendLineValid) { - int current = parent->findChild(node); + int current = parent->tqfindChild(node); int count = parent->childCount()-(current+1); node->endLineRel = parent->endLineRel - node->startLineRel; @@ -1007,7 +1007,7 @@ void KateCodeFoldingTree::addOpening_further_iterations(KateCodeFoldingNode *nod { something_changed = true; KateCodeFoldingNode *newNode = new KateCodeFoldingNode(node, data, line-startLine); - node->insertChild(current, newNode); //find the correct position later + node->insertChild(current, newNode); //tqfind the correct position later } addOpening(node->child(current), data, list, line,charPos); @@ -1040,10 +1040,10 @@ void KateCodeFoldingTree::lineHasBeenRemoved(unsigned int line) #endif //line ++; - findAndMarkAllNodesforRemovalOpenedOrClosedAt(line); //It's an ugly solution + tqfindAndMarkAllNodesforRemovalOpenedOrClosedAt(line); //It's an ugly solution cleanupUnneededNodes(line); //It's an ugly solution - KateCodeFoldingNode *node = findNodeForLine(line); + KateCodeFoldingNode *node = tqfindNodeForLine(line); //????? if (node->endLineValid) { int startLine = getStartLine(node); @@ -1083,7 +1083,7 @@ void KateCodeFoldingTree::decrementBy1(KateCodeFoldingNode *node, KateCodeFoldin node->endLineValid = false; node->endLineRel--; - for (uint i=node->findChild(after)+1; i < node->childCount(); ++i) + for (uint i=node->tqfindChild(after)+1; i < node->childCount(); ++i) node->child(i)->startLineRel--; if (node->parentNode) @@ -1103,10 +1103,10 @@ void KateCodeFoldingTree::lineHasBeenInserted(unsigned int line) kdDebug(13000)<endLineValid) { int startLine=getStartLine(node); @@ -1140,7 +1140,7 @@ void KateCodeFoldingTree::incrementBy1(KateCodeFoldingNode *node, KateCodeFoldin { node->endLineRel++; - for (uint i=node->findChild(after)+1; i < node->childCount(); ++i) + for (uint i=node->tqfindChild(after)+1; i < node->childCount(); ++i) node->child(i)->startLineRel++; if (node->parentNode) @@ -1148,14 +1148,14 @@ void KateCodeFoldingTree::incrementBy1(KateCodeFoldingNode *node, KateCodeFoldin } -void KateCodeFoldingTree::findAndMarkAllNodesforRemovalOpenedOrClosedAt(unsigned int line) +void KateCodeFoldingTree::tqfindAndMarkAllNodesforRemovalOpenedOrClosedAt(unsigned int line) { #ifdef __GNUC__ #warning "FIXME: make this multiple region changes per line save"; #endif // return; markedForDeleting.clear(); - KateCodeFoldingNode *node = findNodeForLine(line); + KateCodeFoldingNode *node = tqfindNodeForLine(line); if (node->type == 0) return; @@ -1186,7 +1186,7 @@ void KateCodeFoldingTree::addNodeToRemoveList(KateCodeFoldingNode *node,unsigned } if ((startLine+node->endLineRel==line) || ((node->endLineValid==false) && (node->deleteOpening))) { - int myPos=node->parentNode->findChild(node); // this has to be implemented nicely + int myPos=node->parentNode->tqfindChild(node); // this has to be implemented nicely if ((int)node->parentNode->childCount()>myPos+1) addNodeToRemoveList(node->parentNode->child(myPos+1),line); add=true; @@ -1199,10 +1199,10 @@ void KateCodeFoldingTree::addNodeToRemoveList(KateCodeFoldingNode *node,unsigned } -void KateCodeFoldingTree::findAllNodesOpenedOrClosedAt(unsigned int line) +void KateCodeFoldingTree::tqfindAllNodesOpenedOrClosedAt(unsigned int line) { nodesForLine.clear(); - KateCodeFoldingNode *node = findNodeForLine(line); + KateCodeFoldingNode *node = tqfindNodeForLine(line); if (node->type == 0) return; @@ -1214,7 +1214,7 @@ void KateCodeFoldingTree::findAllNodesOpenedOrClosedAt(unsigned int line) while (node->parentNode) { - addNodeToFoundList(node->parentNode, line, node->parentNode->findChild(node)); + addNodeToFoundList(node->parentNode, line, node->parentNode->tqfindChild(node)); node = node->parentNode; } #if JW_DEBUG @@ -1272,7 +1272,7 @@ void KateCodeFoldingTree::cleanupUnneededNodes(unsigned int line) #endif if (node->endLineValid) // just delete it, it has been opened and closed on this line { - int f = node->parentNode->findChild (node); + int f = node->parentNode->tqfindChild (node); if (f >= 0) delete node->parentNode->takeChild(f); @@ -1332,7 +1332,7 @@ void KateCodeFoldingTree::toggleRegionVisibility(unsigned int line) hiddenLinesCountCacheValid = false; kdDebug(13000)<child(tmp->findChild(node) + 1)) + if ((tmp2 = tmp->child(tmp->tqfindChild(node) + 1)) && ((tmp2->startLineRel + startLine) == line)) return true; @@ -1650,7 +1650,7 @@ void KateCodeFoldingTree::ensureVisible( uint line ) kdDebug(13000)<<"line "<