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.cpp774
1 files changed, 387 insertions, 387 deletions
diff --git a/languages/cpp/cppcodecompletion.cpp b/languages/cpp/cppcodecompletion.cpp
index 27cc9009..266c3878 100644
--- a/languages/cpp/cppcodecompletion.cpp
+++ b/languages/cpp/cppcodecompletion.cpp
@@ -37,7 +37,7 @@ email : david.nolden.kdevelop@art-master.de
#include <typeinfo>
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
#include <kapplication.h>
#include <kdebug.h>
@@ -49,15 +49,15 @@ email : david.nolden.kdevelop@art-master.de
#include <ktexteditor/document.h>
#include <kaction.h>
-#include <qdatastream.h>
-#include <qfile.h>
-#include <qmap.h>
-#include <qregexp.h>
-#include <qstatusbar.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qpair.h>
-#include <qvaluestack.h>
+#include <tqdatastream.h>
+#include <tqfile.h>
+#include <tqmap.h>
+#include <tqregexp.h>
+#include <tqstatusbar.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqpair.h>
+#include <tqvaluestack.h>
#include <kdevpartcontroller.h>
#include <kdevmainwindow.h>
@@ -99,14 +99,14 @@ const char* destructorPrefix = "<destructor>";
-- TODO: The documentation shown in the calltips looks very bad, a better solution must be found(maybe an additional tooltip)
*/
- void statusBarText( const QString& str, int time ) {
+ void statusBarText( const TQString& str, int time ) {
CppCodeCompletion* c = CppCodeCompletion::instance();
if( c )
c->addStatusText( str, time );
}
TypePointer CppCodeCompletion::createGlobalNamespace() {
- KSharedPtr<SimpleTypeCachedNamespace> n = new SimpleTypeCachedNamespace( QStringList(), QStringList() );
+ KSharedPtr<SimpleTypeCachedNamespace> n = new SimpleTypeCachedNamespace( TQStringList(), TQStringList() );
n->addAliases(m_pSupport->codeCompletionConfig()->namespaceAliases() );
return n.data();
}
@@ -133,16 +133,16 @@ SafetyCounter safetyCounter;
CppCodeCompletion* cppCompletionInstance = 0;
//file global functions, must be before any "using namespace"
-QString cleanForMenu( QString txt ) {
+TQString cleanForMenu( TQString txt ) {
return txt.replace( "&", "&&" ).replace( " ", " " );
}
-QString buildSignature( TypePointer currType ) {
+TQString buildSignature( TypePointer currType ) {
SimpleTypeFunctionInterface * f = currType->asFunction();
if ( !f )
return "";
- QString ret;
+ TQString ret;
LocateResult rtt = currType->locateDecType( f->getReturnType() );
if ( rtt->resolved() || rtt.resolutionCount() > 1 )
ret = rtt->fullNameChain();
@@ -153,7 +153,7 @@ QString buildSignature( TypePointer currType ) {
TypeDesc desc = currType->desc();
desc.decreaseFunctionDepth();
- QString sig = ret + " " + desc.fullNameChain() + f->signature();
+ TQString sig = ret + " " + desc.fullNameChain() + f->signature();
if ( f->isConst() )
sig += " const";
return sig;
@@ -164,10 +164,10 @@ PopupTracker* PopupTracker::pt = 0;
/** Multiple empty lines are reduced to one, too long lines wrapped over, and the beginnings of the lines are normalized
*/
-QStringList maximumLength( const QStringList& in, int length ) {
- QStringList ret;
+TQStringList maximumLength( const TQStringList& in, int length ) {
+ TQStringList ret;
uint firstNonSpace = 50000;
- for ( QStringList::const_iterator it = in.begin(); it != in.end(); ++it )
+ for ( TQStringList::const_iterator it = in.begin(); it != in.end(); ++it )
for ( uint a = 0; a < ( *it ).length(); a++ )
if ( !( *it ) [ a ].isSpace() ) {
if ( firstNonSpace > a )
@@ -175,17 +175,17 @@ QStringList maximumLength( const QStringList& in, int length ) {
break;
}
if ( firstNonSpace == 50000 )
- return QStringList();
+ return TQStringList();
bool hadEmptyLine = false;
- for ( QStringList::const_iterator it = in.begin(); it != in.end(); ++it ) {
+ for ( TQStringList::const_iterator it = in.begin(); it != in.end(); ++it ) {
if ( ( *it ).length() <= firstNonSpace ) {
if ( !hadEmptyLine )
ret << " ";
hadEmptyLine = true;
} else {
hadEmptyLine = false;
- QString str = ( *it ).mid( firstNonSpace );
+ TQString str = ( *it ).mid( firstNonSpace );
while ( !str.isEmpty() ) {
if ( (int)str.length() < length ) {
ret << str;
@@ -200,10 +200,10 @@ QStringList maximumLength( const QStringList& in, int length ) {
return ret;
}
-QStringList prepareTextForMenu( const QString& comment, int maxLines, int maxLength ) {
- QStringList in = QStringList::split( "\n", comment );
- QStringList out;
- for ( QStringList::iterator it = in.begin(); it != in.end(); ++it ) {
+TQStringList prepareTextForMenu( const TQString& comment, int maxLines, int maxLength ) {
+ TQStringList in = TQStringList::split( "\n", comment );
+ TQStringList out;
+ for ( TQStringList::iterator it = in.begin(); it != in.end(); ++it ) {
out << cleanForMenu( *it );
if ( (int)out.count() >= maxLines ) {
out << "[...]";
@@ -214,15 +214,15 @@ QStringList prepareTextForMenu( const QString& comment, int maxLines, int maxLen
return maximumLength( out, maxLength );
}
-QStringList formatComment( const QString& comment, int maxCols = 120 ) {
- QStringList ret;
+TQStringList formatComment( const TQString& comment, int maxCols = 120 ) {
+ TQStringList ret;
SafetyCounter s( 14 ); ///maximum of 14 lines
- QStringList lines = QStringList::split( "\n", comment );
- for ( QStringList::iterator it = lines.begin(); it != lines.end(); ++it ) {
- QStringList words = QStringList::split( " ", *it );
+ TQStringList lines = TQStringList::split( "\n", comment );
+ for ( TQStringList::iterator it = lines.begin(); it != lines.end(); ++it ) {
+ TQStringList words = TQStringList::split( " ", *it );
while ( !words.isEmpty() && s ) {
- QString line = "? ";
+ TQString line = "? ";
int len = 0;
while ( !words.isEmpty() && len < maxCols ) {
len += words.front().length();
@@ -243,14 +243,14 @@ bool operator < ( const CodeCompletionEntry& e1, const CodeCompletionEntry& e2 )
}
template <class ItemType>
-static QValueList<ItemType> unique( const QValueList<ItemType>& entryList ) {
+static TQValueList<ItemType> unique( const TQValueList<ItemType>& entryList ) {
- QValueList< ItemType > l;
- QMap<QString, bool> map;
- typename QValueList< ItemType >::ConstIterator it = entryList.begin();
+ TQValueList< ItemType > l;
+ TQMap<TQString, bool> map;
+ typename TQValueList< ItemType >::ConstIterator it = entryList.begin();
while ( it != entryList.end() ) {
CodeCompletionEntry e = *it++;
- QString key = ( e.type + " " +
+ TQString key = ( e.type + " " +
e.prefix + " " +
e.text + " " +
e.postfix + " " ).simplifyWhiteSpace().stripWhiteSpace();
@@ -262,13 +262,13 @@ static QValueList<ItemType> unique( const QValueList<ItemType>& entryList ) {
return l;
}
-static QStringList unique( const QStringList& entryList ) {
+static TQStringList unique( const TQStringList& entryList ) {
- QStringList l;
- QMap<QString, bool> map;
- QStringList::ConstIterator it = entryList.begin();
+ TQStringList l;
+ TQMap<TQString, bool> map;
+ TQStringList::ConstIterator it = entryList.begin();
while ( it != entryList.end() ) {
- QString e = *it++;
+ TQString e = *it++;
if ( map.find( e ) == map.end() ) {
map[ e ] = TRUE;
l << e;
@@ -277,14 +277,14 @@ static QStringList unique( const QStringList& entryList ) {
return l;
}
-static QStringList unique( const QValueList<QStringList>& entryList ) {
+static TQStringList unique( const TQValueList<TQStringList>& entryList ) {
- QStringList l;
- QMap<QString, bool> map;
- QValueList<QStringList>::ConstIterator it = entryList.begin();
+ TQStringList l;
+ TQMap<TQString, bool> map;
+ TQValueList<TQStringList>::ConstIterator it = entryList.begin();
while ( it != entryList.end() ) {
- QStringList li = ( *it++ );
- QString e = li.join( "\n" );
+ TQStringList li = ( *it++ );
+ TQString e = li.join( "\n" );
if ( map.find( e ) == map.end() ) {
map[ e ] = TRUE;
l += li;
@@ -295,7 +295,7 @@ static QStringList unique( const QValueList<QStringList>& entryList ) {
}
-bool tokenAt( const QString& text, const QString& token, int textPos ) {
+bool tokenAt( const TQString& text, const TQString& token, int textPos ) {
if ( text.isEmpty() )
return false;
@@ -311,7 +311,7 @@ bool tokenAt( const QString& text, const QString& token, int textPos ) {
if ( tokenPos == 0 || textPos == 0 ) {
if ( tokenPos == 0 ) {
if ( textPos >= 1 && text[ textPos ] == token[ tokenPos ] ) {
- QChar c = text[ textPos - 1 ];
+ TQChar c = text[ textPos - 1 ];
return c.isSpace() || c == '{' || c == '}' || c == ';';
} else {
return false;
@@ -346,26 +346,26 @@ struct PopupFillerHelpStruct {
return true;
}
- QMap<QString, QPopupMenu*> m_namespacePopupCache;
+ TQMap<TQString, TQPopupMenu*> m_namespacePopupCache;
- void insertItem( QPopupMenu* parent, SimpleTypeImpl::MemberInfo d , QString prefix ) {
+ void insertItem( TQPopupMenu* parent, SimpleTypeImpl::MemberInfo d , TQString prefix ) {
Q_UNUSED(prefix);
- QString memType = d.memberTypeToString();
+ TQString memType = d.memberTypeToString();
if ( d.memberType == SimpleTypeImpl::MemberInfo::Typedef && d.type->fullName() == "const int" )
memType = "enum";
- QString txt = i18n( "Jump to %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) );
- int id = parent->insertItem( txt, receiver, SLOT( popupAction( int ) ) );
+ TQString txt = i18n( "Jump to %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) );
+ int id = parent->insertItem( txt, receiver, TQT_SLOT( popupAction( int ) ) );
receiver->m_popupActions.insert( id, d.decl );
}
- void insertItem ( QPopupMenu* parent, TypeDesc d , QString prefix ) {
+ void insertItem ( TQPopupMenu* parent, TypeDesc d , TQString prefix ) {
Debug dbg( "#insert# ", 10 );
- QString txt1, txt2;
+ TQString txt1, txt2;
if ( d.resolved() && d.resolved() ->isNamespace() ) {
SimpleTypeCachedNamespace * ns = dynamic_cast<SimpleTypeCachedNamespace*>( d.resolved().data() );
@@ -374,9 +374,9 @@ 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() ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
- QString scope = cm->scope().join("::");
- QMap< QString, QPopupMenu* >::iterator it = m_namespacePopupCache.find( scope );
+ TQPopupMenu * m = PopupTracker::createPopup( parent );
+ TQString scope = cm->scope().join("::");
+ TQMap< TQString, TQPopupMenu* >::iterator it = m_namespacePopupCache.find( scope );
if( it != m_namespacePopupCache.end() ) {
parent->insertItem( "Imported Namespace " + scope, *it );
delete m;
@@ -402,13 +402,13 @@ struct PopupFillerHelpStruct {
if ( SimpleTypeCachedCodeModel * item = dynamic_cast<SimpleTypeCachedCodeModel*>( d.resolved().data() ) ) { ///(1)
if ( item->item() && item->item() ->isNamespace() ) {
NamespaceModel* ns = dynamic_cast<NamespaceModel*>( item->item().data() );
- QStringList wholeScope = ns->scope();
+ TQStringList wholeScope = ns->scope();
wholeScope << ns->name();
for( FileList::iterator it = files.begin(); it != files.end(); ++it ) {
// if( !safetyCounter ) break;
NamespaceModel* ns = (*it).data();
- for( QStringList::iterator it2 = wholeScope.begin(); it2 != wholeScope.end(); ++it2 ) {
+ for( TQStringList::iterator it2 = wholeScope.begin(); it2 != wholeScope.end(); ++it2 ) {
if( ns->hasNamespace( (*it2) ) ) {
ns = ns->namespaceByName( *it2 );
if( !ns ) break;
@@ -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() + QString(" (%1 Lines): ").arg( eLine - sLine ) ); ///SimpleTypeCodeModel is used instead of SimpleTypeCachedNodeModel, so the detection at (1) does not trigger, this avoids endless recursion.
+ 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.
}
}
@@ -447,19 +447,19 @@ struct PopupFillerHelpStruct {
}
}
- int id = parent->insertItem( txt1, receiver, SLOT( popupAction( int ) ) );
+ int id = parent->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, SLOT( popupDefinitionAction( int ) ) );
+ int id2 = parent->insertItem( txt2, receiver, TQT_SLOT( popupDefinitionAction( int ) ) );
if ( d.resolved() )
receiver->m_popupDefinitionActions.insert( id2, d.resolved() ->getDeclarationInfo() );
}
}
};
-ItemDom itemFromScope( const QStringList& scope, NamespaceDom startNamespace ) {
+ItemDom itemFromScope( const TQStringList& scope, NamespaceDom startNamespace ) {
if ( scope.isEmpty() )
return ItemDom();
@@ -469,7 +469,7 @@ ItemDom itemFromScope( const QStringList& scope, NamespaceDom startNamespace ) {
ClassModel* curr = glob ;
- QStringList::const_iterator mit = scope.begin();
+ TQStringList::const_iterator mit = scope.begin();
while ( curr->isNamespace() && mit != scope.end() && ( ( NamespaceModel* ) curr ) ->hasNamespace( *mit ) ) {
curr = &( *( ( ( NamespaceModel* ) curr ) ->namespaceByName( *mit ) ) );
@@ -523,29 +523,29 @@ struct PopupClassViewFillerHelpStruct {
return false;
}
- void insertItem( QPopupMenu* parent, SimpleTypeImpl::MemberInfo d , QString prefix ) {
+ void insertItem( TQPopupMenu* parent, SimpleTypeImpl::MemberInfo d , TQString prefix ) {
Q_UNUSED(prefix);
FileDom f = receiver->m_pSupport->codeModel() ->fileByName( d.decl.file );
if ( !f )
return ;
- ItemDom dom = itemFromScope( QStringList::split( "::", d.name ), model_cast<NamespaceDom>( f ) );
+ ItemDom dom = itemFromScope( TQStringList::split( "::", d.name ), model_cast<NamespaceDom>( f ) );
- QString memType = d.memberTypeToString();
+ TQString memType = d.memberTypeToString();
if ( d.memberType == SimpleTypeImpl::MemberInfo::Typedef && d.type->fullName() == "const int" )
memType = "enum";
- QString txt = i18n( "Show %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) );
- int id = parent->insertItem( txt, receiver, SLOT( popupClassViewAction( int ) ) );
+ TQString txt = i18n( "Show %1 %2" ).arg( memType ).arg( cleanForMenu( d.name ) );
+ int id = parent->insertItem( txt, receiver, TQT_SLOT( popupClassViewAction( int ) ) );
receiver->m_popupClassViewActions.insert( id, dom );
}
- void insertItem ( QPopupMenu* parent, TypeDesc d , QString prefix ) {
+ void insertItem ( TQPopupMenu* parent, TypeDesc d , TQString prefix ) {
Debug dbg( "#insert# ", 10 );
- QString txt;
+ TQString txt;
if ( !d.resolved() )
return ;
@@ -578,8 +578,8 @@ struct PopupClassViewFillerHelpStruct {
}
} else {
if ( dom ) {
- QString n = d.resolved() ->scope().join( "::" );
- //QString n = d.fullNameChain();
+ TQString n = d.resolved() ->scope().join( "::" );
+ //TQString n = d.fullNameChain();
if ( d.resolved() ->asFunction() ) {
n = buildSignature( d.resolved() );
}
@@ -596,7 +596,7 @@ struct PopupClassViewFillerHelpStruct {
}
}
- int id = parent->insertItem( txt, receiver, SLOT( popupClassViewAction( int ) ) );
+ int id = parent->insertItem( txt, receiver, TQT_SLOT( popupClassViewAction( int ) ) );
if ( dom )
receiver->m_popupClassViewActions.insert( id, dom );
@@ -606,27 +606,27 @@ struct PopupClassViewFillerHelpStruct {
template <class HelpStruct = PopupFillerHelpStruct>
class PopupFiller {
HelpStruct struk;
- QString depthAdd;
+ TQString depthAdd;
SafetyCounter s;
public:
- PopupFiller( HelpStruct str , QString dAdd, int maxCount = 100 ) : struk( str ), depthAdd( dAdd ), s( maxCount ) {}
+ PopupFiller( HelpStruct str , TQString dAdd, int maxCount = 100 ) : struk( str ), depthAdd( dAdd ), s( maxCount ) {}
- void fillIncludes( const DeclarationInfo& decl, QPopupMenu* parent, bool& needSeparator ) {
+ void fillIncludes( const DeclarationInfo& decl, TQPopupMenu* parent, bool& needSeparator ) {
if( !struk.receiver->getIncludeFiles()[ HashedString( decl.file ) ] ) {
- QString file = decl.file;
+ TQString file = decl.file;
//The include-file seems to be missing
if( needSeparator ) {
needSeparator = false;
parent->insertSeparator();
}
- QString includeFile = file;
- QFileInfo info( file );
+ TQString includeFile = file;
+ TQFileInfo info( file );
Driver* driver = struk.receiver->cppSupport()->driver();
if( driver ) {
- QStringList elements = QStringList::split( "/", file );
+ TQStringList elements = TQStringList::split( "/", file );
includeFile = elements.back();
elements.pop_back();
@@ -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, SLOT( popupAction( int ) ) );
+ int id = parent->insertItem( i18n( "#include \"%1\" ( defines %2 )" ).arg ( includeFile ).arg( 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( QPopupMenu * parent, LocateResult d, QString prefix = "", const DeclarationInfo & sourceVariable = DeclarationInfo() ) {
+ void fill( TQPopupMenu * parent, LocateResult d, TQString prefix = "", const DeclarationInfo & sourceVariable = DeclarationInfo() ) {
Debug dbg( "#fl# ", 10 )
;
@@ -670,7 +670,7 @@ 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, SLOT( popupAction( int ) ) );
+ /*int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").arg( type.sourceVariable.name ) , this, TQT_SLOT( popupAction( int ) ) );
m_popupActions.insert( id, type.sourceVariable );*/
struk.insertItem( parent, f, prefix );
@@ -678,11 +678,11 @@ class PopupFiller {
parent->insertSeparator();
if ( !sourceVariable.comment.isEmpty() ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ TQPopupMenu * m = PopupTracker::createPopup( parent );
parent->insertItem( i18n( "Comment on %1" ).arg( sourceVariable.name ), m );
- QStringList ls = prepareTextForMenu( sourceVariable.comment, 15, 100 );
- for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
- m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) );
+ 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();
}
@@ -694,7 +694,7 @@ class PopupFiller {
SimpleType p = d->resolved()->parent();
LocateResult r = p->locateDecType( d->name() );
if( r ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ TQPopupMenu * m = PopupTracker::createPopup( parent );
parent->insertItem( i18n( "Specialized from \"%1\"" ).arg( cleanForMenu( r->fullNameChain() ) ), m );
fill( m, r );
}
@@ -703,7 +703,7 @@ class PopupFiller {
TypeDesc::TemplateParams p = d->templateParams();
for ( TypeDesc::TemplateParams::iterator it = p.begin(); it != p.end(); ++it ) {
//if( (*it)->resolved() ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ TQPopupMenu * m = PopupTracker::createPopup( parent );
parent->insertItem( i18n( "Template-param \"%1\"" ).arg( cleanForMenu( ( *it ) ->fullNameChain() ) ), m );
fill( m, **it );
/*} else {
@@ -715,25 +715,25 @@ class PopupFiller {
if ( d->resolved() ->asFunction() ) {
LocateResult rt = d->resolved() ->locateDecType( d->resolved() ->asFunction() ->getReturnType() );
if ( rt ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ TQPopupMenu * m = PopupTracker::createPopup( parent );
parent->insertItem( i18n( "Return-type \"%1\"" ).arg( cleanForMenu( rt->fullNameChain() ) ), m );
fill( m, rt );
}
- QValueList<TypeDesc> args = d->resolved() ->asFunction() ->getArgumentTypes();
- QStringList argNames = d->resolved() ->asFunction() ->getArgumentNames();
+ TQValueList<TypeDesc> args = d->resolved() ->asFunction() ->getArgumentTypes();
+ TQStringList argNames = d->resolved() ->asFunction() ->getArgumentNames();
if ( !args.isEmpty() ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ TQPopupMenu * m = PopupTracker::createPopup( parent );
parent->insertItem( i18n( "Argument-types" ), m );
- QStringList::iterator it2 = argNames.begin();
- for ( QValueList<TypeDesc>::iterator it = args.begin(); it != args.end(); ++it ) {
+ TQStringList::iterator it2 = argNames.begin();
+ for ( TQValueList<TypeDesc>::iterator it = args.begin(); it != args.end(); ++it ) {
LocateResult at = d->resolved() ->locateDecType( *it );
- QString name = "";
+ TQString name = "";
if ( it2 != argNames.end() ) {
name = *it2;
++it2;
}
- QPopupMenu * mo = PopupTracker::createPopup( m );
+ TQPopupMenu * mo = PopupTracker::createPopup( m );
m->insertItem( i18n( "Argument \"%1\"" ).arg( cleanForMenu( at->fullNameChain() + " " + name ) ), mo );
fill( mo, at );
@@ -743,14 +743,14 @@ class PopupFiller {
}
#ifndef DISABLE_TRACING
if ( d.trace() ) {
- QValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
+ TQValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
if ( !trace.isEmpty() ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ TQPopupMenu * m = PopupTracker::createPopup( parent );
parent->insertItem( i18n( "Trace" ), m );
- for ( QValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> >::iterator it = trace.begin(); it != trace.end(); ++it ) {
- QPopupMenu * mo = PopupTracker::createPopup( m );
- QString tail = ( *it ).second.fullNameChain();
+ for ( TQValueList<QPair<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 );
@@ -759,16 +759,16 @@ class PopupFiller {
if ( !( *it ).first.decl.comment.isEmpty() ) {
mo->insertSeparator();
- QPopupMenu * m = PopupTracker::createPopup( mo );
+ TQPopupMenu * m = PopupTracker::createPopup( mo );
mo->insertItem( i18n( "Comment" ), m );
- QStringList ls = prepareTextForMenu( ( *it ).first.decl.comment, 15, 100 );
- for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
- m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) );
+ TQStringList ls = prepareTextForMenu( ( *it ).first.decl.comment, 15, 100 );
+ for ( TQStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
+ m->insertItem( *it, 0, TQT_SLOT( popupClassViewAction( int ) ) );
}
}
/*bool needSeparator = true;
- if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() && !(*it).first.decl.file.operator QString().isEmpty() )
+ if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() && !(*it).first.decl.file.operator TQString().isEmpty() )
fillIncludes( (*it).first.decl, mo, needSeparator );*/
}
}
@@ -776,26 +776,26 @@ class PopupFiller {
#endif
if ( d->resolved() ) {
- QValueList<LocateResult> bases = d->resolved() ->getBases();
- for ( QValueList<LocateResult>::iterator it = bases.begin(); it != bases.end(); ++it ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ 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 );
fill( m, *it );
}
if ( d->resolved() ->parent() && d->resolved() ->parent() ->desc() ) {
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ 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() ->comment().isEmpty() ) {
parent->insertSeparator();
- QPopupMenu * m = PopupTracker::createPopup( parent );
+ TQPopupMenu * m = PopupTracker::createPopup( parent );
parent->insertItem( i18n( "Comment on %1" ).arg( cleanForMenu( d->name() ) ), m );
- QStringList ls = prepareTextForMenu( d->resolved() ->comment(), 15, 100 );
- for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
- m->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) );
+ 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,10 +805,10 @@ 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() ) {
- QValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
+ TQValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = d.trace() ->trace();
if ( !trace.isEmpty() ) {
- for ( QValueList<QPair<SimpleTypeImpl::MemberInfo, TypeDesc> >::iterator it = trace.begin(); it != trace.end(); ++it ) {
- if( struk.shouldShowIncludeMenu() && struk.receiver->cppSupport()->codeCompletionConfig()->preProcessAllHeaders() && !(*it).first.decl.file.operator QString().isEmpty() )
+ for ( TQValueList<QPair<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 );
}
}
@@ -828,11 +828,11 @@ struct CompTypeProcessor : public TypeProcessor {
CompTypeProcessor( SimpleType scope, bool processArguments ) : m_scope( scope ), m_processArguments( processArguments ) {}
- virtual QString parentType() {
+ virtual TQString parentType() {
return m_scope->fullType();
}
- virtual QString processType( const QString& type ) {
+ virtual TQString processType( const TQString& type ) {
if ( !m_processArguments )
return type;
LocateResult t = m_scope->locateDecType( type );
@@ -844,8 +844,8 @@ struct CompTypeProcessor : public TypeProcessor {
};
struct CppCodeCompletionData {
- QPtrList<RecoveryPoint> recoveryPoints;
- //QStringList classNameList;
+ TQPtrList<RecoveryPoint> recoveryPoints;
+ //TQStringList classNameList;
CppCodeCompletionData() {
recoveryPoints.setAutoDelete( true );
@@ -857,7 +857,7 @@ struct CppCodeCompletionData {
QPair<int, int> pt = qMakePair( line, column );
- QPtrListIterator<RecoveryPoint> it( recoveryPoints );
+ TQPtrListIterator<RecoveryPoint> it( recoveryPoints );
RecoveryPoint* recPt = 0;
while ( it.current() ) {
@@ -895,29 +895,29 @@ m_codeCompleteCh2Rx( "(->)|(\\:\\:)" ) {
m_pSupport = part;
- connect( m_pSupport->codeCompletionConfig(), SIGNAL( stored() ), this, SLOT( emptyCache() ) );
+ connect( m_pSupport->codeCompletionConfig(), TQT_SIGNAL( stored() ), this, TQT_SLOT( emptyCache() ) );
m_activeCursor = 0;
m_activeEditor = 0;
m_activeCompletion = 0;
m_activeHintInterface = 0;
m_activeView = 0;
- m_ccTimer = new QTimer( this );
- m_showStatusTextTimer = new QTimer( this );
+ m_ccTimer = new TQTimer( this );
+ m_showStatusTextTimer = new TQTimer( this );
m_ccLine = 0;
m_ccColumn = 0;
- connect( m_ccTimer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) );
- connect( m_showStatusTextTimer, SIGNAL( timeout() ), this, SLOT( slotStatusTextTimeout() ) );
+ connect( m_ccTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTimeout() ) );
+ connect( m_showStatusTextTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotStatusTextTimeout() ) );
computeFileEntryList();
CppSupportPart* cppSupport = m_pSupport;
- connect( cppSupport->project(), SIGNAL( addedFilesToProject( const QStringList& ) ),
- this, SLOT( computeFileEntryList() ) );
- connect( cppSupport->project(), SIGNAL( removedFilesFromProject( const QStringList& ) ),
- this, SLOT( computeFileEntryList() ) );
- connect( cppSupport, SIGNAL( synchronousParseReady( const QString&, ParsedFilePointer ) ), this, SLOT( synchronousParseReady( const QString&, ParsedFilePointer ) ) );
+ connect( cppSupport->project(), TQT_SIGNAL( addedFilesToProject( const TQStringList& ) ),
+ this, TQT_SLOT( computeFileEntryList() ) );
+ connect( cppSupport->project(), TQT_SIGNAL( removedFilesFromProject( const TQStringList& ) ),
+ this, TQT_SLOT( computeFileEntryList() ) );
+ connect( cppSupport, TQT_SIGNAL( synchronousParseReady( const TQString&, ParsedFilePointer ) ), this, TQT_SLOT( synchronousParseReady( const TQString&, ParsedFilePointer ) ) );
m_bArgHintShow = false;
m_bCompletionBoxShow = false;
@@ -927,14 +927,14 @@ m_codeCompleteCh2Rx( "(->)|(\\:\\:)" ) {
m_repository = new CodeInformationRepository( cppSupport->codeRepository() );
- connect( cppSupport->codeRepository(), SIGNAL(catalogRegistered( Catalog* )), this, SLOT( emptyCache() ) );
- connect( cppSupport->codeRepository(), SIGNAL(catalogUnregistered( Catalog* )), this, SLOT( emptyCache() ) );
- connect( cppSupport->codeRepository(), SIGNAL(catalogChanged( Catalog* )), this, SLOT( emptyCache() ) );
+ connect( cppSupport->codeRepository(), TQT_SIGNAL(catalogRegistered( Catalog* )), this, TQT_SLOT( emptyCache() ) );
+ connect( cppSupport->codeRepository(), TQT_SIGNAL(catalogUnregistered( Catalog* )), this, TQT_SLOT( emptyCache() ) );
+ connect( cppSupport->codeRepository(), TQT_SIGNAL(catalogChanged( Catalog* )), this, TQT_SLOT( emptyCache() ) );
setupCodeInformationRepository();
if ( part->partController() ->parts() ) {
- QPtrListIterator<KParts::Part> it( *part->partController() ->parts() );
+ TQPtrListIterator<KParts::Part> it( *part->partController() ->parts() );
while ( KParts::Part * part = it.current() ) {
integratePart( part );
++it;
@@ -944,22 +944,22 @@ m_codeCompleteCh2Rx( "(->)|(\\:\\:)" ) {
if ( part->partController() ->activePart() )
slotActivePartChanged( part->partController() ->activePart() );
- connect( part->partController( ), SIGNAL( partAdded( KParts::Part* ) ),
- this, SLOT( slotPartAdded( KParts::Part* ) ) );
- connect( part->partController( ), SIGNAL( activePartChanged( KParts::Part* ) ),
- this, SLOT( slotActivePartChanged( KParts::Part* ) ) );
+ connect( part->partController( ), TQT_SIGNAL( partAdded( KParts::Part* ) ),
+ this, TQT_SLOT( slotPartAdded( KParts::Part* ) ) );
+ connect( part->partController( ), TQT_SIGNAL( activePartChanged( KParts::Part* ) ),
+ this, TQT_SLOT( slotActivePartChanged( KParts::Part* ) ) );
- connect( part, SIGNAL( fileParsed( const QString& ) ),
- this, SLOT( slotFileParsed( const QString& ) ) );
- connect( part, SIGNAL( codeModelUpdated( const QString& ) ),
- this, SLOT( slotCodeModelUpdated( const QString& ) ) );
+ connect( part, TQT_SIGNAL( fileParsed( const TQString& ) ),
+ this, TQT_SLOT( slotFileParsed( const TQString& ) ) );
+ connect( part, TQT_SIGNAL( codeModelUpdated( const TQString& ) ),
+ this, TQT_SLOT( slotCodeModelUpdated( const TQString& ) ) );
KAction * action = new KAction( i18n("Jump to declaration under cursor"), 0, CTRL + Key_Comma,
- this, SLOT(slotJumpToDeclCursorContext()), part->actionCollection(), "jump_to_declaration_cursor_context" );
+ this, TQT_SLOT(slotJumpToDeclCursorContext()), part->actionCollection(), "jump_to_declaration_cursor_context" );
action->plug( &m_DummyActionWidget );
action = new KAction( i18n("Jump to definition under cursor"), 0, CTRL + Key_Period,
- this, SLOT(slotJumpToDefCursorContext()), part->actionCollection(), "jump_to_defintion_cursor_context" );
+ this, TQT_SLOT(slotJumpToDefCursorContext()), part->actionCollection(), "jump_to_defintion_cursor_context" );
action->plug( &m_DummyActionWidget );
}
@@ -968,8 +968,8 @@ CppCodeCompletion::~CppCodeCompletion( ) {
delete d;
}
-void CppCodeCompletion::addStatusText( QString text, int timeout ) {
- m_statusTextList.append( QPair<int, QString>( timeout, text ) );
+void CppCodeCompletion::addStatusText( TQString text, int timeout ) {
+ m_statusTextList.append( QPair<int, TQString>( timeout, text ) );
if ( !m_showStatusTextTimer->isActive() ) {
slotStatusTextTimeout();
}
@@ -998,8 +998,8 @@ void CppCodeCompletion::slotTimeout() {
if ( nLine != m_ccLine || nCol != m_ccColumn )
return ;
- QString textLine = m_activeEditor->textLine( nLine );
- QChar ch = textLine[ nCol ];
+ TQString textLine = m_activeEditor->textLine( nLine );
+ TQChar ch = textLine[ nCol ];
if ( ch.isLetterOrNumber() || ch == '_' )
return ;
@@ -1027,13 +1027,13 @@ void CppCodeCompletion::integratePart( KParts::Part * part ) {
if ( m_pSupport ) { //The slot should connected even when automatic completion is disabled, so it can be enabled any time
kdDebug( 9007 ) << k_funcinfo << "enabling code completion" << endl;
- connect( part, SIGNAL( textChanged() ), this, SLOT( slotTextChanged() ) );
- connect( part->widget(), SIGNAL( completionDone() ), this,
- SLOT( slotCompletionBoxHidden() ) );
- connect( part->widget(), SIGNAL( completionAborted() ), this,
- SLOT( slotCompletionBoxHidden() ) );
- connect( part->widget(), SIGNAL( argHintHidden() ), this,
- SLOT( slotArgHintHidden() ) );
+ connect( part, TQT_SIGNAL( textChanged() ), this, TQT_SLOT( slotTextChanged() ) );
+ connect( part->widget(), TQT_SIGNAL( completionDone() ), this,
+ TQT_SLOT( slotCompletionBoxHidden() ) );
+ connect( part->widget(), TQT_SIGNAL( completionAborted() ), this,
+ TQT_SLOT( slotCompletionBoxHidden() ) );
+ connect( part->widget(), TQT_SIGNAL( argHintHidden() ), this,
+ TQT_SLOT( slotArgHintHidden() ) );
}
}
}
@@ -1046,7 +1046,7 @@ void CppCodeCompletion::slotActivePartChanged( KParts::Part * part ) {
emptyCache();
this->d->recoveryPoints.clear();
if ( m_activeHintInterface && m_activeView ) {
- disconnect( m_activeView , SIGNAL( needTextHint( int, int, QString & ) ), this, SLOT( slotTextHint( int, int, QString& ) ) );
+ disconnect( m_activeView , TQT_SIGNAL( needTextHint( int, int, TQString & ) ), this, TQT_SLOT( slotTextHint( int, int, TQString& ) ) );
m_activeHintInterface = 0;
}
@@ -1055,7 +1055,7 @@ void CppCodeCompletion::slotActivePartChanged( KParts::Part * part ) {
kdDebug( 9007 ) << k_funcinfo << endl;
- m_activeFileName = QString::null;
+ m_activeFileName = TQString::null;
KTextEditor::Document* doc = dynamic_cast<KTextEditor::Document*>( part );
if ( !doc )
@@ -1093,7 +1093,7 @@ void CppCodeCompletion::slotActivePartChanged( KParts::Part * part ) {
if ( m_activeHintInterface ) {
#ifndef DISABLETOOLTIPS
m_activeHintInterface->enableTextHints( 500 );
- connect( m_activeView, SIGNAL( needTextHint( int, int, QString & ) ), this, SLOT( slotTextHint( int, int, QString& ) ) );
+ connect( m_activeView, TQT_SIGNAL( needTextHint( int, int, TQString & ) ), this, TQT_SLOT( slotTextHint( int, int, TQString& ) ) );
#endif
} else {
@@ -1112,9 +1112,9 @@ void CppCodeCompletion::slotTextChanged() {
unsigned int nLine, nCol;
m_activeCursor->cursorPositionReal( &nLine, &nCol );
- QString strCurLine = m_activeEditor->textLine( nLine );
- QString ch = strCurLine.mid( nCol - 1, 1 );
- QString ch2 = strCurLine.mid( nCol - 2, 2 );
+ TQString strCurLine = m_activeEditor->textLine( nLine );
+ TQString ch = strCurLine.mid( nCol - 1, 1 );
+ TQString ch2 = strCurLine.mid( nCol - 2, 2 );
// Tell the completion box to _go_away_ when the completion char
// becomes empty or whitespace and the box is already showing.
@@ -1123,7 +1123,7 @@ void CppCodeCompletion::slotTextChanged() {
if ( ch.simplifyWhiteSpace().isEmpty() &&
!strCurLine.simplifyWhiteSpace().contains( "virtual" ) &&
m_bCompletionBoxShow ) {
- QValueList<KTextEditor::CompletionEntry> entryList;
+ TQValueList<KTextEditor::CompletionEntry> entryList;
m_bCompletionBoxShow = true;
m_activeCompletion->showCompletionBox( entryList, 0 );
}
@@ -1227,14 +1227,14 @@ void CppCodeCompletion::fitContextItem( int nLine, int nCol ) {
enum { T_ACCESS, T_PAREN, T_BRACKET, T_IDE, T_UNKNOWN, T_TEMP };
-QString CppCodeCompletion::replaceCppComments( const QString& contents ) {
- QString text = contents;
+TQString CppCodeCompletion::replaceCppComments( const TQString& contents ) {
+ TQString text = contents;
int pos = 0;
while ( ( pos = m_cppCodeCommentsRx.search( text, pos ) ) != -1 ) {
if ( m_cppCodeCommentsRx.cap( 1 ).startsWith( "//" ) ) {
- QString before = m_cppCodeCommentsRx.cap( 1 );
- QString after;
+ TQString before = m_cppCodeCommentsRx.cap( 1 );
+ TQString after;
after.fill( ' ', before.length() - 5 );
after.prepend( "/*" );
after.append( "*/" );
@@ -1247,14 +1247,14 @@ QString CppCodeCompletion::replaceCppComments( const QString& contents ) {
return text;
}
-int CppCodeCompletion::expressionAt( const QString& contents, int index ) {
+int CppCodeCompletion::expressionAt( const TQString& contents, int index ) {
kdDebug( 9007 ) << k_funcinfo << endl;
/* C++ style comments present issues with finding the expr so I'm
matching for them and replacing them with empty C style comments
of the same length for purposes of finding the expr. */
- QString text = clearComments( contents );
+ TQString text = clearComments( contents );
int last = T_UNKNOWN;
int start = index;
@@ -1265,8 +1265,8 @@ int CppCodeCompletion::expressionAt( const QString& contents, int index ) {
--index;
}
- QChar ch = text[ index ];
- QString ch2 = text.mid( index - 1, 2 );
+ TQChar ch = text[ index ];
+ TQString ch2 = text.mid( index - 1, 2 );
if ( ( last != T_IDE ) && ( ch.isLetterOrNumber() || ch == '_' ) ) {
while ( index > 0 && ( text[ index ].isLetterOrNumber() || text[ index ] == '_' ) ) {
--index;
@@ -1275,7 +1275,7 @@ int CppCodeCompletion::expressionAt( const QString& contents, int index ) {
} else if ( last != T_IDE && ch == ')' ) {
int count = 0;
while ( index > 0 ) {
- QChar ch = text[ index ];
+ TQChar ch = text[ index ];
if ( ch == '(' ) {
++count;
} else if ( ch == ')' ) {
@@ -1290,7 +1290,7 @@ int CppCodeCompletion::expressionAt( const QString& contents, int index ) {
} else if ( last != T_IDE && ch == '>' && ch2 != "->" ) {
int count = 0;
while ( index > 0 ) {
- QChar ch = text[ index ];
+ TQChar ch = text[ index ];
if ( ch == '<' ) {
++count;
} else if ( ch == '>' ) {
@@ -1305,7 +1305,7 @@ int CppCodeCompletion::expressionAt( const QString& contents, int index ) {
} else if ( ch == ']' ) {
int count = 0;
while ( index > 0 ) {
- QChar ch = text[ index ];
+ TQChar ch = text[ index ];
if ( ch == '[' ) {
++count;
} else if ( ch == ']' ) {
@@ -1344,16 +1344,16 @@ int CppCodeCompletion::expressionAt( const QString& contents, int index ) {
return index;
}
-QStringList CppCodeCompletion::splitExpression( const QString& text ) {
+TQStringList CppCodeCompletion::splitExpression( const TQString& text ) {
#define ADD_CURRENT()\
if( current.length() ) { l << current; /*kdDebug(9007) << "add word " << current << endl;*/ current = ""; }
- QStringList l;
+ TQStringList l;
uint index = 0;
- QString current;
+ TQString current;
while ( index < text.length() ) {
- QChar ch = text[ index ];
- QString ch2 = text.mid( index, 2 );
+ TQChar ch = text[ index ];
+ TQString ch2 = text.mid( index, 2 );
if ( ch == '.' ) {
current += ch;
@@ -1362,7 +1362,7 @@ QStringList CppCodeCompletion::splitExpression( const QString& text ) {
} else if ( ch == '(' ) {
int count = 0;
while ( index < text.length() ) {
- QChar ch = text[ index ];
+ TQChar ch = text[ index ];
if ( ch == '(' ) {
++count;
} else if ( ch == ')' ) {
@@ -1376,7 +1376,7 @@ QStringList CppCodeCompletion::splitExpression( const QString& text ) {
} else if ( ch == '[' ) {
int count = 0;
while ( index < text.length() ) {
- QChar ch = text[ index ];
+ TQChar ch = text[ index ];
if ( ch == '[' ) {
++count;
} else if ( ch == ']' ) {
@@ -1418,7 +1418,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionAt( int line, int column ,
return EvaluationResult();
{
- QString curLine = m_activeEditor->textLine( line );
+ TQString curLine = m_activeEditor->textLine( line );
///move column to the last letter of the pointed word
while ( column + 1 < ( int ) curLine.length() && isValidIdentifierSign( curLine[ column ] ) && isValidIdentifierSign( curLine[ column + 1 ] ) )
@@ -1429,7 +1429,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionAt( int line, int column ,
if ( column >= ( int ) curLine.length() || curLine[ column ].isSpace() )
return EvaluationResult();
- QString expr = curLine.left( column + 1 );
+ TQString expr = curLine.left( column + 1 );
kdDebug( 9007 ) << "evaluating line \"" << expr.stripWhiteSpace() << "\"" << endl;
if ( curLine[ column ] == '-' || curLine[ column ] == ';' )
@@ -1446,10 +1446,10 @@ EvaluationResult CppCodeCompletion::evaluateExpressionAt( int line, int column ,
void CppCodeCompletion::popupAction( int number ) {
PopupActions::iterator it = m_popupActions.find( number );
if ( it != m_popupActions.end() ) {
- QString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator QString();
+ 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, QString("#include \"%1\" /* defines %2 */").arg( fileName ).arg( (*it).name ) );
+ m_activeEditor->insertLine( 0, TQString("#include \"%1\" /* defines %2 */").arg( fileName ).arg( (*it).name ) );
} else {
m_pSupport->partController() ->editDocument( fileName, ( *it ).startLine );
}
@@ -1461,7 +1461,7 @@ void CppCodeCompletion::popupAction( int number ) {
void CppCodeCompletion::popupDefinitionAction( int number ) {
PopupActions::iterator it = m_popupDefinitionActions.find( number );
if ( it != m_popupDefinitionActions.end() ) {
- QString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator QString();
+ TQString fileName = ( *it ).file == "current_file" ? m_activeFileName : ( *it ).file.operator TQString();
if ( !m_pSupport->switchHeaderImpl( fileName, ( *it ).startLine, ( *it ).startCol ) )
m_pSupport->partController() ->editDocument( fileName, ( *it ).startLine );
} else {
@@ -1490,7 +1490,7 @@ void CppCodeCompletion::popupClassViewAction( int number ) {
}
}
-void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Context *context, int line, int column ) {
+void CppCodeCompletion::contextEvaluationMenus ( TQPopupMenu *popup, const Context *context, int line, int column ) {
clearStatusText();
Q_UNUSED(context);
if ( !m_pSupport->codeCompletionConfig() ->showEvaluationContextMenu() )
@@ -1529,15 +1529,15 @@ void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Contex
///Test if it is a macro
if( type.isMacro ) {
- QPopupMenu * m = PopupTracker::createPopup( popup );
+ 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++ );
else
gid = popup->insertItem( i18n( "Navigate by Macro \"%1\"" ).arg( cleanForMenu( type.macro.name() ) ), m );
- int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( type.macro.name() ) ), this, SLOT( popupAction( int ) ) );
- QPopupMenu * b = PopupTracker::createPopup( m );
+ int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( type.macro.name() ) ), this, TQT_SLOT( popupAction( int ) ) );
+ TQPopupMenu * b = PopupTracker::createPopup( m );
m->insertItem( i18n( "Body" ), b );
DeclarationInfo i;
@@ -1548,27 +1548,27 @@ void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Contex
i.endLine = type.macro.line();
m_popupActions.insert( id, i );
- QStringList ls = prepareTextForMenu( type.macro.body(), 20, 100 );
- for ( QStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
- b->insertItem( *it, 0, SLOT( popupClassViewAction( int ) ) );
+ TQStringList ls = prepareTextForMenu( type.macro.body(), 20, 100 );
+ for ( TQStringList::iterator it = ls.begin(); it != ls.end(); ++it ) {
+ b->insertItem( *it, 0, TQT_SLOT( popupClassViewAction( int ) ) );
}
}
///Test if it is an include-directive
- QString includeFileName, includeFilePath;
+ TQString includeFileName, includeFilePath;
bool simpleAlgorithm = false;
bool isIncludeDirective = getIncludeInfo( line, includeFileName, includeFilePath, simpleAlgorithm );
if( isIncludeDirective ) {
///Add menu entry
if( !includeFilePath.isEmpty() ) {
int gid;
- QPopupMenu * m = PopupTracker::createPopup( popup );
+ TQPopupMenu * m = PopupTracker::createPopup( popup );
if ( contextMenuEntriesAtTop )
gid = popup->insertItem( i18n( "Goto Include File: %1" ).arg( cleanForMenu( includeFileName ) ), m, 5, cpos++ );
else
gid = popup->insertItem( i18n( "Goto Include File: %1" ).arg( cleanForMenu( includeFileName ) ), m );
- int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( includeFilePath ) ), this, SLOT( popupAction( int ) ) );
+ int id = m->insertItem( i18n( "Jump to %1" ).arg( cleanForMenu( includeFilePath ) ), this, TQT_SLOT( popupAction( int ) ) );
DeclarationInfo i;
i.file = includeFilePath;
@@ -1595,7 +1595,7 @@ void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Contex
if ( isIncludeDirective || (!type->resolved() && !type.sourceVariable && ( !type.resultType.trace() || type.resultType.trace() ->trace().isEmpty() ) && !BuiltinTypes::isBuiltin( type.resultType ) ) )
return ;
- QString name = type->fullNameChain();
+ TQString name = type->fullNameChain();
if ( type.sourceVariable )
name += " " + type.sourceVariable.name;
if ( type.resultType->resolved() && type.resultType->resolved() ->asFunction() )
@@ -1606,7 +1606,7 @@ void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Contex
PopupFillerHelpStruct h( this );
PopupFiller<PopupFillerHelpStruct> filler( h, "" );
- QPopupMenu * m = PopupTracker::createPopup( popup );
+ TQPopupMenu * m = PopupTracker::createPopup( popup );
int gid;
if ( contextMenuEntriesAtTop )
gid = popup->insertItem( i18n( "Navigate by \"%1\"" ).arg( cleanForMenu( name ) ), m, 5, cpos++ );
@@ -1616,7 +1616,7 @@ void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Contex
popup->setWhatsThis( 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, SLOT( popupAction( int ) ) );
+ int id = m->insertItem( i18n("jump to variable-declaration \"%1\"").arg( type.sourceVariable.name ) , this, TQT_SLOT( popupAction( int ) ) );
m_popupActions.insert( id, type.sourceVariable );
}*/
@@ -1626,7 +1626,7 @@ void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Contex
if ( type->resolved() ) {
///Now fill the class-view-browsing-stuff
{
- QPopupMenu * m = PopupTracker::createPopup( popup );
+ TQPopupMenu * m = PopupTracker::createPopup( popup );
int gid;
if ( contextMenuEntriesAtTop )
gid = popup->insertItem( i18n( "Navigate Class-View by \"%1\"" ).arg( cleanForMenu( name ) ), m, 6, cpos++ );
@@ -1646,7 +1646,7 @@ void CppCodeCompletion::contextEvaluationMenus ( QPopupMenu *popup, const Contex
popup->insertSeparator( cpos );
}
-void CppCodeCompletion::slotTextHint( int line, int column, QString &text ) {
+void CppCodeCompletion::slotTextHint( int line, int column, TQString &text ) {
if ( ! m_pSupport->codeCompletionConfig() ->statusBarTypeEvaluation() )
return ;
@@ -1654,12 +1654,12 @@ void CppCodeCompletion::slotTextHint( int line, int column, QString &text ) {
clearStatusText();
- if ( m_lastHintTime.msecsTo( QTime::currentTime() ) < 300 ) {
+ if ( m_lastHintTime.msecsTo( TQTime::currentTime() ) < 300 ) {
kdDebug( 9007 ) << "slotNeedTextHint called too often" << endl;
return ;
}
- m_lastHintTime = QTime::currentTime();
+ m_lastHintTime = TQTime::currentTime();
clearStatusText();
text = "";
@@ -1682,9 +1682,9 @@ void CppCodeCompletion::slotTextHint( int line, int column, QString &text ) {
if( f ) {
text += "function: \"" + buildSignature( type->resolved() ) + "\"";
} else {
- QValueList<TypeDesc> trace = type.resultType->trace();
+ TQValueList<TypeDesc> trace = type.resultType->trace();
if( !trace.isEmpty() ) {
- for( QValueList<TypeDesc>::iterator it = trace.begin(); it != trace.end(); ++it ) {
+ for( TQValueList<TypeDesc>::iterator it = trace.begin(); it != trace.end(); ++it ) {
text += (*it).fullNameChain() + " --> ";
}
text += "\n";
@@ -1731,19 +1731,19 @@ void CppCodeCompletion::slotTextHint( int line, int column, QString &text ) {
}
///not good..
-bool CppCodeCompletion::isTypeExpression( const QString& expr ) {
+bool CppCodeCompletion::isTypeExpression( const TQString& expr ) {
TypeDesc d( expr );
if ( !d.isValidType() )
return false;
- QString ex = d.fullNameChain();
- QStringList lex = QStringList::split( " ", ex );
- QStringList lexpr = QStringList::split( " ", expr );
+ TQString ex = d.fullNameChain();
+ TQStringList lex = TQStringList::split( " ", ex );
+ TQStringList lexpr = TQStringList::split( " ", expr );
return lex.join( " " ) == lexpr.join( " " );
}
-bool CppCodeCompletion::mayBeTypeTail( int line, int column, QString& append, bool inFunction ) {
- QString tail = clearComments( m_activeEditor->text( line, column + 1, line + 10 > ( int ) m_activeEditor->numLines() ? ( int ) m_activeEditor->numLines() : line + 10, 0 ) );
+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", " " );
SafetyCounter s ( 100 );
bool hadSpace = false;
@@ -1776,7 +1776,7 @@ bool CppCodeCompletion::mayBeTypeTail( int line, int column, QString& append, bo
return false;
}
-bool CppCodeCompletion::canBeTypePrefix( const QString& prefix, bool inFunction ) {
+bool CppCodeCompletion::canBeTypePrefix( const TQString& prefix, bool inFunction ) {
for ( int p = prefix.length() - 1 ; p >= 0; --p ) {
if ( prefix[ p ].isSpace() ) {
@@ -1802,13 +1802,13 @@ bool CppCodeCompletion::canBeTypePrefix( const QString& prefix, bool inFunction
ExpressionInfo CppCodeCompletion::findExpressionAt( int line, int column, int startLine, int startCol, bool inFunction ) {
ExpressionInfo ret;
- QString contents = clearComments( getText( startLine, startCol, line, column ) );
+ TQString contents = clearComments( getText( startLine, startCol, line, column ) );
int start_expr = expressionAt( contents, contents.length() );
if ( start_expr != int( contents.length() ) ) {
- QString str = contents.mid( start_expr, contents.length() - start_expr ).stripWhiteSpace();
+ TQString str = contents.mid( start_expr, contents.length() - start_expr ).stripWhiteSpace();
if ( str.startsWith( "new " ) ) {
str = str.mid( 4 ).stripWhiteSpace();
}
@@ -1820,7 +1820,7 @@ ExpressionInfo CppCodeCompletion::findExpressionAt( int line, int column, int st
if ( ret ) {
///Check whether it may be a type-expression
bool mayBeType = true;
- QString append;
+ TQString append;
if ( !mayBeTypeTail( line, column - 1, append, inFunction ) )
mayBeType = false;
if ( mayBeType ) {
@@ -1829,7 +1829,7 @@ ExpressionInfo CppCodeCompletion::findExpressionAt( int line, int column, int st
}
//make this a regexp
- QString e = ret.expr();
+ TQString e = ret.expr();
if ( e.contains( "." ) || e.contains( "->" ) || e.contains( "(" ) || e.contains( ")" ) || e.contains( "=" ) || e.contains( "-" ) )
mayBeType = false;
@@ -1863,10 +1863,10 @@ SimpleContext* CppCodeCompletion::computeFunctionContext( FunctionDom f, int lin
f->getStartPosition( &modelStartLine, &modelStartColumn );
f->getEndPosition( &modelEndLine, &modelEndColumn );
- QString textLine = m_activeEditor->textLine( modelStartLine );
+ TQString textLine = m_activeEditor->textLine( modelStartLine );
kdDebug( 9007 ) << "startLine = " << textLine << endl;
- QString contents = getText( modelStartLine, modelStartColumn, line, col );
+ TQString contents = getText( modelStartLine, modelStartColumn, line, col );
Driver d;
Lexer lexer( &d );
@@ -1900,13 +1900,13 @@ SimpleContext* CppCodeCompletion::computeFunctionContext( FunctionDom f, int lin
if ( !ctx )
return 0;
- QStringList scope = f->scope();
+ TQStringList scope = f->scope();
if ( !scope.isEmpty() ) {
SimpleType parentType;
/* if( !m_cachedFromContext ) {
- TypePointer t = SimpleType(QStringList())->locateDecType( scope.join("") ).desc().resolved();;
+ TypePointer t = SimpleType(TQStringList())->locateDecType( scope.join("") ).desc().resolved();;
if( t )
parentType = SimpleType( t.data() );
else
@@ -1922,8 +1922,8 @@ SimpleContext* CppCodeCompletion::computeFunctionContext( FunctionDom f, int lin
if( dynamic_cast<SimpleTypeNamespace*>( &(*global) ) ) {
SimpleTypeNamespace* globalNs = static_cast <SimpleTypeNamespace*>( &(*global) );
- QValueList<QPair<QString, QString> > localImports = ctx->imports();
- for( QValueList<QPair<QString, QString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
+ TQValueList<QPair<TQString, TQString> > localImports = ctx->imports();
+ for( TQValueList<QPair<TQString, TQString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
globalNs->addAliasMap( (*it).first, (*it).second );
}
@@ -1984,7 +1984,7 @@ bool CppCodeCompletion::functionContains( FunctionDom f , int line, int col ) {
int sl, sc, el, ec;
f->getStartPosition( &sl, &sc );
f->getEndPosition( &el, &ec );
- QString t = clearComments( getText( sl, sc, el, ec ) );
+ TQString t = clearComments( getText( sl, sc, el, ec ) );
if ( t.isEmpty() )
return false;
@@ -2013,7 +2013,7 @@ void CppCodeCompletion::getFunctionBody( FunctionDom f , int& line, int& col ) {
int sl, sc, el, ec;
f->getStartPosition( &sl, &sc );
f->getEndPosition( &el, &ec );
- QString t = clearComments( getText( sl, sc, el, ec ) );
+ TQString t = clearComments( getText( sl, sc, el, ec ) );
if ( t.isEmpty() )
return;
@@ -2095,10 +2095,10 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
// emptyCache();
fitContextItem( line, column );
- QString strCurLine = m_activeEditor->textLine( nLine );
+ TQString strCurLine = m_activeEditor->textLine( nLine );
- QString ch = strCurLine.mid( nCol - 1, 1 );
- QString ch2 = strCurLine.mid( nCol - 2, 2 );
+ TQString ch = strCurLine.mid( nCol - 1, 1 );
+ TQString ch2 = strCurLine.mid( nCol - 2, 2 );
while ( ch[ 0 ].isSpace() && nCol >= 3 ) {
nCol -= 1;
@@ -2108,7 +2108,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
if ( ch2 == "->" || ch == "." || ch == "(" ) {
int pos = ch2 == "->" ? nCol - 3 : nCol - 2;
- QChar c = strCurLine[ pos ];
+ TQChar c = strCurLine[ pos ];
while ( pos > 0 && c.isSpace() )
c = strCurLine[ --pos ];
@@ -2126,7 +2126,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
showArguments = true;
}
- QString word;
+ TQString word;
{
ExpressionInfo exp_ = findExpressionAt( line, column , line, 0 );
@@ -2196,7 +2196,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
} else {
///Remove the not completely typed last word while normal completion
if ( !showArguments && ( opt & CompletionOption ) ) {
- QString e = exp.expr();
+ TQString e = exp.expr();
int idx = e.length() - 1;
while ( e[ idx ].isLetterOrNumber() || e[ idx ] == '_' )
--idx;
@@ -2229,7 +2229,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
RecoveryPoint* recoveryPoint = this->d->findRecoveryPoint( line, column );
- QStringList scope;
+ TQStringList scope;
if ( !currentClass ) {
kdDebug( 9007 ) << "no container-class found" << endl;
@@ -2251,7 +2251,7 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
if ( m_cachedFromContext ) {
TypeDesc d( scope.join( "::" ) );
d.setIncludeFiles( getIncludeFiles() );
- SimpleTypeImpl * i = SimpleType( QStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data();
+ SimpleTypeImpl * i = SimpleType( TQStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data();
if ( i )
container = i;
else
@@ -2287,13 +2287,13 @@ EvaluationResult CppCodeCompletion::evaluateExpressionType( int line, int column
return ret;
}
-bool isAfterKeyword( const QString& str, int column ) {
- QStringList keywords;
+bool isAfterKeyword( const TQString& str, int column ) {
+ TQStringList keywords;
keywords << "new";
keywords << "throw";
keywords << "return";
keywords << "emit"; ///This could be done even better by only showing signals for completion..
- for ( QStringList::iterator it = keywords.begin(); it != keywords.end(); ++it ) {
+ for ( TQStringList::iterator it = keywords.begin(); it != keywords.end(); ++it ) {
int len = ( *it ).length();
if ( column >= len && str.mid( column - len, len ) == *it )
return true;
@@ -2345,10 +2345,10 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
surroundingEndLine = m_activeEditor->numLines() - 1;
int surroundingEndCol = m_activeEditor->lineLength( surroundingEndLine );
- QString pre = getText( surroundingStartLine, 0, line, column );
+ TQString pre = getText( surroundingStartLine, 0, line, column );
int pos = pre.length();
pre += getText( line, column, surroundingEndLine, surroundingEndCol );
- QString cleared = clearComments( pre );
+ TQString cleared = clearComments( pre );
if ( cleared[ pos ] != pre[ pos ] ) {
kdDebug( 9007 ) << "stopping completion because we're in a coment" << endl;
return ;
@@ -2356,10 +2356,10 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
int nLine = line, nCol = column;
- QString strCurLine = clearComments( m_activeEditor->textLine( nLine ) );
+ TQString strCurLine = clearComments( m_activeEditor->textLine( nLine ) );
- QString ch = strCurLine.mid( nCol - 1, 1 );
- QString ch2 = strCurLine.mid( nCol - 2, 2 );
+ TQString ch = strCurLine.mid( nCol - 1, 1 );
+ TQString ch2 = strCurLine.mid( nCol - 2, 2 );
while ( ch[ 0 ].isSpace() && nCol >= 3 ) {
nCol -= 1;
@@ -2381,7 +2381,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
if ( ch2 == "->" || ch == "." || ch == "(" ) {
int pos = ch2 == "->" ? nCol - 3 : nCol - 2;
- QChar c = strCurLine[ pos ];
+ TQChar c = strCurLine[ pos ];
while ( pos > 0 && c.isSpace() )
c = strCurLine[ --pos ];
@@ -2412,7 +2412,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
if ( isAfterKeyword( strCurLine, column ) ) {
///Maybe a constructor using "new", or "throw", "return", ...
} else {
- ///it is a local constructor like "QString name("David");"
+ ///it is a local constructor like "TQString name("David");"
nCol = column;
}
}
@@ -2424,7 +2424,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
EvaluationResult type;
SimpleType this_type;
- QString expr, word;
+ TQString expr, word;
DeclarationAST::Node recoveredDecl;
TypeSpecifierAST::Node recoveredTypeSpec;
@@ -2442,7 +2442,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
RecoveryPoint * recoveryPoint = d->findRecoveryPoint( line, column );
if ( recoveryPoint || currentFunction ) {
contextItem = currentFunction.data();
- QStringList scope;
+ TQStringList scope;
int startLine, startColumn;
if ( currentFunction ) { ///maybe change the priority of these
@@ -2456,12 +2456,12 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
scope = recoveryPoint->scope;
}
- QString textLine = m_activeEditor->textLine( startLine );
+ TQString textLine = m_activeEditor->textLine( startLine );
kdDebug( 9007 ) << "startLine = " << textLine << endl;
if ( currentFunction || recoveryPoint->kind == NodeType_FunctionDefinition ) {
- QString textToReparse = clearComments( getText( startLine, startColumn, line, showArguments ? nCol : column ) );
+ TQString textToReparse = clearComments( getText( startLine, startColumn, line, showArguments ? nCol : column ) );
kdDebug( 9007 ) << "-------------> reparse text" << endl << textToReparse << endl
<< "--------------------------------------------" << endl;
@@ -2492,7 +2492,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
/// @todo remove code duplication
- QString contents = textToReparse;
+ TQString contents = textToReparse;
int start_expr = expressionAt( contents, contents.length() );
// kdDebug(9007) << "start_expr = " << start_expr << endl;
@@ -2508,7 +2508,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
--end_expr;
if ( contents[ end_expr ] != ',' ) {
- expr = QString::null;
+ expr = TQString::null;
} else {
start_expr = expressionAt( contents, end_expr );
expr = contents.mid( start_expr, end_expr - start_expr ).stripWhiteSpace();
@@ -2531,14 +2531,14 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
DeclaratorAST* d = def->initDeclarator() ->declarator();
NameAST* name = d->declaratorId();
- QStringList nested;
+ TQStringList nested;
- QPtrList<ClassOrNamespaceNameAST> l;
+ TQPtrList<ClassOrNamespaceNameAST> l;
if ( name ) {
l = name->classOrNamespaceNameList();
}
- // QPtrList<ClassOrNamespaceNameAST> l = name->classOrNamespaceNameList();
- QPtrListIterator<ClassOrNamespaceNameAST> nameIt( l );
+ // TQPtrList<ClassOrNamespaceNameAST> l = name->classOrNamespaceNameList();
+ TQPtrListIterator<ClassOrNamespaceNameAST> nameIt( l );
while ( nameIt.current() ) {
if ( nameIt.current() ->name() ) {
nested << nameIt.current() ->name() ->text();
@@ -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() );
- QValueList<QPair<QString, QString> > localImports = ctx->imports();
- for( QValueList<QPair<QString, QString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
+ TQValueList<QPair<TQString, TQString> > localImports = ctx->imports();
+ for( TQValueList<QPair<TQString, TQString> >::const_iterator it = localImports.begin(); it != localImports.end(); ++it )
globalNs->addAliasMap( (*it).first, (*it).second );
}
} else {
@@ -2571,7 +2571,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
conf.setGlobalNamespace( t );
SimpleTypeNamespace * n = dynamic_cast<SimpleTypeNamespace*>( t.data() );
if ( !n ) {
- QString str = QString( "the global namespace was not resolved correctly , real type: " ) + typeid( n ).name() + QString( " name: " ) + n->scope().join( "::" ) + " scope-size: " + n->scope().count();
+ TQString str = TQString( "the global namespace was not resolved correctly , real type: " ) + typeid( n ).name() + TQString( " name: " ) + n->scope().join( "::" ) + " scope-size: " + n->scope().count();
kdDebug( 9007 ) << str << endl;
m_pSupport->mainWindow() ->statusBar() ->message( str , 1000 );
} else {
@@ -2582,7 +2582,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
if ( m_cachedFromContext ) {
TypeDesc d( scope.join( "::" ) );
d.setIncludeFiles( getIncludeFiles() );
- SimpleTypeImpl * i = SimpleType( QStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data();
+ SimpleTypeImpl * i = SimpleType( TQStringList(), getIncludeFiles() ) ->locateDecType( d ).desc().resolved().data();
if ( i ) {
parentType = i;
} else {
@@ -2633,7 +2633,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
kdDebug( 9007 ) << "no valid declaration to recover!!!" << endl;
}
} else if ( recoveryPoint->kind == NodeType_ClassSpecifier ) {
- QString textToReparse = getText( recoveryPoint->startLine, recoveryPoint->startColumn,
+ TQString textToReparse = getText( recoveryPoint->startLine, recoveryPoint->startColumn,
recoveryPoint->endLine, recoveryPoint->endColumn, line );
// kdDebug(9007) << "-------------> please reparse only text" << endl << textToReparse << endl
// << "--------------------------------------------" << endl;
@@ -2651,7 +2651,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
//ClassSpecifierAST * clazz = static_cast<ClassSpecifierAST*>( recoveredTypeSpec.get() );
- QString keyword = getText( line, 0, line, column ).simplifyWhiteSpace();
+ TQString keyword = getText( line, 0, line, column ).simplifyWhiteSpace();
kdDebug( 9007 ) << "===========================> keyword is: " << keyword << endl;
@@ -2659,8 +2659,8 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
BaseClauseAST *baseClause = clazz->baseClause();
if ( baseClause )
{
- QPtrList<BaseSpecifierAST> baseList = baseClause->baseSpecifierList();
- QPtrList<BaseSpecifierAST>::iterator it = baseList.begin();
+ TQPtrList<BaseSpecifierAST> baseList = baseClause->baseSpecifierList();
+ TQPtrList<BaseSpecifierAST>::iterator it = baseList.begin();
for ( ; it != baseList.end(); ++it )
type.append( ( *it )->name()->text() );
@@ -2673,7 +2673,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
kdDebug(9007) << "------> found virtual keyword for class specifier '"
<< clazz->text() << "'" << endl;
}*/
- } else if ( QString( "virtual" ).find( keyword ) != -1 )
+ } else if ( TQString( "virtual" ).find( keyword ) != -1 )
m_blockForKeyword = true;
else
m_blockForKeyword = false;
@@ -2694,7 +2694,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
int startLine, startColumn;
def->getStartPosition( &startLine, &startColumn );
- QString contents = getText( startLine, startColumn, line, showArguments ? nCol : column );
+ TQString contents = getText( startLine, startColumn, line, showArguments ? nCol : column );
/// @todo remove code duplication
@@ -2713,7 +2713,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
--end_expr;
if ( contents[ end_expr ] != ',' ) {
- expr = QString::null;
+ expr = TQString::null;
} else {
start_expr = expressionAt( contents, end_expr );
expr = contents.mid( start_expr, end_expr - start_expr ).stripWhiteSpace();
@@ -2732,7 +2732,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
ctx = computeContext( def, line, column, startLine, startColumn );
- QStringList scope;
+ TQStringList scope;
scopeOfNode( def, scope );
this_type = SimpleType( scope, getIncludeFiles() );
@@ -2755,12 +2755,12 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
return ;
if ( ch2 == "::" ) {
- QString str = clearComments( expr );
+ TQString str = clearComments( expr );
if ( !str.contains( '.' ) && !str.contains( "->" ) ) ///Necessary, because the expression may also be like user->BaseUser::
isInstance = false;
}
- QString resolutionType = "(resolved)";
+ TQString resolutionType = "(resolved)";
if( !type->resolved() ) {
if( BuiltinTypes::isBuiltin( type.resultType ) ) {
resolutionType = "(builtin " + BuiltinTypes::comment( type.resultType ) + ")";
@@ -2773,7 +2773,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
kdDebug( 9007 ) << "===========================> word is: " << word << endl;
if ( !showArguments ) {
- QValueList<CodeCompletionEntry> entryList;
+ TQValueList<CodeCompletionEntry> entryList;
if ( !type && this_type && ( expr.isEmpty() || expr.endsWith( ";" ) ) ) {
@@ -2817,9 +2817,9 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
if( ctx ) computeCompletionEntryList( entryList, ctx, isInstance );
// if ( m_pSupport->codeCompletionConfig() ->includeGlobalFunctions() )
- // computeCompletionEntryList( type, entryList, QStringList(), false );
+ // computeCompletionEntryList( type, entryList, TQStringList(), false );
- computeCompletionEntryList( type, entryList, QStringList(), false );
+ computeCompletionEntryList( type, entryList, TQStringList(), false );
if ( this_type.scope().size() )
computeCompletionEntryList( this_type, entryList, this_type.scope(), isInstance );
@@ -2829,11 +2829,11 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
computeCompletionEntryList( type, entryList, type->resolved() ->scope() , isInstance );
}
- QStringList trueMatches;
+ TQStringList trueMatches;
if ( invokedOnDemand ) {
// find matching words
- QValueList<CodeCompletionEntry>::Iterator it;
+ TQValueList<CodeCompletionEntry>::Iterator it;
for ( it = entryList.begin(); it != entryList.end(); ++it ) {
if ( ( *it ).text.startsWith( word ) ) {
trueMatches << ( *it ).text;
@@ -2860,14 +2860,14 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
m_bCompletionBoxShow = true;
///Warning: the conversion is only possible because CodeCompletionEntry is binary compatible with KTextEditor::CompletionEntry,
///never change that!
- m_activeCompletion->showCompletionBox( *( ( QValueList<KTextEditor::CompletionEntry>* ) ( &entryList ) ), word.length() );
+ m_activeCompletion->showCompletionBox( *( ( TQValueList<KTextEditor::CompletionEntry>* ) ( &entryList ) ), word.length() );
}
} else {
- QValueList<QStringList> signatureList;
+ TQValueList<TQStringList> signatureList;
signatureList = computeSignatureList( type );
- QString methodName = type->name();
+ TQString methodName = type->name();
///Search for variables with ()-operator in the context
if ( ctx ) {
@@ -2911,7 +2911,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
}
-QValueList<QStringList> CppCodeCompletion::computeSignatureList( EvaluationResult result ) {
+TQValueList<TQStringList> CppCodeCompletion::computeSignatureList( EvaluationResult result ) {
SimpleType type = result;
if ( result.expr.t == ExpressionInfo::TypeExpression ) {
@@ -2920,7 +2920,7 @@ QValueList<QStringList> CppCodeCompletion::computeSignatureList( EvaluationResul
type = type->typeOf( d, SimpleTypeImpl::MemberInfo::Function ); ///Compute the signature of the constructor
}
- QValueList<QStringList> retList;
+ TQValueList<TQStringList> retList;
SimpleTypeFunctionInterface* f = type->asFunction();
SimpleType currType = type;
@@ -2934,10 +2934,10 @@ QValueList<QStringList> CppCodeCompletion::computeSignatureList( EvaluationResul
}
while ( f ) {
- QStringList lst;
- QString sig = buildSignature( currType.get() );
- QString comment = currType->comment();
- QStringList commentList;
+ TQStringList lst;
+ TQString sig = buildSignature( currType.get() );
+ TQString comment = currType->comment();
+ TQStringList commentList;
if ( m_pSupport->codeCompletionConfig() ->showCommentWithArgumentHint() ) {
if ( !comment.isEmpty() ) {
@@ -2962,13 +2962,13 @@ QValueList<QStringList> CppCodeCompletion::computeSignatureList( EvaluationResul
return retList;
}
-void CppCodeCompletion::synchronousParseReady( const QString& file, ParsedFilePointer unit ) {
+void CppCodeCompletion::synchronousParseReady( const TQString& file, ParsedFilePointer unit ) {
if ( file == m_activeFileName ) {
computeRecoveryPoints( unit );
}
}
-void CppCodeCompletion::slotCodeModelUpdated( const QString& fileName ) {
+void CppCodeCompletion::slotCodeModelUpdated( const TQString& fileName ) {
if ( fileName != m_activeFileName || !m_pSupport || !m_activeEditor )
return ;
@@ -2977,7 +2977,7 @@ void CppCodeCompletion::slotCodeModelUpdated( const QString& fileName ) {
computeRecoveryPointsLocked();
}
-void CppCodeCompletion::slotFileParsed( const QString& fileName ) {
+void CppCodeCompletion::slotFileParsed( const TQString& fileName ) {
if ( fileName != m_activeFileName || !m_pSupport || !m_activeEditor )
return ;
@@ -2999,24 +2999,24 @@ SimpleContext* CppCodeCompletion::computeContext( FunctionDefinitionAST * ast, i
DeclaratorAST * d = ast->initDeclarator() ->declarator();
if ( ParameterDeclarationClauseAST * clause = d->parameterDeclarationClause() ) {
if ( ParameterDeclarationListAST * params = clause->parameterDeclarationList() ) {
- QPtrList<ParameterDeclarationAST> l( params->parameterList() );
- QPtrListIterator<ParameterDeclarationAST> it( l );
+ TQPtrList<ParameterDeclarationAST> l( params->parameterList() );
+ TQPtrListIterator<ParameterDeclarationAST> it( l );
while ( it.current() ) {
ParameterDeclarationAST * param = it.current();
++it;
SimpleVariable var;
- QStringList ptrList;
- QPtrList<AST> ptrOpList = param->declarator() ->ptrOpList();
- QPtrList<AST>::iterator it = ptrOpList.begin();
+ TQStringList ptrList;
+ TQPtrList<AST> ptrOpList = param->declarator() ->ptrOpList();
+ TQPtrList<AST>::iterator it = ptrOpList.begin();
for ( ; it != ptrOpList.end(); ++it ) {
ptrList.append( ( *it ) ->text() );
}
var.ptrList = ptrList;
var.type = param->typeSpec() ->text() + ptrList.join( "" );
- var.name = declaratorToString( param->declarator(), QString::null, true );
+ var.name = declaratorToString( param->declarator(), TQString::null, true );
var.comment = param->comment();
param->getStartPosition( &var.startLine, &var.startCol );
param->getEndPosition( &var.endLine, &var.endCol );
@@ -3080,8 +3080,8 @@ void CppCodeCompletion::computeContext( SimpleContext*& ctx, StatementListAST* a
if ( !inContextScope( ast, line, col, false, true ) )
return ;
- QPtrList<StatementAST> l( ast->statementList() );
- QPtrListIterator<StatementAST> it( l );
+ TQPtrList<StatementAST> l( ast->statementList() );
+ TQPtrListIterator<StatementAST> it( l );
while ( it.current() ) {
StatementAST * stmt = it.current();
++it;
@@ -3144,8 +3144,8 @@ void CppCodeCompletion::computeContext( SimpleContext*& ctx, CatchStatementListA
/*if ( !inContextScope( ast, line, col, false, true ) )
return;*/
- QPtrList<CatchStatementAST> l( ast->statementList() );
- QPtrListIterator<CatchStatementAST> it( l );
+ TQPtrList<CatchStatementAST> l( ast->statementList() );
+ TQPtrListIterator<CatchStatementAST> it( l );
while ( it.current() ) {
CatchStatementAST * stmt = it.current();
++it;
@@ -3168,21 +3168,21 @@ void CppCodeCompletion::computeContext( SimpleContext*& ctx, DeclarationStatemen
///@todo respect NodeType_Typedef
if( ast->declaration() && ast->declaration() ->nodeType() == NodeType_UsingDirective ) {
UsingDirectiveAST* usingDecl = static_cast<UsingDirectiveAST*>( ast->declaration() );
- QString name;
+ TQString name;
if( usingDecl->name() ) {
name = usingDecl->name()->text();
if( !name.isNull() )
- ctx->addImport( QPair<QString, QString>( "", name ) );
+ ctx->addImport( QPair<TQString, TQString>( "", name ) );
}
}
if( ast->declaration() && ast->declaration() ->nodeType() == NodeType_NamespaceAlias ) {
NamespaceAliasAST* namespaceAlias = static_cast<NamespaceAliasAST*>( ast->declaration() );
- QString name;
+ TQString name;
if( namespaceAlias ->namespaceName() && namespaceAlias->aliasName() ) {
- ctx->addImport( QPair<QString, QString>( namespaceAlias->namespaceName()->text(), namespaceAlias->aliasName()->text() ) );
+ ctx->addImport( QPair<TQString, TQString>( namespaceAlias->namespaceName()->text(), namespaceAlias->aliasName()->text() ) );
}
}
@@ -3199,8 +3199,8 @@ void CppCodeCompletion::computeContext( SimpleContext*& ctx, DeclarationStatemen
if ( !initDeclListAST )
return ;
- QPtrList<InitDeclaratorAST> l = initDeclListAST->initDeclaratorList();
- QPtrListIterator<InitDeclaratorAST> it( l );
+ TQPtrList<InitDeclaratorAST> l = initDeclListAST->initDeclaratorList();
+ TQPtrListIterator<InitDeclaratorAST> it( l );
while ( it.current() ) {
DeclaratorAST * d = it.current() ->declarator();
++it;
@@ -3208,9 +3208,9 @@ void CppCodeCompletion::computeContext( SimpleContext*& ctx, DeclarationStatemen
if ( d->declaratorId() ) {
SimpleVariable var;
- QStringList ptrList;
- QPtrList<AST> ptrOpList = d->ptrOpList();
- QPtrList<AST>::iterator it = ptrOpList.begin();
+ TQStringList ptrList;
+ TQPtrList<AST> ptrOpList = d->ptrOpList();
+ TQPtrList<AST>::iterator it = ptrOpList.begin();
for ( ; it != ptrOpList.end(); ++it ) {
ptrList.append( ( *it ) ->text() );
}
@@ -3241,9 +3241,9 @@ void CppCodeCompletion::computeContext( SimpleContext*& ctx, ConditionAST* ast,
SimpleVariable var;
- QStringList ptrList;
- QPtrList<AST> ptrOpList = ast->declarator() ->ptrOpList();
- QPtrList<AST>::iterator it = ptrOpList.begin();
+ TQStringList ptrList;
+ TQPtrList<AST> ptrOpList = ast->declarator() ->ptrOpList();
+ TQPtrList<AST>::iterator it = ptrOpList.begin();
for ( ; it != ptrOpList.end(); ++it ) {
ptrList.append( ( *it ) ->text() );
}
@@ -3298,19 +3298,19 @@ FunctionDefinitionAST * CppCodeCompletion::functionDefinition( AST* node ) {
return 0;
}
-QString CppCodeCompletion::getText( int startLine, int startColumn, int endLine, int endColumn, int omitLine ) {
+TQString CppCodeCompletion::getText( int startLine, int startColumn, int endLine, int endColumn, int omitLine ) {
if ( startLine == endLine ) {
- QString textLine = m_activeEditor->textLine( startLine );
+ TQString textLine = m_activeEditor->textLine( startLine );
return textLine.mid( startColumn, endColumn - startColumn );
}
- QStringList contents;
+ TQStringList contents;
for ( int line = startLine; line <= endLine; ++line ) {
if ( line == omitLine )
continue;
- QString textLine = m_activeEditor->textLine( line );
+ TQString textLine = m_activeEditor->textLine( line );
if ( line == startLine )
textLine = textLine.mid( startColumn );
@@ -3344,7 +3344,7 @@ void CppCodeCompletion::computeRecoveryPoints( ParsedFilePointer unit ) {
walker.parseTranslationUnit( *unit );
}
-QString codeModelAccessToString( CodeModelItem::Access access ) {
+TQString codeModelAccessToString( CodeModelItem::Access access ) {
switch ( access ) {
case CodeModelItem::Public:
return "public";
@@ -3360,13 +3360,13 @@ QString codeModelAccessToString( CodeModelItem::Access access ) {
#define MAXCOMMENTCOLUMNS 45
-QString CppCodeCompletion::commentFromItem( const SimpleType& parent, const ItemDom& item ) {
+TQString CppCodeCompletion::commentFromItem( const SimpleType& parent, const ItemDom& item ) {
--m_maxComments;
- static QString maxReached = " ";
+ static TQString maxReached = " ";
if( m_maxComments < 0 ) {
return maxReached;
}
- QString ret;
+ TQString ret;
int line, col;
item->getStartPosition( &line, &col );
@@ -3397,7 +3397,7 @@ QString CppCodeCompletion::commentFromItem( const SimpleType& parent, const Item
const FunctionModel * f = dynamic_cast<const FunctionModel*>( item.data() );
ret += "\nKind: Function";
if ( f ) {
- QString state;
+ TQString state;
if ( f->isStatic() )
state += "static ";
if ( f->isVirtual() )
@@ -3463,22 +3463,22 @@ QString CppCodeCompletion::commentFromItem( const SimpleType& parent, const Item
ret += "\nKind: Class";
}
- ret += QString( "\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" ).arg( prepareTextForMenu( item->fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).arg( line ).arg( col );
if ( !item->comment().isEmpty() )
ret += "\n\n" + prepareTextForMenu( item->comment(), 3, MAXCOMMENTCOLUMNS ).join( "\n" );
return ret;
}
-QString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag ) {
+TQString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag ) {
--m_maxComments;
- static QString maxReached = " ";
+ static TQString maxReached = " ";
if( m_maxComments < 0 ) {
return maxReached;
}
int line, col;
tag.getStartPosition( &line, &col );
- QString ret; // = tag.comment();
+ TQString ret; // = tag.comment();
if ( !parent->scope().isEmpty() ) {
ret += "Container: " + parent->fullTypeResolvedWithScope();
@@ -3508,7 +3508,7 @@ QString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag )
ret += "\nKind: Function";
- QString state;
+ TQString state;
if ( function.isStatic() )
state += "static ";
if ( function.isVirtual() )
@@ -3585,14 +3585,14 @@ QString CppCodeCompletion::commentFromTag( const SimpleType& parent, Tag& tag )
ret += "\nKind: Struct";
}
- ret += QString( "\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" ).arg( prepareTextForMenu( tag.fileName(), 3, MAXCOMMENTCOLUMNS ).join( "\n" ) ).arg( line ).arg( col );
if ( !tag.comment().isEmpty() ) {
ret += "\n\n" + prepareTextForMenu( tag.comment(), 20, MAXCOMMENTCOLUMNS ).join( "\n" );
}
return ret;
}
-void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList<CodeCompletionEntry>& entryList, const QStringList& type, SimpleTypeNamespace* ns, std::set<HashedString>& ignore, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, TQValueList<CodeCompletionEntry>& entryList, const TQStringList& type, SimpleTypeNamespace* ns, std::set<HashedString>& ignore, bool isInstance, int depth ) {
HashedString myName = HashedString( ns->scope().join("::") +"%"+typeid(*ns).name() );
if ( ignore.find( myName ) != ignore.end() )
return ;
@@ -3608,7 +3608,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList
}
}
-void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList< CodeCompletionEntry > & entryList, const QStringList & type, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, TQValueList< CodeCompletionEntry > & entryList, const TQStringList & type, bool isInstance, int depth ) {
dbgState.setState( disableVerboseForCompletionList );
Debug d( "#cel#" );
@@ -3625,12 +3625,12 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList
if ( ClassModel * mod = dynamic_cast<ClassModel*> ( &( *item ) ) )
computeCompletionEntryList( typeR, entryList, ClassDom( mod ) , isInstance, depth );
} else {
- QValueList<Catalog::QueryArgument> args;
- QValueList<Tag> tags;
+ TQValueList<Catalog::QueryArgument> args;
+ TQValueList<Tag> tags;
- QStringList ts = type;
+ TQStringList ts = type;
if( !ts.isEmpty() ) {
- QString s = ts.back() + typeR->specialization();
+ TQString s = ts.back() + typeR->specialization();
ts.pop_back();
ts.push_back( s );
}
@@ -3681,14 +3681,14 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList
args.clear();
args << Catalog::QueryArgument( "kind", Tag::Kind_Base_class );
- QString fullname = type.join( "::" )+typeR->specialization();
+ TQString fullname = type.join( "::" )+typeR->specialization();
/* if( fullname.length() >=2 )
args << Catalog::QueryArgument( "prefix", fullname.left(2) );*/
args << Catalog::QueryArgument( "name", fullname );
- QValueList<LocateResult> parents = typeR->getBases( );
- for ( QValueList<LocateResult>::Iterator it = parents.begin(); it != parents.end(); ++it ) {
+ TQValueList<LocateResult> parents = typeR->getBases( );
+ for ( TQValueList<LocateResult>::Iterator it = parents.begin(); it != parents.end(); ++it ) {
if ( !( *it ) ->resolved() )
continue;
SimpleType tp = SimpleType( ( *it ) ->resolved() );
@@ -3700,18 +3700,18 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType typeR, QValueList
}
-void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, QValueList< Tag > & tags, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList< CodeCompletionEntry > & entryList, TQValueList< Tag > & tags, bool isInstance, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
- QString className = type->desc().name();
+ TQString className = type->desc().name();
bool isNs = type->isNamespace();
CompTypeProcessor proc( type, m_pSupport->codeCompletionConfig() ->processFunctionArguments() && type->usingTemplates() );
bool resolve = m_pSupport->codeCompletionConfig() ->processPrimaryTypes() && type->usingTemplates();
- QValueList<Tag>::Iterator it = tags.begin();
+ TQValueList<Tag>::Iterator it = tags.begin();
while ( it != tags.end() ) {
Tag & tag = *it;
++it;
@@ -3753,7 +3753,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
fl.flags = tag.flags();
int num = fl.data.access;
- QString str = "public";
+ TQString str = "public";
if ( num != 0 ) {
str = TagUtils::accessToString( num );
} else {
@@ -3807,7 +3807,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
break;
}
- e.userdata = QString( "%1%2%3%4%5" ).arg( num ).arg( depth ).arg( className ).arg( sortPosition ).arg( subSorting );
+ e.userdata = TQString( "%1%2%3%4%5" ).arg( num ).arg( depth ).arg( className ).arg( sortPosition ).arg( subSorting );
if ( m_completionMode != SignalCompletion ) {
if ( !type->isNamespace() ) {
@@ -3819,7 +3819,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
}
- QString prefix = tagType( tag ).stripWhiteSpace();
+ TQString prefix = tagType( tag ).stripWhiteSpace();
if ( tag.kind() == Tag::Kind_Enumerator && tag.hasAttribute( "enum" ) ) {
prefix = tag.attribute( "enum" ).asString();
@@ -3867,7 +3867,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
}
}
-void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, ClassDom klass, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList< CodeCompletionEntry > & entryList, ClassDom klass, bool isInstance, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
@@ -3878,7 +3878,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
FunctionDefinitionList definitions = klass->functionDefinitionList();
FunctionList l;
- QStringList classScope = klass->scope();
+ TQStringList classScope = klass->scope();
classScope << klass->name();
for ( FunctionDefinitionList::iterator it = definitions.begin(); it != definitions.end(); ++it ) {
@@ -3930,9 +3930,9 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
computeCompletionEntryList( klass->name(), type, entryList, klass->typeAliasList(), isInstance, depth );
}
- QValueList<LocateResult> parents = type->getBases( );
+ TQValueList<LocateResult> parents = type->getBases( );
- for ( QValueList<LocateResult>::Iterator it = parents.begin(); it != parents.end(); ++it ) {
+ for ( TQValueList<LocateResult>::Iterator it = parents.begin(); it != parents.end(); ++it ) {
if ( !( *it ) ->resolved() )
continue;
@@ -3950,7 +3950,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
}
}
-void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, NamespaceDom scope, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList< CodeCompletionEntry > & entryList, NamespaceDom scope, bool isInstance, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
@@ -3962,7 +3962,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
computeCompletionEntryList( type, entryList, scope->namespaceList(), isInstance, depth );
}
-void CppCodeCompletion::computeCompletionEntryList( QString parent, SimpleType type, QValueList< CodeCompletionEntry > & entryList, const ClassList & lst, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( TQString parent, 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( QString parent, SimpleType t
if ( isInstance )
continue;
- entry.userdata = QString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 6 );
+ entry.userdata = TQString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 6 );
entryList << entry;
@@ -3993,7 +3993,7 @@ void CppCodeCompletion::computeCompletionEntryList( QString parent, SimpleType t
}
}
-void CppCodeCompletion::computeCompletionEntryList( QString parent, SimpleType type, QValueList< CodeCompletionEntry > & entryList, const TypeAliasList & lst, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( TQString parent, SimpleType type, TQValueList< CodeCompletionEntry > & entryList, const TypeAliasList & lst, bool isInstance, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
@@ -4015,11 +4015,11 @@ void CppCodeCompletion::computeCompletionEntryList( QString parent, SimpleType t
entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace();
entry.text = klass->name();
entry.comment = commentFromItem( type, klass.data() );
- entry.userdata = QString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 5 );
+ entry.userdata = TQString( "%1%2%3%4%5" ).arg( CodeModelItem::Public ).arg( depth ).arg( parent ).arg( 5 );
entryList << entry;
}
}
-void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const NamespaceList & lst, bool /*isInstance*/, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList< CodeCompletionEntry > & entryList, const NamespaceList & lst, bool /*isInstance*/, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
@@ -4038,11 +4038,11 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
}
}
-void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const FunctionList & methods, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList< CodeCompletionEntry > & entryList, const FunctionList & methods, bool isInstance, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
- QString className = type->desc().name();
+ TQString className = type->desc().name();
bool isNs = type->isNamespace();
bool resolve = type->usingTemplates() && m_pSupport->codeCompletionConfig() ->processPrimaryTypes();
@@ -4073,7 +4073,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
if ( ! resolve ) {
entry.prefix = meth->resultType();
} else {
- QString tt = meth->resultType();
+ TQString tt = meth->resultType();
LocateResult t = type->locateDecType( tt );
if ( t ) {
entry.prefix = t->fullNameChain();
@@ -4087,7 +4087,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
entry.prefix = destructorPrefix;
entry.prefix = stringMult( depth, " " ) + entry.prefix.stripWhiteSpace();
- QString text;
+ TQString text;
ArgumentList args = meth->argumentList();
ArgumentList::Iterator argIt = args.begin();
@@ -4112,7 +4112,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
text += proc.processType( arg->type() );
if ( m_completionMode == NormalCompletion ||
m_completionMode == VirtualDeclCompletion )
- text += QString( " " ) + arg->name();
+ text += TQString( " " ) + arg->name();
if ( argIt != args.end() )
text += ", ";
@@ -4136,7 +4136,7 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
if ( meth->isStatic() )
subSorting = 5;
- entry.userdata += QString( "%1%2%3%4%5" ).arg( meth->access() ).arg( depth ).arg( className ).arg( 1 ).arg( subSorting );
+ entry.userdata += TQString( "%1%2%3%4%5" ).arg( meth->access() ).arg( depth ).arg( className ).arg( 1 ).arg( subSorting );
if ( m_completionMode == VirtualDeclCompletion )
entry.text += text + ";";
@@ -4162,9 +4162,9 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
}
}
-void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList< CodeCompletionEntry > & entryList, const VariableList & attributes, bool isInstance, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( SimpleType type, TQValueList< CodeCompletionEntry > & entryList, const VariableList & attributes, bool isInstance, int depth ) {
Debug d( "#cel#" );
- QString className = type->desc().name();
+ TQString className = type->desc().name();
bool isNs = type->isNamespace();
if ( !safetyCounter || !d )
@@ -4187,14 +4187,14 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
CodeCompletionEntry entry;
entry.text = attr->name();
entry.comment = commentFromItem( type, model_cast<ItemDom>( attr ) );
- entry.userdata += QString( "%1%2%3%4" ).arg( attr->access() ).arg( depth ).arg( className ).arg( 2 );
+ entry.userdata += TQString( "%1%2%3%4" ).arg( attr->access() ).arg( depth ).arg( className ).arg( 2 );
if ( !attr->isEnumeratorVariable() ) {
if ( ! resolve ) {
entry.prefix = attr->type();
} else {
- QString tt = attr->type();
+ TQString tt = attr->type();
LocateResult t = type->locateDecType( tt );
//SimpleType t = type->typeOf( attr->name() );
if ( t )
@@ -4217,14 +4217,14 @@ void CppCodeCompletion::computeCompletionEntryList( SimpleType type, QValueList<
}
}
-void CppCodeCompletion::computeCompletionEntryList( QValueList< CodeCompletionEntry > & entryList, SimpleContext * ctx, bool /*isInstance*/, int depth ) {
+void CppCodeCompletion::computeCompletionEntryList( TQValueList< CodeCompletionEntry > & entryList, SimpleContext * ctx, bool /*isInstance*/, int depth ) {
Debug d( "#cel#" );
if ( !safetyCounter || !d )
return ;
while ( ctx ) {
- QValueList<SimpleVariable> vars = ctx->vars();
- QValueList<SimpleVariable>::ConstIterator it = vars.begin();
+ TQValueList<SimpleVariable> vars = ctx->vars();
+ TQValueList<SimpleVariable>::ConstIterator it = vars.begin();
while ( it != vars.end() ) {
const SimpleVariable & var = *it;
++it;
@@ -4252,7 +4252,7 @@ EvaluationResult CppCodeCompletion::evaluateExpression( ExpressionInfo expr, Sim
EvaluationResult res;
res = obj.evaluate();
- QString resolutionType = "(resolved)";
+ TQString resolutionType = "(resolved)";
if( !res->resolved() ) {
if( BuiltinTypes::isBuiltin( res.resultType ) ) {
resolutionType = "(builtin " + BuiltinTypes::comment( res.resultType ) + ")";
@@ -4269,13 +4269,13 @@ EvaluationResult CppCodeCompletion::evaluateExpression( ExpressionInfo expr, Sim
void CppCodeCompletion::computeFileEntryList( ) {
m_fileEntryList.clear();
- QStringList fileList = m_pSupport->project() ->allFiles();
- for ( QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it ) {
+ TQStringList fileList = m_pSupport->project() ->allFiles();
+ for ( TQStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it ) {
if ( !m_pSupport->isHeader( *it ) )
continue;
CodeCompletionEntry entry;
- entry.text = QFileInfo( *it ).fileName();
+ entry.text = TQFileInfo( *it ).fileName();
m_fileEntryList.push_back( entry );
}
@@ -4283,8 +4283,8 @@ void CppCodeCompletion::computeFileEntryList( ) {
m_fileEntryList = unique( m_fileEntryList );
}
-HashedStringSet CppCodeCompletion::getIncludeFiles( const QString& fi ) {
- QString file = fi;
+HashedStringSet CppCodeCompletion::getIncludeFiles( const TQString& fi ) {
+ TQString file = fi;
if( file.isEmpty() )
file = m_activeFileName;
@@ -4328,7 +4328,7 @@ void CppCodeCompletion::jumpCursorContext( FunctionType f )
// Determine the declaration info based on the type of item we are dealing with.
DeclarationInfo d;
- QString includeFileName, includeFilePath;
+ TQString includeFileName, includeFilePath;
bool unused;
if ( result.isMacro ) {
@@ -4354,12 +4354,12 @@ void CppCodeCompletion::jumpCursorContext( FunctionType f )
SimpleTypeCachedCodeModel * item = dynamic_cast<SimpleTypeCachedCodeModel*>( ( *slaves.begin() ).first.first.resolved().data() );
if ( item && item->item() && item->item()->isNamespace() ) {
NamespaceModel* ns = dynamic_cast<NamespaceModel*>( item->item().data() );
- QStringList wholeScope = ns->scope();
+ TQStringList wholeScope = ns->scope();
wholeScope << ns->name();
FileList files = cppSupport()->codeModel()->fileList();
for ( FileList::iterator it = files.begin(); it != files.end(); ++it ) {
NamespaceModel* ns = (*it).data();
- for ( QStringList::iterator it2 = wholeScope.begin(); it2 != wholeScope.end(); ++it2 ) {
+ for ( TQStringList::iterator it2 = wholeScope.begin(); it2 != wholeScope.end(); ++it2 ) {
if ( ns->hasNamespace( (*it2) ) ) {
ns = ns->namespaceByName( *it2 );
if ( !ns ) break;
@@ -4386,7 +4386,7 @@ void CppCodeCompletion::jumpCursorContext( FunctionType f )
}
// Unresolved, maybe its a named enumeration?
else if ( type && type.trace() ) {
- QValueList< QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = type.trace()->trace();
+ TQValueList< QPair<SimpleTypeImpl::MemberInfo, TypeDesc> > trace = type.trace()->trace();
if ( !trace.isEmpty() ) {
if ( trace.begin() != trace.end() ) {
d = ( *trace.begin() ).first.decl;
@@ -4395,16 +4395,16 @@ void CppCodeCompletion::jumpCursorContext( FunctionType f )
}
}
if ( d ) {
- QString fileName = d.file == "current_file" ? m_activeFileName : d.file.operator QString();
+ TQString fileName = d.file == "current_file" ? m_activeFileName : d.file.operator TQString();
if ( f == Definition && cppSupport()->switchHeaderImpl( fileName, d.startLine, d.startCol ) )
return;
cppSupport()->partController()->editDocument( fileName, d.startLine );
}
}
-QString CppCodeCompletion::createTypeInfoString( int line, int column )
+TQString CppCodeCompletion::createTypeInfoString( int line, int column )
{
- QString typeInfoString;
+ TQString typeInfoString;
SimpleTypeConfiguration conf( m_activeFileName );
EvaluationResult type = evaluateExpressionAt( line, column, conf );
@@ -4412,11 +4412,11 @@ QString CppCodeCompletion::createTypeInfoString( int line, int column )
if ( type.expr.expr().stripWhiteSpace().isEmpty() )
return typeInfoString;
- typeInfoString += type.expr.expr() + QString(" : " );
+ typeInfoString += type.expr.expr() + TQString(" : " );
if ( type->resolved() )
{
- QString scope = type->resolved()->scope().join("::");
+ TQString scope = type->resolved()->scope().join("::");
int pos = scope.findRev("::");
if ( scope.isEmpty() || pos == -1 )
{
@@ -4427,7 +4427,7 @@ QString CppCodeCompletion::createTypeInfoString( int line, int column )
scope.truncate( pos + 2 );
}
- typeInfoString += scope + type->fullNameChain() + QString( i18n(" (resolved) ") );
+ typeInfoString += scope + type->fullNameChain() + TQString( i18n(" (resolved) ") );
}
else
{
@@ -4435,16 +4435,16 @@ QString CppCodeCompletion::createTypeInfoString( int line, int column )
{
if( !BuiltinTypes::isBuiltin( type.resultType ) )
{
- typeInfoString += type->fullNameChain() + QString( i18n(" (unresolved) ") );
+ typeInfoString += type->fullNameChain() + TQString( i18n(" (unresolved) ") );
}
else
{
- typeInfoString += type->fullNameChain() + ", " + BuiltinTypes::comment( type.resultType ) + QString( i18n(" (builtin type) ") );
+ typeInfoString += type->fullNameChain() + ", " + BuiltinTypes::comment( type.resultType ) + TQString( i18n(" (builtin type) ") );
}
}
else
{
- typeInfoString += QString( i18n(" (unresolved) ") );
+ typeInfoString += TQString( i18n(" (unresolved) ") );
}
}
@@ -4458,16 +4458,16 @@ QString CppCodeCompletion::createTypeInfoString( int line, int column )
return typeInfoString;
}
-bool CppCodeCompletion::getIncludeInfo( int line, QString& includeFileName, QString& includeFilePath, bool& usedProjectFiles )
+bool CppCodeCompletion::getIncludeInfo( int line, TQString& includeFileName, TQString& includeFilePath, bool& usedProjectFiles )
{
bool isIncludeDirective = false;
- QString lineText = getText( line, 0, line+1, 0 );
- QRegExp includeRx( "(?:#include[\\s]*(?:\\\"|\\<))([^\\n]*)(\\\"|\\>)" );
+ TQString lineText = getText( line, 0, line+1, 0 );
+ TQRegExp includeRx( "(?:#include[\\s]*(?:\\\"|\\<))([^\\n]*)(\\\"|\\>)" );
if( includeRx.search( lineText ) != -1 ) {
//It is an include-directive. The regular expression captures the string, and the closing sign('"' or '>').
isIncludeDirective = true;
usedProjectFiles = false;
- QStringList captured = includeRx.capturedTexts();
+ TQStringList captured = includeRx.capturedTexts();
if( captured.size() == 3 ) {
Dependence d;
d.first = captured[1];