summaryrefslogtreecommitdiffstats
path: root/kate/part/kateautoindent.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
commitf7e71d47719ab6094cf4a9fafffa5ea351973522 (patch)
tree30834aa632d442019e14f88685001d94657d060b /kate/part/kateautoindent.cpp
parentb31cfd9a1ee986fe2ae9a693f3afd7f171dd897c (diff)
downloadtdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.tar.gz
tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.zip
Initial conversion for TQt for Qt4 3.4.0 TP2
This will also compile with TQt for Qt3, and should not cause any problems with dependent modules such as kdebase. If it does then it needs to be fixed! git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/part/kateautoindent.cpp')
-rw-r--r--kate/part/kateautoindent.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kate/part/kateautoindent.cpp b/kate/part/kateautoindent.cpp
index ed9a6169b..aed42bbab 100644
--- a/kate/part/kateautoindent.cpp
+++ b/kate/part/kateautoindent.cpp
@@ -224,55 +224,55 @@ void KateNormalIndent::updateConfig ()
for (uint i=0; i<items.count(); i++)
{
TQString name = items.at(i)->name;
- 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;
}
@@ -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, "//"))
@@ -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);
}
@@ -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);
@@ -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,
// <a>
// </a> <!-- indentation *already* decreased -->
// requires that we discount the </a> 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;
@@ -1445,10 +1445,10 @@ void KateXmlIndent::getLineInfo (uint line, uint &prevIndent, int &numTags,
for(uint backLine = line; backLine; ) {
// find 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;
}
@@ -1467,11 +1467,11 @@ void KateXmlIndent::getLineInfo (uint line, uint &prevIndent, int &numTags,
if(unclosedTag) {
// find 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;
@@ -1760,7 +1760,7 @@ int KateCSAndSIndent::lastNonCommentChar( const KateDocCursor &line )
// find a possible start-of-comment
int p = -2; // so the first find starts at position 0
- do p = str.find( "//", p + 2 );
+ 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