From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: TQt4 port kdevelop This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- buildtools/qmake/qmakescopeitem.cpp | 142 ++++++++++++++++++------------------ 1 file changed, 71 insertions(+), 71 deletions(-) (limited to 'buildtools/qmake/qmakescopeitem.cpp') diff --git a/buildtools/qmake/qmakescopeitem.cpp b/buildtools/qmake/qmakescopeitem.cpp index 73edf730..157b0894 100644 --- a/buildtools/qmake/qmakescopeitem.cpp +++ b/buildtools/qmake/qmakescopeitem.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2006 by Andreas Pakulat * * apaku@gmx.de * * * -* Part of this file is taken from Qt Designer. * +* Part of this file is taken from TQt Designer. * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -28,13 +28,13 @@ * Class qProjectItem */ -qProjectItem::qProjectItem( Type type, TQListView *parent, const TQString &text ) - : TQListViewItem( parent, text ), typ( type ) +qProjectItem::qProjectItem( Type type, TQListView *tqparent, const TQString &text ) + : TQListViewItem( tqparent, text ), typ( type ) {} -qProjectItem::qProjectItem( Type type, qProjectItem *parent, const TQString &text ) - : TQListViewItem( parent, text ), typ( type ) +qProjectItem::qProjectItem( Type type, qProjectItem *tqparent, const TQString &text ) + : TQListViewItem( tqparent, text ), typ( type ) {} @@ -43,7 +43,7 @@ qProjectItem::qProjectItem( Type type, qProjectItem *parent, const TQString &tex * Class GroupItem */ -GroupItem::GroupItem( TQListView *lv, GroupType type, const TQString &text, QMakeScopeItem* spitem ) +GroupItem::GroupItem( TQListView *lv, GroupType type, const TQString &text, TQMakeScopeItem* spitem ) : qProjectItem( Group, lv, text ) { this->owner = spitem; @@ -302,24 +302,24 @@ FileItem::FileItem( TQListView *lv, const TQString &text ) /* - * Class QMakeScopeItem + * Class TQMakeScopeItem */ -QMakeScopeItem::QMakeScopeItem( TQListView *parent, const TQString &text, Scope* s, TrollProjectWidget* widget ) - : qProjectItem( Subproject, parent, text ), scope( s ), m_widget( widget ) +TQMakeScopeItem::TQMakeScopeItem( TQListView *tqparent, const TQString &text, Scope* s, TrollProjectWidget* widget ) + : qProjectItem( Subproject, tqparent, text ), scope( s ), m_widget( widget ) { - // configuration.m_template = QTMP_APPLICATION; + // configuration.m_template = TQTMP_APPLICATION; init(); } -QMakeScopeItem::QMakeScopeItem( QMakeScopeItem *parent, const TQString &text, Scope* s ) - : qProjectItem( Subproject, parent, text ), scope( s ), m_widget( parent->m_widget ) +TQMakeScopeItem::TQMakeScopeItem( TQMakeScopeItem *tqparent, const TQString &text, Scope* s ) + : qProjectItem( Subproject, tqparent, text ), scope( s ), m_widget( tqparent->m_widget ) { init(); } -QMakeScopeItem::~QMakeScopeItem() +TQMakeScopeItem::~TQMakeScopeItem() { TQMap::iterator it; for ( it = groups.begin() ; it != groups.end() ; ++it ) @@ -331,35 +331,35 @@ QMakeScopeItem::~QMakeScopeItem() } -TQString QMakeScopeItem::relativePath() +TQString TQMakeScopeItem::relativePath() { - if( !scope || !scope->parent() ) + if( !scope || !scope->tqparent() ) return ""; if( scope->scopeType() == Scope::ProjectScope ) { - if( scope->parent() && scope->parent()->variableValues("SUBDIRS").contains( URLUtil::relativePathToFile( scope->parent()->projectDir(), scope->projectDir()+"/"+scope->fileName() ) ) ) + if( scope->tqparent() && scope->tqparent()->variableValues("SUBDIRS").tqcontains( URLUtil::relativePathToFile( scope->tqparent()->projectDir(), scope->projectDir()+"/"+scope->fileName() ) ) ) { - return URLUtil::relativePathToFile( scope->parent()->projectDir(), scope->projectDir()+"/"+scope->fileName() ); + return URLUtil::relativePathToFile( scope->tqparent()->projectDir(), scope->projectDir()+"/"+scope->fileName() ); }else { return URLUtil::getRelativePath( m_widget->projectDirectory(), scope->projectDir() ); } }else - return static_cast( parent() ) ->relativePath(); -// if( !scope->parent() ) + return static_cast( tqparent() ) ->relativePath(); +// if( !scope->tqparent() ) // return ""; -// else if ( !scope->parent()->parent() || scope->scopeType() != Scope::ProjectScope ) +// else if ( !scope->tqparent()->tqparent() || scope->scopeType() != Scope::ProjectScope ) // return scope->scopeName(); // else if ( scope->scopeType() == Scope::ProjectScope ) -// return ( static_cast( parent() ) ->relativePath() +// return ( static_cast( tqparent() ) ->relativePath() // + TQString( TQChar( TQDir::separator() ) ) + scope->scopeName() ); // else -// return ( static_cast( parent() ) ->relativePath() ); +// return ( static_cast( tqparent() ) ->relativePath() ); } -TQString QMakeScopeItem::getSharedLibAddObject( TQString basePath ) +TQString TQMakeScopeItem::getSharedLibAddObject( TQString basePath ) { - if ( scope->variableValues( "CONFIG" ).findIndex( "dll" ) != -1 ) + if ( scope->variableValues( "CONFIG" ).tqfindIndex( "dll" ) != -1 ) { TQString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() ); if ( !scope->variableValues( "DESTDIR" ).front().isEmpty() ) @@ -392,7 +392,7 @@ TQString QMakeScopeItem::getSharedLibAddObject( TQString basePath ) return ""; } -TQString QMakeScopeItem::getApplicationObject( TQString basePath ) +TQString TQMakeScopeItem::getApplicationObject( TQString basePath ) { TQString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() ); TQString destdir = scope->resolveVariables( scope->variableValues( "DESTDIR" ).front() ); @@ -419,9 +419,9 @@ TQString QMakeScopeItem::getApplicationObject( TQString basePath ) return tmpPath + TQString( TQChar( TQDir::separator() ) ) + target; } -TQString QMakeScopeItem::getLibAddObject( TQString basePath ) +TQString TQMakeScopeItem::getLibAddObject( TQString basePath ) { - if ( scope->variableValues( "CONFIG" ).findIndex( "dll" ) != -1 ) + if ( scope->variableValues( "CONFIG" ).tqfindIndex( "dll" ) != -1 ) { TQString target = scope->resolveVariables( scope->variableValues( "TARGET" ).front() ); if ( !target.isEmpty() ) @@ -433,8 +433,8 @@ TQString QMakeScopeItem::getLibAddObject( TQString basePath ) return ( "-l" + scope->projectName() ); } } - else if ( scope->variableValues( "CONFIG" ).findIndex( "staticlib" ) != -1 - || scope->variableValues("TEMPLATE").findIndex("lib") != -1 ) + else if ( scope->variableValues( "CONFIG" ).tqfindIndex( "staticlib" ) != -1 + || scope->variableValues("TEMPLATE").tqfindIndex("lib") != -1 ) { TQString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() ); TQString destdir = scope->resolveVariables( scope->variableValues( "DESTDIR" ).front() ); @@ -469,11 +469,11 @@ TQString QMakeScopeItem::getLibAddObject( TQString basePath ) return ( "" ); } -TQString QMakeScopeItem::getLibAddPath( TQString basePath ) +TQString TQMakeScopeItem::getLibAddPath( TQString basePath ) { //PATH only add if shared lib - if ( scope->variableValues( "CONFIG" ).findIndex( "dll" ) == -1 ) return ( "" ); + if ( scope->variableValues( "CONFIG" ).tqfindIndex( "dll" ) == -1 ) return ( "" ); TQString tmpPath = URLUtil::getRelativePath(basePath, scope->projectDir() ); TQString destdir = scope->resolveVariables( scope->variableValues( "DESTDIR" ).front() ); @@ -495,7 +495,7 @@ TQString QMakeScopeItem::getLibAddPath( TQString basePath ) } -TQString QMakeScopeItem::getIncAddPath( TQString basePath ) +TQString TQMakeScopeItem::getIncAddPath( TQString basePath ) { TQString tmpPath = URLUtil::getRelativePath( basePath, scope->projectDir() ); tmpPath = TQDir::cleanDirPath( tmpPath ); @@ -503,7 +503,7 @@ TQString QMakeScopeItem::getIncAddPath( TQString basePath ) return ( tmpPath ); } -void QMakeScopeItem::buildSubTree() +void TQMakeScopeItem::buildSubTree() { TQValueList::const_iterator it; @@ -514,14 +514,14 @@ void QMakeScopeItem::buildSubTree() for ( it = scopes.begin(); it != scopes.end(); ++it ) { if( (*it)->scopeType() != Scope::InvalidScope ) - new QMakeScopeItem( this, ( *it )->scopeName(), ( *it ) ); + new TQMakeScopeItem( this, ( *it )->scopeName(), ( *it ) ); else - kdDebug( 9024 ) << "No QMakeScopeItem created" << endl; + kdDebug( 9024 ) << "No TQMakeScopeItem created" << endl; } } -void QMakeScopeItem::init() +void TQMakeScopeItem::init() { if ( scope->scopeType() == Scope::SimpleScope ) { @@ -540,17 +540,17 @@ void QMakeScopeItem::init() TQStringList tmp = scope->variableValues( "TEMPLATE" ); if( scope->isEnabled() ) { - if ( tmp.findIndex( "subdirs" ) != -1 ) + if ( tmp.tqfindIndex( "subdirs" ) != -1 ) setPixmap( 0, SmallIcon( "folder" ) ); - else if ( tmp.findIndex( "lib" ) != -1 ) + else if ( tmp.tqfindIndex( "lib" ) != -1 ) setPixmap( 0, SmallIcon( "qmake_lib" ) ); else setPixmap( 0, SmallIcon( "qmake_app" ) ); }else { - if ( tmp.findIndex( "subdirs" ) != -1 ) + if ( tmp.tqfindIndex( "subdirs" ) != -1 ) setPixmap( 0, SmallIcon( "folder_grey" ) ); - else if ( tmp.findIndex( "lib" ) != -1 ) + else if ( tmp.tqfindIndex( "lib" ) != -1 ) setPixmap( 0, SmallIcon( "qmake_lib_disabled" ) ); else setPixmap( 0, SmallIcon( "qmake_app_disabled" ) ); @@ -565,19 +565,19 @@ void QMakeScopeItem::init() } } -GroupItem* QMakeScopeItem::createGroupItem( GroupItem::GroupType type, const TQString& label, QMakeScopeItem* scopeitem ) +GroupItem* TQMakeScopeItem::createGroupItem( GroupItem::GroupType type, const TQString& label, TQMakeScopeItem* scopeitem ) { GroupItem * item = new GroupItem( scopeitem->listView(), type, label, scopeitem ); scopeitem->listView() ->takeItem( item ); return item; } -FileItem* QMakeScopeItem::createFileItem( const TQString& name ) +FileItem* TQMakeScopeItem::createFileItem( const TQString& name ) { TQString display = name; if( m_widget->showFilenamesOnly() ) { - int dirSepPos = name.findRev( TQChar( TQDir::separator() ) ); + int dirSepPos = name.tqfindRev( TQChar( TQDir::separator() ) ); if ( dirSepPos != - 1 ) display = name.mid( dirSepPos + 1 ); } @@ -593,9 +593,9 @@ FileItem* QMakeScopeItem::createFileItem( const TQString& name ) return fitem; } -void QMakeScopeItem::buildGroups() +void TQMakeScopeItem::buildGroups() { - if( scope->variableValues("TEMPLATE").findIndex("subdirs") != -1 ) + if( scope->variableValues("TEMPLATE").tqfindIndex("subdirs") != -1 ) return; TQStringList values; @@ -648,7 +648,7 @@ void QMakeScopeItem::buildGroups() item->files.append( createFileItem( *it ) ); } - if ( scope->isQt4Project() ) + if ( scope->isTQt4Project() ) { values = scope->variableValues( "RESOURCES" ); item = createGroupItem( GroupItem::Resources, "RESOURCES", this ); @@ -720,7 +720,7 @@ void QMakeScopeItem::buildGroups() } -void QMakeScopeItem::removeValues( const TQString& var, const TQStringList& values ) +void TQMakeScopeItem::removeValues( const TQString& var, const TQStringList& values ) { for( TQStringList::const_iterator it = values.begin() ; it != values.end(); ++it ) { @@ -728,7 +728,7 @@ void QMakeScopeItem::removeValues( const TQString& var, const TQStringList& valu } } -void QMakeScopeItem::addValues( const TQString& var, const TQStringList& values ) +void TQMakeScopeItem::addValues( const TQString& var, const TQStringList& values ) { for( TQStringList::const_iterator it = values.begin() ; it != values.end(); ++it ) { @@ -736,14 +736,14 @@ void QMakeScopeItem::addValues( const TQString& var, const TQStringList& values } } -void QMakeScopeItem::removeValue( const TQString& var, const TQString& value ) +void TQMakeScopeItem::removeValue( const TQString& var, const TQString& value ) { - if( scope->scopeType() != Scope::IncludeScope && scope->variableValues( var ).findIndex( value ) != -1 ) + if( scope->scopeType() != Scope::IncludeScope && scope->variableValues( var ).tqfindIndex( value ) != -1 ) { - if( scope->variableValuesForOp( var, "+=" ).findIndex(value) != -1 ) + if( scope->variableValuesForOp( var, "+=" ).tqfindIndex(value) != -1 ) { scope->removeFromPlusOp( var, TQStringList( value ) ); - if( scope->variableValues( var ).findIndex( value ) != -1 ) + if( scope->variableValues( var ).tqfindIndex( value ) != -1 ) { scope->addToMinusOp( var, TQStringList( value ) ); } @@ -755,11 +755,11 @@ void QMakeScopeItem::removeValue( const TQString& var, const TQString& value ) } } -void QMakeScopeItem::addValue( const TQString& var, const TQString& value ) +void TQMakeScopeItem::addValue( const TQString& var, const TQString& value ) { - if( scope->scopeType() != Scope::IncludeScope && scope->variableValues( var ).findIndex( value ) == -1 ) + if( scope->scopeType() != Scope::IncludeScope && scope->variableValues( var ).tqfindIndex( value ) == -1 ) { - if( scope->variableValuesForOp( var, "-=" ).findIndex(value) != -1 ) + if( scope->variableValuesForOp( var, "-=" ).tqfindIndex(value) != -1 ) scope->removeFromMinusOp( var, TQStringList( value ) ); else scope->addToPlusOp( var, TQStringList( value ) ); @@ -769,15 +769,15 @@ void QMakeScopeItem::addValue( const TQString& var, const TQString& value ) } } -void QMakeScopeItem::updateValues( const TQString& var, const TQStringList& values ) +void TQMakeScopeItem::updateValues( const TQString& var, const TQStringList& values ) { TQStringList curValues = scope->variableValues( var, (scope->scopeType() != Scope::IncludeScope) ); TQStringList scopeValues = scope->variableValuesForOp( var, "+=" ); for( TQStringList::const_iterator it = curValues.begin(); it != curValues.end(); ++it ) { - if ( values.findIndex( *it ) == -1 ) + if ( values.tqfindIndex( *it ) == -1 ) { - if( scopeValues.findIndex( *it ) != -1 ) + if( scopeValues.tqfindIndex( *it ) != -1 ) { scope->removeFromPlusOp( var, TQStringList( *it ) ); scopeValues.remove( *it ); @@ -787,7 +787,7 @@ void QMakeScopeItem::updateValues( const TQString& var, const TQStringList& valu } for( TQStringList::const_iterator it = values.begin(); it != values.end(); ++it ) { - if ( scopeValues.findIndex( *it ) != -1 ) + if ( scopeValues.tqfindIndex( *it ) != -1 ) { scopeValues.remove(*it); } @@ -802,18 +802,18 @@ void QMakeScopeItem::updateValues( const TQString& var, const TQStringList& valu // kdDebug(9024) << "---------------------------------------" << endl; } -QMakeScopeItem* QMakeScopeItem::projectFileItem() +TQMakeScopeItem* TQMakeScopeItem::projectFileItem() { if( scope->scopeType() != Scope::ProjectScope ) { - QMakeScopeItem* parentitem = dynamic_cast(parent()); - if( parentitem ) - return parentitem->projectFileItem(); + TQMakeScopeItem* tqparentitem = dynamic_cast(tqparent()); + if( tqparentitem ) + return tqparentitem->projectFileItem(); } return this; } -void QMakeScopeItem::reloadProject() +void TQMakeScopeItem::reloadProject() { kdDebug(9024) << "Reloading Project" << endl; TQListViewItem* item = firstChild(); @@ -837,19 +837,19 @@ void QMakeScopeItem::reloadProject() init(); } -void QMakeScopeItem::disableSubprojects( const TQStringList& dirs ) +void TQMakeScopeItem::disableSubprojects( const TQStringList& dirs ) { TQStringList::const_iterator it = dirs.begin(); for( ; it != dirs.end() ; ++it) { - if( scope->variableValues("SUBDIRS").findIndex(*it) != -1 ) + if( scope->variableValues("SUBDIRS").tqfindIndex(*it) != -1 ) { Scope* s = scope->disableSubproject(*it); if( !s ) return; else { - QMakeScopeItem* newitem = new QMakeScopeItem( this, s->scopeName(), s ); + TQMakeScopeItem* newitem = new TQMakeScopeItem( this, s->scopeName(), s ); TQListViewItem* lastitem = firstChild(); while( lastitem && lastitem->nextSibling() ) lastitem = lastitem->nextSibling(); @@ -861,9 +861,9 @@ void QMakeScopeItem::disableSubprojects( const TQStringList& dirs ) } -int QMakeScopeItem::compare( TQListViewItem* i, int , bool ) const +int TQMakeScopeItem::compare( TQListViewItem* i, int , bool ) const { - QMakeScopeItem* other = dynamic_cast(i); + TQMakeScopeItem* other = dynamic_cast(i); if( !i ) return -1; if( other->scope->getNum() < scope->getNum() ) @@ -874,7 +874,7 @@ int QMakeScopeItem::compare( TQListViewItem* i, int , bool ) const return 0; } -TQMap QMakeScopeItem::getLibInfos( TQString basePath ) +TQMap TQMakeScopeItem::getLibInfos( TQString basePath ) { TQMap result; @@ -925,4 +925,4 @@ TQMap QMakeScopeItem::getLibInfos( TQString basePath ) return result; } -// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on +// kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on -- cgit v1.2.1