summaryrefslogtreecommitdiffstats
path: root/languages/cpp/cppcodecompletion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'languages/cpp/cppcodecompletion.cpp')
-rw-r--r--languages/cpp/cppcodecompletion.cpp340
1 files changed, 170 insertions, 170 deletions
diff --git a/languages/cpp/cppcodecompletion.cpp b/languages/cpp/cppcodecompletion.cpp
index 266c3878..08f6aa1e 100644
--- a/languages/cpp/cppcodecompletion.cpp
+++ b/languages/cpp/cppcodecompletion.cpp
@@ -134,7 +134,7 @@ CppCodeCompletion* cppCompletionInstance = 0;
//file global functions, must be before any "using namespace"
TQString cleanForMenu( TQString txt ) {
- return txt.replace( "&", "&&" ).replace( " ", " " );
+ return txt.tqreplace( "&", "&&" ).tqreplace( " ", " " );
}
TQString buildSignature( TypePointer currType ) {
@@ -254,7 +254,7 @@ static TQValueList<ItemType> unique( const TQValueList<ItemType>& entryList ) {
e.prefix + " " +
e.text + " " +
e.postfix + " " ).simplifyWhiteSpace().stripWhiteSpace();
- if ( map.find( key ) == map.end() ) {
+ if ( map.tqfind( key ) == map.end() ) {
map[ key ] = TRUE;
l << e;
}
@@ -269,7 +269,7 @@ static TQStringList unique( const TQStringList& entryList ) {
TQStringList::ConstIterator it = entryList.begin();
while ( it != entryList.end() ) {
TQString e = *it++;
- if ( map.find( e ) == map.end() ) {
+ if ( map.tqfind( e ) == map.end() ) {
map[ e ] = TRUE;
l << e;
}
@@ -285,7 +285,7 @@ static TQStringList unique( const TQValueList<TQStringList>& entryList ) {
while ( it != entryList.end() ) {
TQStringList li = ( *it++ );
TQString e = li.join( "\n" );
- if ( map.find( e ) == map.end() ) {
+ if ( map.tqfind( e ) == map.end() ) {
map[ e ] = TRUE;
l += li;
}
@@ -348,7 +348,7 @@ struct PopupFillerHelpStruct {
TQMap<TQString, TQPopupMenu*> m_namespacePopupCache;
- void insertItem( TQPopupMenu* parent, SimpleTypeImpl::MemberInfo d , TQString prefix ) {
+ void insertItem( TQPopupMenu* tqparent, SimpleTypeImpl::MemberInfo d , TQString prefix ) {
Q_UNUSED(prefix);
TQString memType = d.memberTypeToString();
@@ -356,13 +356,13 @@ struct PopupFillerHelpStruct {
if ( d.memberType == SimpleTypeImpl::MemberInfo::Typedef && d.type->fullName() == "const int" )
memType = "enum";
- TQString txt = i18n( "Jump to %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) );
- int id = parent->insertItem( txt, receiver, TQT_SLOT( popupAction( int ) ) );
+ TQString txt = i18n( "Jump to %1 %2" ).tqarg( memType ).tqarg( cleanForMenu( d.name ) );
+ int id = tqparent->insertItem( txt, receiver, TQT_SLOT( popupAction( int ) ) );
receiver->m_popupActions.insert( id, d.decl );
}
- void insertItem ( TQPopupMenu* parent, TypeDesc d , TQString prefix ) {
+ void insertItem ( TQPopupMenu* tqparent, TypeDesc d , TQString prefix ) {
Debug dbg( "#insert# ", 10 );
TQString txt1, txt2;
@@ -374,14 +374,14 @@ struct PopupFillerHelpStruct {
for ( SimpleTypeNamespace::SlaveList::iterator it = slaves.begin(); it != slaves.end(); ++it ) {
SimpleTypeCodeModel* cm = dynamic_cast<SimpleTypeCodeModel*>( ( *it ).first.first.resolved().data() );
if ( cm && cm->item() ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
TQString scope = cm->scope().join("::");
- TQMap< TQString, TQPopupMenu* >::iterator it = m_namespacePopupCache.find( scope );
+ TQMap< TQString, TQPopupMenu* >::iterator it = m_namespacePopupCache.tqfind( scope );
if( it != m_namespacePopupCache.end() ) {
- parent->insertItem( "Imported Namespace " + scope, *it );
+ tqparent->insertItem( "Imported Namespace " + scope, *it );
delete m;
} else {
- parent->insertItem( "Imported Namespace " + scope, m );
+ tqparent->insertItem( "Imported Namespace " + scope, m );
insertItem( m, ( new SimpleTypeCachedCodeModel( cm->item() ) ) ->desc(), prefix );
m_namespacePopupCache.insert( scope, m );
@@ -390,7 +390,7 @@ struct PopupFillerHelpStruct {
SimpleTypeNamespace* cn = dynamic_cast<SimpleTypeNamespace*>( ( *it ).first.first.resolved().data() );
if( cn ) {
TypePointer t = new SimpleTypeNamespace( cn ); //To avoid endless recursion, this needs to be done(the dynamic-cast above fails)
- insertItem( parent, t->desc(), prefix );
+ insertItem( tqparent, t->desc(), prefix );
}
}
}
@@ -423,7 +423,7 @@ struct PopupFillerHelpStruct {
int sLine, sCol, eLine, eCol;
i->getStartPosition( &sLine, &sCol );
i->getEndPosition( &eLine, &eCol );
- insertItem( parent, (new SimpleTypeCodeModel( i ))->desc(), prefix + " " + (*it)->name() + TQString(" (%1 Lines): ").arg( eLine - sLine ) ); ///SimpleTypeCodeModel is used instead of SimpleTypeCachedNodeModel, so the detection at (1) does not trigger, this avoids endless recursion.
+ insertItem( tqparent, (new SimpleTypeCodeModel( i ))->desc(), prefix + " " + (*it)->name() + TQString(" (%1 Lines): ").tqarg( eLine - sLine ) ); ///SimpleTypeCodeModel is used instead of SimpleTypeCachedNodeModel, so the detection at (1) does not trigger, this avoids endless recursion.
}
}
@@ -434,10 +434,10 @@ struct PopupFillerHelpStruct {
if ( d.resolved() ) {
if ( d.resolved() ->asFunction() ) {
- txt1 = prefix + i18n( "Jump to declaration of %1(...)" ).arg( d.resolved() ->scope().join( "::" ) );
- txt2 = prefix + i18n( "Jump to definition of %1(...)" ).arg( d.resolved() ->scope().join( "::" ) );
+ txt1 = prefix + i18n( "Jump to declaration of %1(...)" ).tqarg( d.resolved() ->scope().join( "::" ) );
+ txt2 = prefix + i18n( "Jump to definition of %1(...)" ).tqarg( d.resolved() ->scope().join( "::" ) );
} else {
- txt1 = prefix + i18n( "Jump to %1" ).arg( cleanForMenu( d.resolved() ->scope().join( "::" ) ) );
+ txt1 = prefix + i18n( "Jump to %1" ).tqarg( cleanForMenu( d.resolved() ->scope().join( "::" ) ) );
}
} else {
if( !BuiltinTypes::isBuiltin( d ) ) {
@@ -447,12 +447,12 @@ struct PopupFillerHelpStruct {
}
}
- int id = parent->insertItem( txt1, receiver, TQT_SLOT( popupAction( int ) ) );
+ int id = tqparent->insertItem( txt1, receiver, TQT_SLOT( popupAction( int ) ) );
if ( d.resolved() )
receiver->m_popupActions.insert( id, d.resolved() ->getDeclarationInfo() );
if ( !txt2.isEmpty() ) {
- int id2 = parent->insertItem( txt2, receiver, TQT_SLOT( popupDefinitionAction( int ) ) );
+ int id2 = tqparent->insertItem( txt2, receiver, TQT_SLOT( popupDefinitionAction( int ) ) );
if ( d.resolved() )
receiver->m_popupDefinitionActions.insert( id2, d.resolved() ->getDeclarationInfo() );
}
@@ -523,7 +523,7 @@ struct PopupClassViewFillerHelpStruct {
return false;
}
- void insertItem( TQPopupMenu* parent, SimpleTypeImpl::MemberInfo d , TQString prefix ) {
+ void insertItem( TQPopupMenu* tqparent, SimpleTypeImpl::MemberInfo d , TQString prefix ) {
Q_UNUSED(prefix);
FileDom f = receiver->m_pSupport->codeModel() ->fileByName( d.decl.file );
if ( !f )
@@ -536,13 +536,13 @@ struct PopupClassViewFillerHelpStruct {
if ( d.memberType == SimpleTypeImpl::MemberInfo::Typedef && d.type->fullName() == "const int" )
memType = "enum";
- TQString txt = i18n( "Show %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) );
- int id = parent->insertItem( txt, receiver, TQT_SLOT( popupClassViewAction( int ) ) );
+ TQString txt = i18n( "Show %1 %2" ).tqarg( memType ).tqarg( cleanForMenu( d.name ) );
+ int id = tqparent->insertItem( txt, receiver, TQT_SLOT( popupClassViewAction( int ) ) );
receiver->m_popupClassViewActions.insert( id, dom );
}
- void insertItem ( TQPopupMenu* parent, TypeDesc d , TQString prefix ) {
+ void insertItem ( TQPopupMenu* tqparent, TypeDesc d , TQString prefix ) {
Debug dbg( "#insert# ", 10 );
TQString txt;
@@ -565,12 +565,12 @@ struct PopupClassViewFillerHelpStruct {
for ( SimpleTypeNamespace::SlaveList::iterator it = slaves.begin(); it != slaves.end(); ++it ) {
SimpleTypeCodeModel* cm = dynamic_cast<SimpleTypeCodeModel*>( ( *it ).first.first.resolved().data() );
if ( cm && cm->item() ) {
- insertItem( parent, ( new SimpleTypeCachedCodeModel( cm->item() ) ) ->desc(), prefix );
+ insertItem( tqparent, ( new SimpleTypeCachedCodeModel( cm->item() ) ) ->desc(), prefix );
} else {
SimpleTypeNamespace* cn = dynamic_cast<SimpleTypeNamespace*>( ( *it ).first.first.resolved().data() );
if( cn ) {
TypePointer t = new SimpleTypeNamespace( cn ); //to avoid endless recursion (caching would be better)
- insertItem( parent, t->desc(), prefix );
+ insertItem( tqparent, t->desc(), prefix );
}
}
}
@@ -583,7 +583,7 @@ struct PopupClassViewFillerHelpStruct {
if ( d.resolved() ->asFunction() ) {
n = buildSignature( d.resolved() );
}
- txt = prefix + i18n( "Show %1" ).arg( cleanForMenu( n ) );
+ txt = prefix + i18n( "Show %1" ).tqarg( cleanForMenu( n ) );
} else {
txt = prefix + d.name() + " not in code-model";
}
@@ -596,7 +596,7 @@ struct PopupClassViewFillerHelpStruct {
}
}
- int id = parent->insertItem( txt, receiver, TQT_SLOT( popupClassViewAction( int ) ) );
+ int id = tqparent->insertItem( txt, receiver, TQT_SLOT( popupClassViewAction( int ) ) );
if ( dom )
receiver->m_popupClassViewActions.insert( id, dom );
@@ -612,13 +612,13 @@ class PopupFiller {
PopupFiller( HelpStruct str , TQString dAdd, int maxCount = 100 ) : struk( str ), depthAdd( dAdd ), s( maxCount ) {}
- void fillIncludes( const DeclarationInfo& decl, TQPopupMenu* parent, bool& needSeparator ) {
+ void fillIncludes( const DeclarationInfo& decl, TQPopupMenu* tqparent, bool& needSeparator ) {
if( !struk.receiver->getIncludeFiles()[ HashedString( decl.file ) ] ) {
TQString file = decl.file;
//The include-file seems to be missing
if( needSeparator ) {
needSeparator = false;
- parent->insertSeparator();
+ tqparent->insertSeparator();
}
TQString includeFile = file;
@@ -644,7 +644,7 @@ class PopupFiller {
//kdDebug( 9007 ) << "found include-file \"" << includeFile << "\"" << endl;
}
- int id = parent->insertItem( i18n( "#include \"%1\" ( defines %2 )" ).arg ( includeFile ).arg( decl.name ), struk.receiver, TQT_SLOT( popupAction( int ) ) );
+ int id = tqparent->insertItem( i18n( "#include \"%1\" ( defines %2 )" ).tqarg ( includeFile ).tqarg( decl.name ), struk.receiver, TQT_SLOT( popupAction( int ) ) );
DeclarationInfo fakeDec;
fakeDec.name = decl.name;
fakeDec.file = includeFile;
@@ -653,7 +653,7 @@ class PopupFiller {
}
}
- void fill( TQPopupMenu * parent, LocateResult d, TQString prefix = "", const DeclarationInfo & sourceVariable = DeclarationInfo() ) {
+ void fill( TQPopupMenu * tqparent, LocateResult d, TQString prefix = "", const DeclarationInfo & sourceVariable = DeclarationInfo() ) {
Debug dbg( "#fl# ", 10 )
;
@@ -670,32 +670,32 @@ class PopupFiller {
f.type = d.desc();
f.memberType = SimpleTypeImpl::MemberInfo::Variable;
- /*int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").arg( type.sourceVariable.name ) , this, TQT_SLOT( popupAction( int ) ) );
+ /*int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").tqarg( type.sourceVariable.name ) , this, TQT_SLOT( popupAction( int ) ) );
m_popupActions.insert( id, type.sourceVariable );*/
- struk.insertItem( parent, f, prefix );
+ struk.insertItem( tqparent, f, prefix );
- parent->insertSeparator();
+ tqparent->insertSeparator();
if ( !sourceVariable.comment.isEmpty() ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Comment on %1" ).arg( sourceVariable.name ), m );
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Comment on %1" ).tqarg( sourceVariable.name ), m );
TQStringList ls = prepareTextForMenu( sourceVariable.comment, 15, 100 );
for ( TQStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
m->insertItem( *it, 0, TQT_SLOT( popupClassViewAction( int ) ) );
}
- parent->insertSeparator();
+ tqparent->insertSeparator();
}
}
- struk.insertItem( parent, d, prefix );
+ struk.insertItem( tqparent, d, prefix );
if( d->resolved() && !d->resolved()->specialization().isEmpty() ) {
- SimpleType p = d->resolved()->parent();
+ SimpleType p = d->resolved()->tqparent();
LocateResult r = p->locateDecType( d->name() );
if( r ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Specialized from \"%1\"" ).arg( cleanForMenu( r->fullNameChain() ) ), m );
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Specialized from \"%1\"" ).tqarg( cleanForMenu( r->fullNameChain() ) ), m );
fill( m, r );
}
}
@@ -703,11 +703,11 @@ class PopupFiller {
TypeDesc::TemplateParams p = d->templateParams();
for ( TypeDesc::TemplateParams::iterator it = p.begin(); it != p.end(); ++it ) {
//if( (*it)->resolved() ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Template-param \"%1\"" ).arg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m );
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Template-param \"%1\"" ).tqarg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m );
fill( m, **it );
/*} else {
- fill( parent, **it, prefix + depthAdd );
+ fill( tqparent, **it, prefix + depthAdd );
}*/
}
@@ -715,16 +715,16 @@ class PopupFiller {
if ( d->resolved() ->asFunction() ) {
LocateResult rt = d->resolved() ->locateDecType( d->resolved() ->asFunction() ->getReturnType() );
if ( rt ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Return-type \"%1\"" ).arg( cleanForMenu( rt->fullNameChain() ) ), m );
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Return-type \"%1\"" ).tqarg( cleanForMenu( rt->fullNameChain() ) ), m );
fill( m, rt );
}
TQValueList<TypeDesc> args = d->resolved() ->asFunction() ->getArgumentTypes();
TQStringList argNames = d->resolved() ->asFunction() ->getArgumentNames();
if ( !args.isEmpty() ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Argument-types" ), m );
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Argument-types" ), m );
TQStringList::iterator it2 = argNames.begin();
for ( TQValueList<TypeDesc>::iterator it = args.begin(); it != args.end(); ++it ) {
LocateResult at = d->resolved() ->locateDecType( *it );
@@ -734,7 +734,7 @@ class PopupFiller {
++it2;
}
TQPopupMenu * mo = PopupTracker::createPopup( m );
- m->insertItem( i18n( "Argument \"%1\"" ).arg( cleanForMenu( at->fullNameChain() + " " + name ) ), mo );
+ m->insertItem( i18n( "Argument \"%1\"" ).tqarg( cleanForMenu( at->fullNameChain() + " " + name ) ), mo );
fill( mo, at );
}
@@ -743,17 +743,17 @@ class PopupFiller {
}
#ifndef DISABLE_TRACING
if ( d.trace() ) {
- TQValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
+ TQValueList<TQPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
if ( !trace.isEmpty() ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Trace" ), m );
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Trace" ), m );
- for ( TQValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> >::iterator it = trace.begin(); it != trace.end(); ++it ) {
+ for ( TQValueList<TQPair<SimpleTypeImpl::MemberInfo, TypeDesc> >::iterator it = trace.begin(); it != trace.end(); ++it ) {
TQPopupMenu * mo = PopupTracker::createPopup( m );
TQString tail = ( *it ).second.fullNameChain();
if ( !tail.isEmpty() )
tail = "::" + tail;
- m->insertItem( i18n( "%1 -> %2" ).arg( cleanForMenu( ( *it ).first.name + tail ) ).arg( cleanForMenu( ( *it ).first.type->fullNameChain() + tail ) ), mo );
+ m->insertItem( i18n( "%1 -> %2" ).tqarg( cleanForMenu( ( *it ).first.name + tail ) ).tqarg( cleanForMenu( ( *it ).first.type->fullNameChain() + tail ) ), mo );
struk.insertItem( mo, ( *it ).first, prefix );
@@ -778,21 +778,21 @@ class PopupFiller {
if ( d->resolved() ) {
TQValueList<LocateResult> bases = d->resolved() ->getBases();
for ( TQValueList<LocateResult>::iterator it = bases.begin(); it != bases.end(); ++it ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Base-class \"%1\"" ).arg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m );
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Base-class \"%1\"" ).tqarg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m );
fill( m, *it );
}
- if ( d->resolved() ->parent() && d->resolved() ->parent() ->desc() ) {
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Nested in \"%1\"" ).arg( cleanForMenu( d->resolved() ->parent() ->fullTypeResolved() ) ), m );
- fill( m, d->resolved() ->parent() ->desc() );
+ if ( d->resolved() ->tqparent() && d->resolved() ->tqparent() ->desc() ) {
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Nested in \"%1\"" ).tqarg( cleanForMenu( d->resolved() ->tqparent() ->fullTypeResolved() ) ), m );
+ fill( m, d->resolved() ->tqparent() ->desc() );
}
if ( !d->resolved() ->comment().isEmpty() ) {
- parent->insertSeparator();
- TQPopupMenu * m = PopupTracker::createPopup( parent );
- parent->insertItem( i18n( "Comment on %1" ).arg( cleanForMenu( d->name() ) ), m );
+ tqparent->insertSeparator();
+ TQPopupMenu * m = PopupTracker::createPopup( tqparent );
+ tqparent->insertItem( i18n( "Comment on %1" ).tqarg( cleanForMenu( d->name() ) ), m );
TQStringList ls = prepareTextForMenu( d->resolved() ->comment(), 15, 100 );
for ( TQStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
m->insertItem( *it, 0, TQT_SLOT( popupClassViewAction( int ) ) );
@@ -805,18 +805,18 @@ class PopupFiller {
bool needSeparator = true;
//Show the include-files for the whole trace, because usually the first in the trace should be the one to include
if ( d.trace() ) {
- TQValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
+ TQValueList<TQPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
if ( !trace.isEmpty() ) {
- for ( TQValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> >::iterator it = trace.begin(); it != trace.end(); ++it ) {
+ for ( TQValueList<TQPair<SimpleTypeImpl::MemberInfo, TypeDesc> >::iterator it = trace.begin(); it != trace.end(); ++it ) {
if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() && !(*it).first.decl.file.operator TQString().isEmpty() )
- fillIncludes( (*it).first.decl, parent, needSeparator );
+ fillIncludes( (*it).first.decl, tqparent, needSeparator );
}
}
}
//Show the include-file for the item itself
if( d->resolved() && !d->resolved()->isNamespace() && struk.receiver->cppSupport() ) {
- fillIncludes( d->resolved()->getDeclarationInfo(), parent, needSeparator );
+ fillIncludes( d->resolved()->getDeclarationInfo(), tqparent, needSeparator );
}
}
}
@@ -828,7 +828,7 @@ struct CompTypeProcessor : public TypeProcessor {
CompTypeProcessor( SimpleType scope, bool processArguments ) : m_scope( scope ), m_processArguments( processArguments ) {}
- virtual TQString parentType() {
+ virtual TQString tqparentType() {
return m_scope->fullType();
}
@@ -855,14 +855,14 @@ struct CppCodeCompletionData {
if ( recoveryPoints.count() == 0 )
return 0;
- QPair<int, int> pt = qMakePair( line, column );
+ TQPair<int, int> pt = tqMakePair( line, column );
TQPtrListIterator<RecoveryPoint> it( recoveryPoints );
RecoveryPoint* recPt = 0;
while ( it.current() ) {
- QPair<int, int> startPt = qMakePair( it.current() ->startLine, it.current() ->startColumn );
- QPair<int, int> endPt = qMakePair( it.current() ->endLine, it.current() ->endColumn );
+ TQPair<int, int> startPt = tqMakePair( it.current() ->startLine, it.current() ->startColumn );
+ TQPair<int, int> endPt = tqMakePair( it.current() ->endLine, it.current() ->endColumn );
if ( pt < startPt ) {
break;
@@ -969,7 +969,7 @@ CppCodeCompletion::~CppCodeCompletion( ) {
}
void CppCodeCompletion::addStatusText( TQString text, int timeout ) {
- m_statusTextList.append( QPair<int, TQString>( timeout, text ) );
+ m_statusTextList.append( TQPair<int, TQString>( timeout, text ) );
if ( !m_showStatusTextTimer->isActive() ) {
slotStatusTextTimeout();
}
@@ -1055,7 +1055,7 @@ void CppCodeCompletion::slotActivePartChanged( KParts::Part * part ) {
kdDebug( 9007 ) << k_funcinfo << endl;
- m_activeFileName = TQString::null;
+ m_activeFileName = TQString();
KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part );
if ( !doc )
@@ -1121,7 +1121,7 @@ void CppCodeCompletion::slotTextChanged() {
// !!WARNING!! This is very hackish, but KTE doesn't offer a way
// to tell the completion box to _go_away_
if ( ch.simplifyWhiteSpace().isEmpty() &&
- !strCurLine.simplifyWhiteSpace().contains( "virtual" ) &&
+ !strCurLine.simplifyWhiteSpace().tqcontains( "virtual" ) &&
m_bCompletionBoxShow ) {
TQValueList<KTextEditor::CompletionEntry> entryList;
m_bCompletionBoxShow = true;
@@ -1139,7 +1139,7 @@ void CppCodeCompletion::slotTextChanged() {
// m_codeCompleteCh2Rx completes on "->" and "::"
if ( ( argsHint && ch == "(" ) ||
- ( codeComplete && strCurLine.simplifyWhiteSpace().contains( "virtual" ) ) ||
+ ( codeComplete && strCurLine.simplifyWhiteSpace().tqcontains( "virtual" ) ) ||
( codeComplete && ( m_codeCompleteChRx.search( ch ) != -1 ||
m_codeCompleteCh2Rx.search( ch2 ) != -1 ) ) ||
( headComplete && ( ch == "\"" || ch == "<" ) && m_includeRx.search( strCurLine ) != -1 ) ) {
@@ -1238,7 +1238,7 @@ TQString CppCodeCompletion::replaceCppComments( const TQString& contents ) {
after.fill( ' ', before.length() - 5 );
after.prepend( "/*" );
after.append( "*/" );
- text.replace( pos, before.length() - 1, after );
+ text.tqreplace( pos, before.length() - 1, after );
pos += after.length();
} else {
pos += m_cppCodeCommentsRx.matchedLength();
@@ -1444,12 +1444,12 @@ EvaluationResult CppCodeCompletion::evaluateExpressionAt( int line, int column ,
}
void CppCodeCompletion::popupAction( int number ) {
- PopupActions::iterator it = m_popupActions.find( number );
+ PopupActions::iterator it = m_popupActions.tqfind( number );
if ( it != m_popupActions.end() ) {
TQString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator TQString();
if( (*it).startLine == -1 ) {
//startLine -1 indicates that the file should be added to the include-files
- m_activeEditor->insertLine( 0, TQString("#include \"%1\" /* defines %2 */").arg( fileName ).arg( (*it).name ) );
+ m_activeEditor->insertLine( 0, TQString("#include \"%1\" /* defines %2 */").tqarg( fileName ).tqarg( (*it).name ) );
} else {
m_pSupport->partController() ->editDocument( fileName, ( *it ).startLine );
}
@@ -1459,7 +1459,7 @@ void CppCodeCompletion::popupAction( int number ) {
}
void CppCodeCompletion::popupDefinitionAction( int number ) {
- PopupActions::iterator it = m_popupDefinitionActions.find( number );
+ PopupActions::iterator it = m_popupDefinitionActions.tqfind( number );
if ( it != m_popupDefinitionActions.end() ) {
TQString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator TQString();
if ( !m_pSupport->switchHeaderImpl( fileName, ( *it ).startLine, ( *it ).startCol ) )
@@ -1481,7 +1481,7 @@ void CppCodeCompletion::selectItem( ItemDom item ) {
}
void CppCodeCompletion::popupClassViewAction( int number ) {
- PopupClassViewActions::iterator it = m_popupClassViewActions.find( number );
+ PopupClassViewActions::iterator it = m_popupClassViewActions.tqfind( number );
if ( it != m_popupClassViewActions.end() ) {
if ( ( *it ) )
selectItem( *it );
@@ -1532,11 +1532,11 @@ void CppCodeCompletion::contextEvaluationMenus ( TQPopupMenu *popup, const Conte
TQPopupMenu * m = PopupTracker::createPopup( popup );
int gid;
if ( contextMenuEntriesAtTop )
- gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).arg( cleanForMenu( type.macro.name() ) ), m, 5, cpos++ );
+ gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).tqarg( cleanForMenu( type.macro.name() ) ), m, 5, cpos++ );
else
- gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).arg( cleanForMenu( type.macro.name() ) ), m );
+ gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).tqarg( cleanForMenu( type.macro.name() ) ), m );
- int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( type.macro.name() ) ), this, TQT_SLOT( popupAction( int ) ) );
+ int id = m->insertItem( i18n( "Jump to %1" ).tqarg( cleanForMenu( type.macro.name() ) ), this, TQT_SLOT( popupAction( int ) ) );
TQPopupMenu * b = PopupTracker::createPopup( m );
m->insertItem( i18n( "Body" ), b );
@@ -1564,11 +1564,11 @@ void CppCodeCompletion::contextEvaluationMenus ( TQPopupMenu *popup, const Conte
int gid;
TQPopupMenu * m = PopupTracker::createPopup( popup );
if ( contextMenuEntriesAtTop )
- gid = popup->insertItem( i18n( "Goto Include File: %1" ).arg( cleanForMenu( includeFileName ) ), m, 5, cpos++ );
+ gid = popup->insertItem( i18n( "Goto Include File: %1" ).tqarg( cleanForMenu( includeFileName ) ), m, 5, cpos++ );
else
- gid = popup->insertItem( i18n( "Goto Include File: %1" ).arg( cleanForMenu( includeFileName ) ), m );
+ gid = popup->insertItem( i18n( "Goto Include File: %1" ).tqarg( cleanForMenu( includeFileName ) ), m );
- int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( includeFilePath ) ), this, TQT_SLOT( popupAction( int ) ) );
+ int id = m->insertItem( i18n( "Jump to %1" ).tqarg( cleanForMenu( includeFilePath ) ), this, TQT_SLOT( popupAction( int ) ) );
DeclarationInfo i;
i.file = includeFilePath;
@@ -1585,9 +1585,9 @@ void CppCodeCompletion::contextEvaluationMenus ( TQPopupMenu *popup, const Conte
} else {
///Could not find include-file
if ( contextMenuEntriesAtTop )
- popup->insertItem( i18n( "Not Found: \"%1\"" ).arg( includeFileName ), 5, cpos++ );
+ popup->insertItem( i18n( "Not Found: \"%1\"" ).tqarg( includeFileName ), 5, cpos++ );
else
- popup->insertItem( i18n( "Not Found: \"%1\"" ).arg( includeFileName ) );
+ popup->insertItem( i18n( "Not Found: \"%1\"" ).tqarg( includeFileName ) );
}
}
@@ -1609,14 +1609,14 @@ void CppCodeCompletion::contextEvaluationMenus ( TQPopupMenu *popup, const Conte
TQPopupMenu * m = PopupTracker::createPopup( popup );
int gid;
if ( contextMenuEntriesAtTop )
- gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).arg( cleanForMenu( name ) ), m, 5, cpos++ );
+ gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).tqarg( cleanForMenu( name ) ), m, 5, cpos++ );
else
- gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).arg( cleanForMenu( name ) ), m );
+ gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).tqarg( cleanForMenu( name ) ), m );
- popup->setWhatsThis( gid, i18n( "<b>Navigation</b><p>Provides a menu to navigate to positions of items that are involved in this expression" ) );
+ popup->tqsetWhatsThis( gid, i18n( "<b>Navigation</b><p>Provides a menu to navigate to positions of items that are involved in this expression" ) );
/*if( type.sourceVariable && type.sourceVariable.name != "this" ) {
- int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").arg( type.sourceVariable.name ) , this, TQT_SLOT( popupAction( int ) ) );
+ int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").tqarg( type.sourceVariable.name ) , this, TQT_SLOT( popupAction( int ) ) );
m_popupActions.insert( id, type.sourceVariable );
}*/
@@ -1629,11 +1629,11 @@ void CppCodeCompletion::contextEvaluationMenus ( TQPopupMenu *popup, const Conte
TQPopupMenu * m = PopupTracker::createPopup( popup );
int gid;
if ( contextMenuEntriesAtTop )
- gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).arg( cleanForMenu( name ) ), m, 6, cpos++ );
+ gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).tqarg( cleanForMenu( name ) ), m, 6, cpos++ );
else
- gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).arg( cleanForMenu( name ) ), m );
+ gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).tqarg( cleanForMenu( name ) ), m );
- popup->setWhatsThis( gid, i18n( "<b>Navigation</b><p>Provides a menu to show involved items in the class-view " ) );
+ popup->tqsetWhatsThis( gid, i18n( "<b>Navigation</b><p>Provides a menu to show involved items in the class-view " ) );
PopupClassViewFillerHelpStruct h( this );
PopupFiller<PopupClassViewFillerHelpStruct> filler( h, "" );
@@ -1691,7 +1691,7 @@ void CppCodeCompletion::slotTextHint( int line, int column, TQString &text ) {
}
text += "type: \"" + type.resultType->fullTypeResolved() + "\"";
}
- if( type.resultType->parent()) text += "\nnested in: \"" + type.resultType->parent()->fullTypeResolvedWithScope() + "\"";
+ if( type.resultType->tqparent()) text += "\nnested in: \"" + type.resultType->tqparent()->fullTypeResolvedWithScope() + "\"";
DeclarationInfo i = type.resultType->getDeclarationInfo();
if( i ) text += "\n" + i.locationToText();
@@ -1703,27 +1703,27 @@ void CppCodeCompletion::slotTextHint( int line, int column, TQString &text ) {
const int timeout = 2000;
if ( type->resolved() ) {
- addStatusText( i18n( "Type of \"%1\" is \"%2\"" ).arg( type.expr.expr() ).arg( type->fullNameChain() ), timeout );
+ addStatusText( i18n( "Type of \"%1\" is \"%2\"" ).tqarg( type.expr.expr() ).tqarg( type->fullNameChain() ), timeout );
if ( type.sourceVariable && !type.sourceVariable.comment.isEmpty() ) {
- addStatusText( i18n( "Comment on variable \"%1\": \"%2\"" ).arg( type.sourceVariable.name ).arg( type.sourceVariable.comment ) , 10000 );
+ addStatusText( i18n( "Comment on variable \"%1\": \"%2\"" ).tqarg( type.sourceVariable.name ).tqarg( type.sourceVariable.comment ) , 10000 );
}
if ( !type->resolved() ->comment().isEmpty() ) {
- addStatusText( i18n( "Comment on \"%1\": \"%2\"" ).arg( type->name() ).arg( type->resolved() ->comment() ) , 10000 );
+ addStatusText( i18n( "Comment on \"%1\": \"%2\"" ).tqarg( type->name() ).tqarg( type->resolved() ->comment() ) , 10000 );
}
if ( type->resolved() ->comment().isEmpty() ) {
- addStatusText( i18n( "\"%1\" has no comment" ).arg( type->name() ) , timeout );
+ addStatusText( i18n( "\"%1\" has no comment" ).tqarg( type->name() ) , timeout );
}
} else {
if ( type ) {
if( !BuiltinTypes::isBuiltin( type.resultType ) ) {
- addStatusText( i18n( "Type of \"%1\" is unresolved, name: \"%2\"" ).arg( type.expr.expr() ).arg( type->fullNameChain() ), 2 * timeout );
+ addStatusText( i18n( "Type of \"%1\" is unresolved, name: \"%2\"" ).tqarg( type.expr.expr() ).tqarg( type->fullNameChain() ), 2 * timeout );
} else {
- addStatusText( i18n( "\"%1\" is of builtin type \"%2\", a %3" ).arg( type.expr.expr() ).arg( type->fullNameChain() ).arg(BuiltinTypes::comment( type.resultType )), 2 * timeout );
+ addStatusText( i18n( "\"%1\" is of builtin type \"%2\", a %3" ).tqarg( type.expr.expr() ).tqarg( type->fullNameChain() ).tqarg(BuiltinTypes::comment( type.resultType )), 2 * timeout );
}
} else {
- addStatusText( i18n( "Type of \"%1\" could not be evaluated: tried to evaluate expression as \"%2\"" ).arg( type.expr.expr() ).arg( type.expr.typeAsString() ), 2 * timeout );
+ addStatusText( i18n( "Type of \"%1\" could not be evaluated: tried to evaluate expression as \"%2\"" ).tqarg( type.expr.expr() ).tqarg( type.expr.typeAsString() ), 2 * timeout );
}
}
@@ -1744,7 +1744,7 @@ bool CppCodeCompletion::isTypeExpression( const TQString& expr ) {
bool CppCodeCompletion::mayBeTypeTail( int line, int column, TQString& append, bool inFunction ) {
TQString tail = clearComments( m_activeEditor->text( line, column + 1, line + 10 > ( int ) m_activeEditor->numLines() ? ( int ) m_activeEditor->numLines() : line + 10, 0 ) );
- tail.replace( "\n", " " );
+ tail.tqreplace( "\n", " " );
SafetyCounter s ( 100 );
bool hadSpace = false;
while ( !tail.isEmpty() && s ) {
@@ -1830,7 +1830,7 @@ ExpressionInfo CppCodeCompletion::findExpressionAt( int line, int column, int st
//make this a regexp
TQString e = ret.expr();
- if ( e.contains( "." ) || e.contains( "->" ) || e.contains( "(" ) || e.contains( ")" ) || e.contains( "=" ) || e.contains( "-" ) )
+ if ( e.tqcontains( "." ) || e.tqcontains( "->" ) || e.tqcontains( "(" ) || e.tqcontains( ")" ) || e.tqcontains( "=" ) || e.tqcontains( "-" ) )
mayBeType = false;
if ( mayBeType ) {
@@ -1904,26 +1904,26 @@ SimpleContext* CppCodeCompletion::computeFunctionContext( FunctionDom f, int lin
if ( !scope.isEmpty() ) {
- SimpleType parentType;
+ SimpleType tqparentType;
/* if( !m_cachedFromContext ) {
TypePointer t = SimpleType(TQStringList())->locateDecType( scope.join("") ).desc().resolved();;
if( t )
- parentType = SimpleType( t.data() );
+ tqparentType = SimpleType( t.data() );
else
- parentType = SimpleType( scope );
+ tqparentType = SimpleType( scope );
} else {*/
- parentType = SimpleType( scope, getIncludeFiles() );
+ tqparentType = SimpleType( scope, getIncludeFiles() );
//}
- parentType->descForEdit().setTotalPointerDepth( 1 );
- ctx->setContainer( parentType );
+ tqparentType->descForEdit().setTotalPointerDepth( 1 );
+ ctx->setContainer( tqparentType );
}
SimpleType global = ctx->global();
if( dynamic_cast<SimpleTypeNamespace*>( &(*global) ) ) {
SimpleTypeNamespace* globalNs = static_cast <SimpleTypeNamespace*>( &(*global) );
- TQValueList<QPair<TQString, TQString> > localImports = ctx->imports();
- for( TQValueList<QPair<TQString, TQString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
+ TQValueList<TQPair<TQString, TQString> > localImports = ctx->imports();
+ for( TQValueList<TQPair<TQString, TQString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
globalNs->addAliasMap( (*it).first, (*it).second );
}
@@ -1988,8 +1988,8 @@ bool CppCodeCompletion::functionContains( FunctionDom f , int line, int col ) {
if ( t.isEmpty() )
return false;
- //int i = t.find( '{' );
- int i = t.find( '(' ); //This now includes the argument-list
+ //int i = t.tqfind( '{' );
+ int i = t.tqfind( '(' ); //This now includes the argument-list
if ( i == -1 )
return false;
int lineCols = 0;
@@ -2017,7 +2017,7 @@ void CppCodeCompletion::getFunctionBody( FunctionDom f , int& line, int& col ) {
if ( t.isEmpty() )
return;
- int i = t.find( '{' );
+ int i = t.tqfind( '{' );
if ( i == -1 )
return;
i++;
@@ -2059,14 +2059,14 @@ void CppCodeCompletion::needRecoveryPoints() {
if ( !ast ) {
kdDebug( 9007 ) << "background-parser is missing the translation-unit. The file needs to be reparsed." << endl;
m_pSupport->parseFileAndDependencies( m_activeFileName, true );
-// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Background-parser is missing the necessary translation-unit. It will be computed, but this completion will fail." ).arg( m_activeFileName ), 2000 );
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Background-parser is missing the necessary translation-unit. It will be computed, but this completion will fail." ).tqarg( m_activeFileName ), 2000 );
return;
} else {
computeRecoveryPointsLocked();
}
if ( this->d->recoveryPoints.isEmpty() ) {
kdDebug( 9007 ) << "Failed to compute recovery-points for " << m_activeFileName << endl;
-// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Failed to compute recovery-points for %1" ).arg( m_activeFileName ), 1000 );
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Failed to compute recovery-points for %1" ).tqarg( m_activeFileName ), 1000 );
} else {
kdDebug( 9007 ) << "successfully computed recovery-points for " << m_activeFileName << endl;
}
@@ -2080,7 +2080,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
FileDom file = m_pSupport->codeModel() ->fileByName( m_activeFileName );
if ( !file ) {
-// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "File %1 does not exist in the code-model" ).arg( m_activeFileName ), 1000 );
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "File %1 does not exist in the code-model" ).tqarg( m_activeFileName ), 1000 );
kdDebug( 9007 ) << "Error: file " << m_activeFileName << " could not be located in the code-model, code-completion stopped\n";
return SimpleType();
}
@@ -2113,7 +2113,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
c = strCurLine[ --pos ];
if ( !( c.isLetterOrNumber() || c == '_' || c == ')' || c == ']' || c == '>' ) ) {
- conf.invalidate();
+ conf.tqinvalidate();
return SimpleType();
}
}
@@ -2280,7 +2280,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
CppCodeCompletionConfig * cfg = m_pSupport->codeCompletionConfig();
if( cfg->usePermanentCaching() && contextItem ) {
- conf.invalidate();
+ conf.tqinvalidate();
m_cachedFromContext = contextItem;
}
@@ -2323,7 +2323,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
FileDom file = m_pSupport->codeModel() ->fileByName( m_activeFileName );
if ( !file ) {
-// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "File %1 does not exist in the code-model" ).arg( m_activeFileName ), 1000 );
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "File %1 does not exist in the code-model" ).tqarg( m_activeFileName ), 1000 );
kdDebug( 9007 ) << "Error: file " << m_activeFileName << " could not be located in the code-model, code-completion stopped\n";
return ;
}
@@ -2508,7 +2508,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
--end_expr;
if ( contents[ end_expr ] != ',' ) {
- expr = TQString::null;
+ expr = TQString();
} else {
start_expr = expressionAt( contents, end_expr );
expr = contents.mid( start_expr, end_expr - start_expr ).stripWhiteSpace();
@@ -2555,8 +2555,8 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
}
if( dynamic_cast<SimpleTypeNamespace*>( SimpleType::globalNamespace().data() ) ) {
SimpleTypeNamespace* globalNs = static_cast <SimpleTypeNamespace*>( SimpleType::globalNamespace().data() );
- TQValueList<QPair<TQString, TQString> > localImports = ctx->imports();
- for( TQValueList<QPair<TQString, TQString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
+ TQValueList<TQPair<TQString, TQString> > localImports = ctx->imports();
+ for( TQValueList<TQPair<TQString, TQString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
globalNs->addAliasMap( (*it).first, (*it).second );
}
} else {
@@ -2564,7 +2564,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
}
if ( !scope.isEmpty() ) {
- SimpleType parentType;
+ SimpleType tqparentType;
/*if( !m_cachedFromContext ) {
TypePointer t = createGlobalNamespace();
@@ -2584,14 +2584,14 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
d.setIncludeFiles( getIncludeFiles() );
SimpleTypeImpl * i = SimpleType( TQStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data();
if ( i ) {
- parentType = i;
+ tqparentType = i;
} else {
- parentType = SimpleType( scope, getIncludeFiles() );
+ tqparentType = SimpleType( scope, getIncludeFiles() );
}
} else {
- parentType = SimpleType( scope, getIncludeFiles() );
+ tqparentType = SimpleType( scope, getIncludeFiles() );
}
- this_type = parentType;
+ this_type = tqparentType;
this_type->descForEdit().setTotalPointerDepth( 1 );
ctx->setContainer( this_type );
}
@@ -2673,7 +2673,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
kdDebug(9007) << "------> found virtual keyword for class specifier '"
<< clazz->text() << "'" << endl;
}*/
- } else if ( TQString( "virtual" ).find( keyword ) != -1 )
+ } else if ( TQString( "virtual" ).tqfind( keyword ) != -1 )
m_blockForKeyword = true;
else
m_blockForKeyword = false;
@@ -2713,7 +2713,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
--end_expr;
if ( contents[ end_expr ] != ',' ) {
- expr = TQString::null;
+ expr = TQString();
} else {
start_expr = expressionAt( contents, end_expr );
expr = contents.mid( start_expr, end_expr - start_expr ).stripWhiteSpace();
@@ -2756,7 +2756,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
if ( ch2 == "::" ) {
TQString str = clearComments( expr );
- if ( !str.contains( '.' ) && !str.contains( "->" ) ) ///Necessary, because the expression may also be like user->BaseUser::
+ if ( !str.tqcontains( '.' ) && !str.tqcontains( "->" ) ) ///Necessary, because the expression may also be like user->BaseUser::
isInstance = false;
}
@@ -2790,7 +2790,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
}
if( !t->isNamespace() || invokedOnDemand || alwaysIncludeNamespaces )
computeCompletionEntryList( t, entryList, t->scope(), false, depth );
- t = t->parent();
+ t = t->tqparent();
depth++;
}
}
@@ -2807,7 +2807,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
}
if ( ( (t->isNamespace() && invokedOnDemand) || alwaysIncludeNamespaces ) || ( first && isInstance ) )
computeCompletionEntryList( t, entryList, t->scope(), t->isNamespace() ? true : isInstance, depth );
- t = t->parent();
+ t = t->tqparent();
depth++;
first = false;
}
@@ -2890,7 +2890,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
if ( method )
signatureList += computeSignatureList( method );
if ( t )
- t = t->parent();
+ t = t->tqparent();
} while ( !ready && s );
if ( !signatureList.isEmpty() ) {
@@ -2905,7 +2905,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
ctx = 0;
if ( cfg->usePermanentCaching() ) {
- conf.invalidate();
+ conf.tqinvalidate();
m_cachedFromContext = contextItem;
}
}
@@ -2972,7 +2972,7 @@ void CppCodeCompletion::slotCodeModelUpdated( const TQString& fileName ) {
if ( fileName != m_activeFileName || !m_pSupport || !m_activeEditor )
return ;
-// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Current file updated %1" ).arg( m_activeFileName ), 1000 );
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Current file updated %1" ).tqarg( m_activeFileName ), 1000 );
computeRecoveryPointsLocked();
}
@@ -2981,7 +2981,7 @@ void CppCodeCompletion::slotFileParsed( const TQString& fileName ) {
if ( fileName != m_activeFileName || !m_pSupport || !m_activeEditor )
return ;
-// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Current file parsed %1 (cache emptied)" ).arg( m_activeFileName ), 1000 );
+// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Current file parsed %1 (cache emptied)" ).tqarg( m_activeFileName ), 1000 );
emptyCache(); ///The cache has to be emptied, because the code-model changed. @todo Better: Only refresh the code-model(tell all code-model-types to refresh themselves on demand)
@@ -3016,7 +3016,7 @@ SimpleContext* CppCodeCompletion::computeContext( FunctionDefinitionAST * ast, i
var.ptrList = ptrList;
var.type = param->typeSpec() ->text() + ptrList.join( "" );
- var.name = declaratorToString( param->declarator(), TQString::null, true );
+ var.name = declaratorToString( param->declarator(), TQString(), true );
var.comment = param->comment();
param->getStartPosition( &var.startLine, &var.startCol );
param->getEndPosition( &var.endLine, &var.endCol );
@@ -3173,7 +3173,7 @@ void CppCodeCompletion::computeContext( SimpleContext*& ctx, DeclarationStatemen
name = usingDecl->name()->text();
if( !name.isNull() )
- ctx->addImport( QPair<TQString, TQString>( "", name ) );
+ ctx->addImport( TQPair<TQString, TQString>( "", name ) );
}
}
@@ -3182,7 +3182,7 @@ void CppCodeCompletion::computeContext( SimpleContext*& ctx, DeclarationStatemen
TQString name;
if( namespaceAlias ->namespaceName() && namespaceAlias->aliasName() ) {
- ctx->addImport( QPair<TQString, TQString>( namespaceAlias->namespaceName()->text(), namespaceAlias->aliasName()->text() ) );
+ ctx->addImport( TQPair<TQString, TQString>( namespaceAlias->namespaceName()->text(), namespaceAlias->aliasName()->text() ) );
}
}
@@ -3293,7 +3293,7 @@ FunctionDefinitionAST * CppCodeCompletion::functionDefinition( AST* node ) {
while ( node ) {
if ( node->nodeType() == NodeType_FunctionDefinition )
return static_cast<FunctionDefinitionAST*>( node );
- node = node->parent();
+ node = node->tqparent();
}
return 0;
}
@@ -3360,7 +3360,7 @@ TQString codeModelAccessToString( CodeModelItem::Access access ) {
#define MAXCOMMENTCOLUMNS 45
-TQString CppCodeCompletion::commentFromItem( const SimpleType& parent, const ItemDom& item ) {
+TQString CppCodeCompletion::commentFromItem( const SimpleType& tqparent, const ItemDom& item ) {
--m_maxComments;
static TQString maxReached = " ";
if( m_maxComments < 0 ) {
@@ -3371,8 +3371,8 @@ TQString CppCodeCompletion::commentFromItem( const SimpleType& parent, const Ite
item->getStartPosition( &line, &col );
- if ( !parent->scope().isEmpty() ) {
- ret += "Container: " + parent->fullTypeResolvedWithScope();
+ if ( !tqparent->scope().isEmpty() ) {
+ ret += "Container: " + tqparent->fullTypeResolvedWithScope();
}
if ( item->isEnum() ) {
@@ -3451,7 +3451,7 @@ TQString CppCodeCompletion::commentFromItem( const SimpleType& parent, const Ite
ret += "\nKind: Typedef";
if ( t ) {
ret += "\nType: " + t->type();
- LocateResult r = parent->locateDecType( t->type() );
+ LocateResult r = tqparent->locateDecType( t->type() );
if ( r.desc().resolved() )
ret += "\nResolved type: " + r.desc().resolved() ->fullTypeResolvedWithScope();
else
@@ -3463,13 +3463,13 @@ TQString CppCodeCompletion::commentFromItem( const SimpleType& parent, const Ite
ret += "\nKind: Class";
}
- ret += TQString( "\nFile: %1\nLine: %2 Column: %3" ).arg( prepareTextForMenu( item->fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).arg( line ).arg( col );
+ ret += TQString( "\nFile: %1\nLine: %2 Column: %3" ).tqarg( prepareTextForMenu( item->fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).tqarg( line ).tqarg( col );
if ( !item->comment().isEmpty() )
ret += "\n\n" + prepareTextForMenu( item->comment(), 3, MAXCOMMENTCOLUMNS ).join( "\n" );
return ret;
}
-TQString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag ) {
+TQString CppCodeCompletion::commentFromTag( const SimpleType& tqparent, Tag& tag ) {
--m_maxComments;
static TQString maxReached = " ";
if( m_maxComments < 0 ) {
@@ -3480,8 +3480,8 @@ TQString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag )
tag.getStartPosition( &line, &col );
TQString ret; // = tag.comment();
- if ( !parent->scope().isEmpty() ) {
- ret += "Container: " + parent->fullTypeResolvedWithScope();
+ if ( !tqparent->scope().isEmpty() ) {
+ ret += "Container: " + tqparent->fullTypeResolvedWithScope();
}
/*
if( tag.kind() == Tag::Kind_Enum ) {
@@ -3571,7 +3571,7 @@ TQString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag )
if ( tag.kind() == Tag::Kind_Typedef ) {
ret += "\nKind: Typedef";
ret += "\nType: " + tagType( tag );
- LocateResult r = parent->locateDecType( tagType( tag ) );
+ LocateResult r = tqparent->locateDecType( tagType( tag ) );
if ( r.desc().resolved() )
ret += "\nResolved type: " + r.desc().resolved() ->fullTypeResolvedWithScope();
else
@@ -3585,7 +3585,7 @@ TQString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag )
ret += "\nKind: Struct";
}
- ret += TQString( "\nFile: %1\nLine: %2 Column: %3" ).arg( prepareTextForMenu( tag.fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).arg( line ).arg( col );
+ ret += TQString( "\nFile: %1\nLine: %2 Column: %3" ).tqarg( prepareTextForMenu( tag.fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).tqarg( line ).tqarg( col );
if ( !tag.comment().isEmpty() ) {
ret += "\n\n" + prepareTextForMenu( tag.comment(), 20, MAXCOMMENTCOLUMNS ).join( "\n" );
}
@@ -3687,8 +3687,8 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, TQValueLis
args << Catalog::QueryArgument( "name", fullname );
- TQValueList<LocateResult> parents = typeR->getBases( );
- for ( TQValueList<LocateResult>::Iterator it = parents.begin(); it != parents.end(); ++it ) {
+ TQValueList<LocateResult> tqparents = typeR->getBases( );
+ for ( TQValueList<LocateResult>::Iterator it = tqparents.begin(); it != tqparents.end(); ++it ) {
if ( !( *it ) ->resolved() )
continue;
SimpleType tp = SimpleType( ( *it ) ->resolved() );
@@ -3807,14 +3807,14 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList
break;
}
- e.userdata = TQString( "%1%2%3%4%5" ).arg( num ).arg( depth ).arg( className ).arg( sortPosition ).arg( subSorting );
+ e.userdata = TQString( "%1%2%3%4%5" ).tqarg( num ).tqarg( depth ).tqarg( className ).tqarg( sortPosition ).tqarg( subSorting );
if ( m_completionMode != SignalCompletion ) {
if ( !type->isNamespace() ) {
if ( num == 1 )
- e.postfix += "; (protected)"; // in " + proc.parentType() + ")";
+ e.postfix += "; (protected)"; // in " + proc.tqparentType() + ")";
if ( num == 2 )
- e.postfix += "; (private)"; // in " + proc.parentType() + ")";
+ e.postfix += "; (private)"; // in " + proc.tqparentType() + ")";
}
}
@@ -3930,9 +3930,9 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList
computeCompletionEntryList( klass->name(), type, entryList, klass->typeAliasList(), isInstance, depth );
}
- TQValueList<LocateResult> parents = type->getBases( );
+ TQValueList<LocateResult> tqparents = type->getBases( );
- for ( TQValueList<LocateResult>::Iterator it = parents.begin(); it != parents.end(); ++it ) {
+ for ( TQValueList<LocateResult>::Iterator it = tqparents.begin(); it != tqparents.end(); ++it ) {
if ( !( *it ) ->resolved() )
continue;
@@ -3962,7 +3962,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList
computeCompletionEntryList( type, entryList, scope->namespaceList(), isInstance, depth );
}
-void CppCodeCompletion::computeCompletionEntryList( TQString parent, SimpleType type, TQValueList< CodeCompletionEntry > & entryList, const ClassList & lst, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( TQString tqparent, SimpleType type, TQValueList< CodeCompletionEntry > & entryList, const ClassList & lst, bool isInstance, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
@@ -3981,7 +3981,7 @@ void CppCodeCompletion::computeCompletionEntryList( TQString parent, SimpleType
if ( isInstance )
continue;
- entry.userdata = TQString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 6 );
+ entry.userdata = TQString( "%1%2%3%4%5" ).tqarg( CodeModelItem::Public ).tqarg( depth ).tqarg( tqparent ).tqarg( 6 );
entryList << entry;
@@ -3993,7 +3993,7 @@ void CppCodeCompletion::computeCompletionEntryList( TQString parent, SimpleType
}
}
-void CppCodeCompletion::computeCompletionEntryList( TQString parent, SimpleType type, TQValueList< CodeCompletionEntry > & entryList, const TypeAliasList & lst, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( TQString tqparent, SimpleType type, TQValueList< CodeCompletionEntry > & entryList, const TypeAliasList & lst, bool isInstance, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
@@ -4015,7 +4015,7 @@ void CppCodeCompletion::computeCompletionEntryList( TQString parent, SimpleType
entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace();
entry.text = klass->name();
entry.comment = commentFromItem( type, klass.data() );
- entry.userdata = TQString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 5 );
+ entry.userdata = TQString( "%1%2%3%4%5" ).tqarg( CodeModelItem::Public ).tqarg( depth ).tqarg( tqparent ).tqarg( 5 );
entryList << entry;
}
}
@@ -4136,7 +4136,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList
if ( meth->isStatic() )
subSorting = 5;
- entry.userdata += TQString( "%1%2%3%4%5" ).arg( meth->access() ).arg( depth ).arg( className ).arg( 1 ).arg( subSorting );
+ entry.userdata += TQString( "%1%2%3%4%5" ).tqarg( meth->access() ).tqarg( depth ).tqarg( className ).tqarg( 1 ).tqarg( subSorting );
if ( m_completionMode == VirtualDeclCompletion )
entry.text += text + ";";
@@ -4187,7 +4187,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList
CodeCompletionEntry entry;
entry.text = attr->name();
entry.comment = commentFromItem( type, model_cast<ItemDom>( attr ) );
- entry.userdata += TQString( "%1%2%3%4" ).arg( attr->access() ).arg( depth ).arg( className ).arg( 2 );
+ entry.userdata += TQString( "%1%2%3%4" ).tqarg( attr->access() ).tqarg( depth ).tqarg( className ).tqarg( 2 );
if ( !attr->isEnumeratorVariable() ) {
@@ -4261,7 +4261,7 @@ EvaluationResult CppCodeCompletion::evaluateExpression( ExpressionInfo expr, Sim
}
}
- addStatusText( i18n( "Type of \"%1\" is \"%2\", %3" ).arg( expr.expr() ).arg( res->fullNameChain() ).arg( resolutionType ), 5000 );
+ addStatusText( i18n( "Type of \"%1\" is \"%2\", %3" ).tqarg( expr.expr() ).tqarg( res->fullNameChain() ).tqarg( resolutionType ), 5000 );
return res;
}
@@ -4386,7 +4386,7 @@ void CppCodeCompletion::jumpCursorContext( FunctionType f )
}
// Unresolved, maybe its a named enumeration?
else if ( type && type.trace() ) {
- TQValueList< QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = type.trace()->trace();
+ TQValueList< TQPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = type.trace()->trace();
if ( !trace.isEmpty() ) {
if ( trace.begin() != trace.end() ) {
d = ( *trace.begin() ).first.decl;
@@ -4417,7 +4417,7 @@ TQString CppCodeCompletion::createTypeInfoString( int line, int column )
if ( type->resolved() )
{
TQString scope = type->resolved()->scope().join("::");
- int pos = scope.findRev("::");
+ int pos = scope.tqfindRev("::");
if ( scope.isEmpty() || pos == -1 )
{
scope = "::";
@@ -4467,7 +4467,7 @@ bool CppCodeCompletion::getIncludeInfo( int line, TQString& includeFileName, TQS
//It is an include-directive. The regular expression captures the string, and the closing sign('"' or '>').
isIncludeDirective = true;
usedProjectFiles = false;
- TQStringList captured = includeRx.capturedTexts();
+ TQStringList captured = includeRx.tqcapturedTexts();
if( captured.size() == 3 ) {
Dependence d;
d.first = captured[1];