From 36c36b53a129509d56fdaa0a7c9fcbcacd0c5826 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 10 Aug 2011 06:08:18 +0000 Subject: rename the following methods: tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kommander/editor/resource.cpp | 70 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'kommander/editor/resource.cpp') diff --git a/kommander/editor/resource.cpp b/kommander/editor/resource.cpp index f55c963c..c2ece48b 100644 --- a/kommander/editor/resource.cpp +++ b/kommander/editor/resource.cpp @@ -84,12 +84,12 @@ static TQString makeIndent( int indent ) static TQString entitize( const TQString &s, bool attribute = false ) { TQString s2 = s; - s2 = s2.tqreplace( TQRegExp( "&" ), "&" ); - s2 = s2.tqreplace( TQRegExp( ">" ), ">" ); - s2 = s2.tqreplace( TQRegExp( "<" ), "<" ); + s2 = s2.replace( TQRegExp( "&" ), "&" ); + s2 = s2.replace( TQRegExp( ">" ), ">" ); + s2 = s2.replace( TQRegExp( "<" ), "<" ); if ( attribute ) { - s2 = s2.tqreplace( TQRegExp( "\"" ), """ ); - s2 = s2.tqreplace( TQRegExp( "'" ), "'" ); + s2 = s2.replace( TQRegExp( "\"" ), """ ); + s2 = s2.replace( TQRegExp( "'" ), "'" ); } return s2; } @@ -181,7 +181,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev ) TQString content = stream.read(); if (content.startsWith("#!")) { - content = content.mid(content.tqfind('\n')); + content = content.mid(content.find('\n')); } if ( !doc.setContent( content) ) { // qDebug( TQString("Parse error: ") + errMsg + TQString(" in line %d"), errLine ); @@ -476,7 +476,7 @@ TQString Resource::copy() TQWidget *p = w->parentWidget(); bool save = true; while ( p ) { - if ( tmp.tqfindRef( p ) != -1 ) { + if ( tmp.findRef( p ) != -1 ) { save = false; break; } @@ -580,7 +580,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea const char* className = WidgetFactory::classNameOf( obj ); if ( obj->isA( "CustomWidget" ) ) usedCustomWidgets << TQString( className ); - if ( TQT_BASE_OBJECT(obj) != TQT_BASE_OBJECT(formwindow) && !formwindow->widgets()->tqfind( (TQWidget*)obj ) ) + if ( TQT_BASE_OBJECT(obj) != TQT_BASE_OBJECT(formwindow) && !formwindow->widgets()->find( (TQWidget*)obj ) ) return; // we don't know anything about this thing TQString attributes; @@ -801,7 +801,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) if ( table->inherits( TQDATATABLE_OBJECT_NAME_STRING ) && !columnFields.isEmpty() ) { ts << makeIndent( indent ) << "" << endl; indent++; - ts << makeIndent( indent ) << "" << entitize( *columnFields.tqfind( l[ 0 ] ) ) << "" << endl; + ts << makeIndent( indent ) << "" << entitize( *columnFields.find( l[ 0 ] ) ) << "" << endl; indent--; ts << makeIndent( indent ) << "" << endl; } @@ -984,9 +984,9 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) changed = MetaDataBase::changedProperties( w ); if ( w->isWidgetType() ) { if ( w->inherits( "Spacer" ) ) { - if ( !changed.tqcontains( "tqsizeHint" ) ) + if ( !changed.contains( "tqsizeHint" ) ) changed << "tqsizeHint"; - if ( !changed.tqcontains( "geometry" ) ) + if ( !changed.contains( "geometry" ) ) changed << "geometry"; } } else if ( w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { // #### should be cleaner (RS) @@ -994,9 +994,9 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) } if ( TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(formwindow->mainContainer()) ) { - if ( changed.tqfindIndex( "geometry" ) == -1 ) + if ( changed.findIndex( "geometry" ) == -1 ) changed << "geometry"; - if ( changed.tqfindIndex( "caption" ) == -1 ) + if ( changed.findIndex( "caption" ) == -1 ) changed << "caption"; } @@ -1008,13 +1008,13 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) TQStrList lst = w->tqmetaObject()->propertyNames( !w->inherits( "Spacer" ) ); for ( TQPtrListIterator it( lst ); it.current(); ++it ) { - if ( changed.tqfind( TQString::tqfromLatin1( it.current() ) ) == changed.end() ) + if ( changed.find( TQString::tqfromLatin1( it.current() ) ) == changed.end() ) continue; - if ( saved.tqfind( TQString::tqfromLatin1( it.current() ) ) != saved.end() ) + if ( saved.find( TQString::tqfromLatin1( it.current() ) ) != saved.end() ) continue; saved << TQString::tqfromLatin1( it.current() ); const TQMetaProperty* p = w->tqmetaObject()-> - property( w->tqmetaObject()->tqfindProperty( it.current(), true ), true ); + property( w->tqmetaObject()->findProperty( it.current(), true ), true ); if ( !p || !p->stored( w ) || ( inLayout && qstrcmp( p->name(), "geometry" ) == 0 ) ) continue; if ( w->inherits( TQLABEL_OBJECT_NAME_STRING ) && qstrcmp( p->name(), "pixmap" ) == 0 && @@ -1066,7 +1066,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) void Resource::saveSetProperty( TQObject *w, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent ) { - const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( name, true ), true ); + const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->findProperty( name, true ), true ); TQStrList l( p->valueToKeys( w->property( name ).toInt() ) ); TQString v; for ( uint i = 0; i < l.count(); ++i ) { @@ -1079,7 +1079,7 @@ void Resource::saveSetProperty( TQObject *w, const TQString &name, TQVariant::Ty void Resource::saveEnumProperty( TQObject *w, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent ) { - const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty( name, true ), true ); + const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->findProperty( name, true ), true ); ts << makeIndent( indent ) << "" << p->valueToKey( w->property( name ).toInt() ) << "" << endl; } @@ -1090,7 +1090,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant int num, unum; double dob; TQString comment; - if ( w && formwindow->widgets()->tqfind( (TQWidget*)w ) ) + if ( w && formwindow->widgets()->find( (TQWidget*)w ) ) comment = MetaDataBase::propertyComment( w, name ); switch ( t ) { case TQVariant::String: @@ -1644,7 +1644,7 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *tqparent, TQL */ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQDomElement &e ) { - const TQMetaProperty *p = obj->tqmetaObject()->property( obj->tqmetaObject()->tqfindProperty( prop, true ), true ); + const TQMetaProperty *p = obj->tqmetaObject()->property( obj->tqmetaObject()->findProperty( prop, true ), true ); if ( !obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {// no layouts in metadatabase... (RS) if ( obj->inherits( "CustomWidget" ) ) { @@ -1920,9 +1920,9 @@ void Resource::saveConnections( TQTextStream &ts, int indent ) TQValueList::Iterator it = connections.begin(); for ( ; it != connections.end(); ++it ) { MetaDataBase::Connection conn = *it; - if ( ( knownNames.tqfindIndex( TQString( conn.sender->name() ) ) == -1 && + if ( ( knownNames.findIndex( TQString( conn.sender->name() ) ) == -1 && qstrcmp( conn.sender->name(), "this" ) != 0 ) || - ( knownNames.tqfindIndex( TQString( conn.receiver->name() ) ) == -1 && + ( knownNames.findIndex( TQString( conn.receiver->name() ) ) == -1 && qstrcmp( conn.receiver->name(), "this" ) != 0 ) ) continue; if ( formwindow->isMainContainer( TQT_TQOBJECT((*it).receiver) ) && @@ -2080,7 +2080,7 @@ void Resource::saveCustomWidgets( TQTextStream &ts, int indent ) TQPtrList *lst = MetaDataBase::customWidgets(); for ( MetaDataBase::CustomWidget *w = lst->first(); w; w = lst->next() ) { - if ( usedCustomWidgets.tqfindIndex( w->className ) == -1 ) + if ( usedCustomWidgets.findIndex( w->className ) == -1 ) continue; ts << makeIndent( indent ) << "" << endl; indent++; @@ -2214,7 +2214,7 @@ void Resource::saveTabOrder( TQTextStream &ts, int indent ) indent++; for ( TQWidget *w = l.first(); w; w = l.next() ) { - if ( w->testWState( TQt::WState_ForceHide ) || knownNames.tqfindIndex( w->name() ) == -1 ) + if ( w->testWState( TQt::WState_ForceHide ) || knownNames.findIndex( w->name() ) == -1 ) continue; ts << makeIndent( indent ) << "" << w->name() << "" << endl; } @@ -2547,9 +2547,9 @@ void Resource::saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent ) for ( int i = 0; i < (int)mw->menuBar()->count(); ++i ) { ts << makeIndent( indent ) << "menuBar()->text( mw->menuBar()->idAt( i ) ) ) - << "\" name=\"" << entitize( mw->menuBar()->tqfindItem( mw->menuBar()->idAt( i ) )->popup()->name() ) << "\">" << endl; + << "\" name=\"" << entitize( mw->menuBar()->findItem( mw->menuBar()->idAt( i ) )->popup()->name() ) << "\">" << endl; indent++; - TQMenuItem *m = mw->menuBar()->tqfindItem( mw->menuBar()->idAt( i ) ); + TQMenuItem *m = mw->menuBar()->findItem( mw->menuBar()->idAt( i ) ); if ( !m ) continue; TQPtrList actionList = ( (QDesignerPopupMenu*)m->popup() )->insertedActions(); @@ -2668,7 +2668,7 @@ void Resource::saveFormCode() for ( ; sit != slotList.end(); ++sit ) { MetaDataBase::Slot slot = *sit; TQMap::Iterator it = - functionBodies.tqfind( MetaDataBase::normalizeSlot( (*sit).slot ) ); + functionBodies.find( MetaDataBase::normalizeSlot( (*sit).slot ) ); LanguageInterface::Function func; func.name = slot.slot; func.body = *it; @@ -2700,14 +2700,14 @@ void Resource::saveFormCode() static TQString make_function_pretty( const TQString &s ) { TQString res = s; - if ( res.tqfind( ")" ) - res.tqfind( "(" ) == 1 ) + if ( res.find( ")" ) - res.find( "(" ) == 1 ) return res; - res.tqreplace( TQRegExp( "[(]" ), "( " ); - res.tqreplace( TQRegExp( "[)]" ), " )" ); - res.tqreplace( TQRegExp( "&" ), " &" ); - res.tqreplace( TQRegExp( "[*]" ), " *" ); - res.tqreplace( TQRegExp( "," ), ", " ); - res.tqreplace( TQRegExp( ":" ), " : " ); + res.replace( TQRegExp( "[(]" ), "( " ); + res.replace( TQRegExp( "[)]" ), " )" ); + res.replace( TQRegExp( "&" ), " &" ); + res.replace( TQRegExp( "[*]" ), " *" ); + res.replace( TQRegExp( "," ), ", " ); + res.replace( TQRegExp( ":" ), " : " ); res = res.simplifyWhiteSpace(); return res; } @@ -2747,7 +2747,7 @@ void Resource::loadFunctions( const TQDomElement &e ) ( (*it).returnType.isEmpty() ? TQString( "void" ) : (*it).returnType ) ); - TQMap::Iterator bit = bodies.tqfind( MetaDataBase::normalizeSlot( (*it).slot ) ); + TQMap::Iterator bit = bodies.find( MetaDataBase::normalizeSlot( (*it).slot ) ); if ( bit != bodies.end() ) code += "\n" + *bit + "\n\n"; else -- cgit v1.2.1