summaryrefslogtreecommitdiffstats
path: root/languages/php/phpcodecompletion.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /languages/php/phpcodecompletion.cpp
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/php/phpcodecompletion.cpp')
-rw-r--r--languages/php/phpcodecompletion.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/languages/php/phpcodecompletion.cpp b/languages/php/phpcodecompletion.cpp
index b2b1eb33..8f0a9298 100644
--- a/languages/php/phpcodecompletion.cpp
+++ b/languages/php/phpcodecompletion.cpp
@@ -146,9 +146,9 @@ void PHPCodeCompletion::cursorPositionChanged(){
}
if (m_config->getCodeHinting()) {
- int pos1 = lineStr.findRev("(", col - 1);
- int pos2 = lineStr.findRev(TQRegExp("[ \\t=;\\$\\.\\(\\)]"), pos1 - 1);
- int pos3 = lineStr.findRev(")", col);
+ int pos1 = lineStr.tqfindRev("(", col - 1);
+ int pos2 = lineStr.tqfindRev(TQRegExp("[ \\t=;\\$\\.\\(\\)]"), pos1 - 1);
+ int pos3 = lineStr.tqfindRev(")", col);
if (pos1 > pos2 && pos1 != -1 && pos3 < pos1) {
TQString line = lineStr.mid(pos2 + 1, pos1 - pos2 - 1).stripWhiteSpace();
@@ -163,7 +163,7 @@ void PHPCodeCompletion::cursorPositionChanged(){
return;
}
- int pos = lineStr.findRev(TQRegExp("[ \\t=;\\$\\.\\(\\)]"), col - 1);
+ int pos = lineStr.tqfindRev(TQRegExp("[ \\t=;\\$\\.\\(\\)]"), col - 1);
TQString line = lineStr.mid(pos + 1, col - pos).stripWhiteSpace();
if (checkForVariable(line, col)) {
@@ -180,7 +180,7 @@ kdDebug(9018) << "end checkForGlobalFunction" << endl;
return;
}
- pos = lineStr.stripWhiteSpace().findRev(TQRegExp("[ \\t=;\\$\\.\\(\\)]"), col - 1);
+ pos = lineStr.stripWhiteSpace().tqfindRev(TQRegExp("[ \\t=;\\$\\.\\(\\)]"), col - 1);
line = lineStr.mid(pos + 1, col - pos);
if (checkForNew(line, col)) {
@@ -214,7 +214,7 @@ bool PHPCodeCompletion::checkForStaticFunction(TQString line, int col) {
kdDebug(9018) << "checkForStaticFunction" << endl;
TQValueList<KTextEditor::CompletionEntry> list;
- if (line.find("::") == -1)
+ if (line.tqfind("::") == -1)
return false;
TQRegExp Class("([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)::([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)");
@@ -234,7 +234,7 @@ bool PHPCodeCompletion::checkForStaticFunction(TQString line, int col) {
for (funcIt = funcList.begin(); funcIt != funcList.end(); ++funcIt) {
FunctionDom nFunc = *funcIt;
- if ((function.isEmpty() || nFunc->name().startsWith(function, FALSE)) && nFunc->isStatic()) {
+ if ((function.isEmpty() || nFunc->name().tqstartsWith(function, FALSE)) && nFunc->isStatic()) {
KTextEditor::CompletionEntry e;
e.prefix = nClass->name() + " ::";
e.text = nFunc->name();
@@ -267,7 +267,7 @@ bool PHPCodeCompletion::checkForNew(TQString line, int col){
kdDebug(9018) << "checkForNew" << endl;
TQValueList<KTextEditor::CompletionEntry> list;
- if (line.find("new ", 0, FALSE) == -1)
+ if (line.tqfind("new ", 0, FALSE) == -1)
return false;
TQRegExp New("[& \t]*new[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)");
@@ -297,7 +297,7 @@ bool PHPCodeCompletion::checkForExtends(TQString line, int col){
kdDebug(9018) << "checkForExtends" << endl;
TQValueList<KTextEditor::CompletionEntry> list;
- if (line.find("extends", 0, FALSE) == -1)
+ if (line.tqfind("extends", 0, FALSE) == -1)
return false;
TQRegExp extends("[ \t]*extends[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)");
@@ -316,12 +316,12 @@ bool PHPCodeCompletion::checkForVariable(TQString line, int col){
TQValueList<KTextEditor::CompletionEntry> list;
TQString args;
- if (line.find("->") == -1) {
+ if (line.tqfind("->") == -1) {
return false;
}
if (line.left(2) != "->") {
- int pos = line.findRev("->");
+ int pos = line.tqfindRev("->");
args = line.mid(pos + 2, line.length() - pos);
line = line.mid(0, pos);
}
@@ -362,10 +362,10 @@ TQValueList<KTextEditor::CompletionEntry> PHPCodeCompletion::getClasses(TQString
ClassList::Iterator classIt;
for (classIt = classList.begin(); classIt != classList.end(); ++classIt) {
ClassDom nClass = *classIt;
- if (name == NULL || name.isEmpty() || nClass->name().startsWith(name, FALSE)) {
+ if (name == NULL || name.isEmpty() || nClass->name().tqstartsWith(name, FALSE)) {
KTextEditor::CompletionEntry e;
- TQStringList::Iterator it = added.find(nClass->name());
+ TQStringList::Iterator it = added.tqfind(nClass->name());
if (it == added.end()) {
e.text = nClass->name();
list.append(e);
@@ -383,7 +383,7 @@ TQValueList<KTextEditor::CompletionEntry> PHPCodeCompletion::getFunctionsAndVars
if (classname.isEmpty()) {
TQValueList<FunctionCompletionEntry>::Iterator it;
for( it = m_globalFunctions.begin(); it != m_globalFunctions.end(); ++it ) {
- if((*it).text.startsWith(function, FALSE)){
+ if((*it).text.tqstartsWith(function, FALSE)){
KTextEditor::CompletionEntry e;
e = (*it);
list.append(e);
@@ -393,7 +393,7 @@ TQValueList<KTextEditor::CompletionEntry> PHPCodeCompletion::getFunctionsAndVars
FunctionList methodList = m_model->globalNamespace()->functionList();
FunctionList::Iterator methodIt;
for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) {
- if ((*methodIt)->name().startsWith(function, FALSE)){
+ if ((*methodIt)->name().tqstartsWith(function, FALSE)){
KTextEditor::CompletionEntry e;
e.text = (*methodIt)->name();
ArgumentDom pArg = (*methodIt)->argumentList().first();
@@ -416,7 +416,7 @@ TQValueList<KTextEditor::CompletionEntry> PHPCodeCompletion::getFunctionsAndVars
FunctionList::Iterator methodIt;
for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) {
FunctionDom pMethod = *methodIt;
- if (function.isEmpty() || pMethod->name().startsWith(function, FALSE)) {
+ if (function.isEmpty() || pMethod->name().tqstartsWith(function, FALSE)) {
KTextEditor::CompletionEntry e;
ArgumentDom arg = pMethod->argumentList().first();
@@ -430,7 +430,7 @@ TQValueList<KTextEditor::CompletionEntry> PHPCodeCompletion::getFunctionsAndVars
VariableList::Iterator attrIt;
for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) {
VariableDom pVar = *attrIt;
- if (function.isEmpty() || pVar->name().startsWith(function, FALSE)) {
+ if (function.isEmpty() || pVar->name().tqstartsWith(function, FALSE)) {
KTextEditor::CompletionEntry e;
e.prefix = nClass->name() + " ::";
e.text = pVar->name();
@@ -526,13 +526,13 @@ TQString PHPCodeCompletion::getCurrentClassName() {
return Class.cap(2);
}
}
- return TQString::null;
+ return TQString();
}
TQString PHPCodeCompletion::getClassName(TQString varName, TQString classname) {
kdDebug(9018) << "getClassName " << varName << "::" << classname << endl;
- if (varName.find("$") == 0)
+ if (varName.tqfind("$") == 0)
varName = varName.mid(1);
if (varName.lower() == "this")
@@ -577,7 +577,7 @@ TQString PHPCodeCompletion::getClassName(TQString varName, TQString classname) {
for(int i = m_currentLine; i >= 0; i--){
TQString line = m_editInterface->textLine(i);
- if (!line.isNull() && line.find(varName,0 , FALSE) != -1) {
+ if (!line.isNull() && line.tqfind(varName,0 , FALSE) != -1) {
if (createmember.search(line) != -1) {
TQString right = createmember.cap(1).stripWhiteSpace();
@@ -640,7 +640,7 @@ bool PHPCodeCompletion::checkForArgHint(TQString line, int col) {
if (m_argWidgetShow == true)
return false;
- if (line.find("::") != -1) {
+ if (line.tqfind("::") != -1) {
TQRegExp Static("([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)::([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)");
Static.setCaseSensitive(FALSE);
@@ -658,8 +658,8 @@ bool PHPCodeCompletion::checkForArgHint(TQString line, int col) {
}
}
- if (line.findRev("->") != -1) {
- int pos1 = line.findRev("->");
+ if (line.tqfindRev("->") != -1) {
+ int pos1 = line.tqfindRev("->");
TQString classname;
TQString function = line.mid(pos1 + 2);
@@ -706,7 +706,7 @@ kdDebug(9018) << "checkForArgHint 0 " << line << endl;
}
void PHPCodeCompletion::setStatusBar(TQString expr, TQString type) {
- m_phpSupport->mainWindow()->statusBar()->message( i18n("Type of %1 is %2").arg(expr).arg(type), 1000 );
+ m_phpSupport->mainWindow()->statusBar()->message( i18n("Type of %1 is %2").tqarg(expr).tqarg(type), 1000 );
}
#include "phpcodecompletion.moc"