diff options
Diffstat (limited to 'languages/cpp/cppnewclassdlg.cpp')
-rw-r--r-- | languages/cpp/cppnewclassdlg.cpp | 318 |
1 files changed, 159 insertions, 159 deletions
diff --git a/languages/cpp/cppnewclassdlg.cpp b/languages/cpp/cppnewclassdlg.cpp index 14d3cd49..db4d0160 100644 --- a/languages/cpp/cppnewclassdlg.cpp +++ b/languages/cpp/cppnewclassdlg.cpp @@ -146,7 +146,7 @@ TQStringList& gres( TQStringList &list, const TQRegExp & rx, const TQString & af TQStringList::Iterator it = list.begin(); while ( it != list.end() ) { - ( *it ).tqreplace( rx, after ); + ( *it ).replace( rx, after ); ++it; } return list; @@ -226,13 +226,13 @@ void CppNewClassDialog::classNameChanged( const TQString &text ) default: ; } - header = header.tqreplace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" ); + header = header.replace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" ); header_edit->setText( header ); } if ( !implementationModified ) { TQString implementation; - if ( str.tqcontains( "template" ) ) + if ( str.contains( "template" ) ) implementation = str + "_impl" + interface_suffix; else implementation = str + implementation_suffix; @@ -247,7 +247,7 @@ void CppNewClassDialog::classNameChanged( const TQString &text ) default: ; } - implementation = implementation.tqreplace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" ); + implementation = implementation.replace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" ); implementation_edit->setText( implementation ); } } @@ -279,9 +279,9 @@ void CppNewClassDialog::baseclassname_changed( const TQString &text ) } else { - if ( header.tqcontains( TQRegExp( "::" ) ) ) - header = header.mid( header.tqfindRev( TQRegExp( "::" ) ) + 2 ); - header = header.tqreplace( TQRegExp( " *<.*>" ), "" ); + if ( header.contains( TQRegExp( "::" ) ) ) + header = header.mid( header.findRev( TQRegExp( "::" ) ) + 2 ); + header = header.replace( TQRegExp( " *<.*>" ), "" ); header += interface_suffix; switch ( gen_config->superCase() ) @@ -516,23 +516,23 @@ void CppNewClassDialog::remBaseClassOnly() void CppNewClassDialog::remClassFromAdv( TQString text ) { // Strip off namespace qualification - if ( text.tqcontains( "::" ) ) - text = text.mid( text.tqfindRev( "::" ) + 2 ); + if ( text.contains( "::" ) ) + text = text.mid( text.findRev( "::" ) + 2 ); removeTemplateParams( text ); TQListViewItem *it = 0; - if ( ( it = access_view->tqfindItem( text, 0 ) ) ) + if ( ( it = access_view->findItem( text, 0 ) ) ) delete it; - if ( ( it = methods_view->tqfindItem( text, 0 ) ) ) + if ( ( it = methods_view->findItem( text, 0 ) ) ) delete it; - if ( ( it = constructors_view->tqfindItem( text, 0 ) ) ) + if ( ( it = constructors_view->findItem( text, 0 ) ) ) { /// @todo changing constructors text in constructors_cpp_edit // and constructors_h_edit must be implemented /* int *para = new int(1); int *index = new int(1); - if (constructors_cpp_edit->tqfind(text + "(", true, false, true, para, index)) + if (constructors_cpp_edit->find(text + "(", true, false, true, para, index)) { qWarning("%s( found", text.latin1()); if (para) constructors_cpp_edit->removeParagraph(*para); @@ -615,19 +615,19 @@ void CppNewClassDialog::currBaseSelected( TQListViewItem *it ) basename_edit->setText( it->text( 0 ) ); baseinclude_edit->setText( it->text( 3 ) ); scope_box->setCurrentItem( it->text( 2 ).toInt() ); - if ( it->text( 1 ).tqcontains( "private" ) ) + if ( it->text( 1 ).contains( "private" ) ) private_button->setChecked( true ); else private_button->setChecked( false ); - if ( it->text( 1 ).tqcontains( "protected" ) ) + if ( it->text( 1 ).contains( "protected" ) ) protected_button->setChecked( true ); else protected_button->setChecked( false ); - if ( it->text( 1 ).tqcontains( "public" ) ) + if ( it->text( 1 ).contains( "public" ) ) public_button->setChecked( true ); else public_button->setChecked( false ); - if ( it->text( 1 ).tqcontains( "virtual" ) ) + if ( it->text( 1 ).contains( "virtual" ) ) virtual_box->setChecked( true ); else virtual_box->setChecked( false ); @@ -704,7 +704,7 @@ void CppNewClassDialog::updateConstructorsOrder() while ( it.current() ) { - if ( ( c_it = constructors_view->tqfindItem( it.current() ->text( 0 ), 0 ) ) ) + if ( ( c_it = constructors_view->findItem( it.current() ->text( 0 ), 0 ) ) ) { c_it->moveItem( fc_it ); fc_it = c_it; @@ -796,11 +796,11 @@ void CppNewClassDialog::parseClass( TQString clName, TQString inheritance ) TQStringList clNamespace = currNamespace; bool clFullQualified = false; - if ( clName.tqcontains( "::" ) ) + if ( clName.contains( "::" ) ) { // Full qualified, override imported namespace clFullQualified = true; - int splitpoint = clName.tqfindRev( "::" ); + int splitpoint = clName.findRev( "::" ); clNamespace = TQStringList::split( "::", clName.left( splitpoint ) ); clName = clName.mid( splitpoint + 2 ); } @@ -875,13 +875,13 @@ void CppNewClassDialog::parseClass( TQString clName, TQString inheritance ) TQString inhModifier; //protected inheritance gives protected attributes - if ( inheritance.tqcontains( "protected" ) ) + if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; //private inheritance gives private attributes - else if ( inheritance.tqcontains( "private" ) ) + else if ( inheritance.contains( "private" ) ) inhModifier = "private"; //public inheritance gives protected and public attributes - else if ( inheritance.tqcontains( "public" ) ) + else if ( inheritance.contains( "public" ) ) inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; addToUpgradeList( access_slots, *methodIt, inhModifier ); } @@ -896,13 +896,13 @@ void CppNewClassDialog::parseClass( TQString clName, TQString inheritance ) // see what modifier is given for the base class TQString inhModifier; //protected inheritance gives protected methods - if ( inheritance.tqcontains( "protected" ) ) + if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; //private inheritance gives private methods - else if ( inheritance.tqcontains( "private" ) ) + else if ( inheritance.contains( "private" ) ) inhModifier = "private"; //public inheritance gives protected and public methods - else if ( inheritance.tqcontains( "public" ) ) + else if ( inheritance.contains( "public" ) ) inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; addToUpgradeList( access_methods, *methodIt, inhModifier ); } @@ -917,13 +917,13 @@ void CppNewClassDialog::parseClass( TQString clName, TQString inheritance ) { TQString inhModifier; //protected inheritance gives protected attributes - if ( inheritance.tqcontains( "protected" ) ) + if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; //private inheritance gives private attributes - else if ( inheritance.tqcontains( "private" ) ) + else if ( inheritance.contains( "private" ) ) inhModifier = "private"; //public inheritance gives protected and public attributes - else if ( inheritance.tqcontains( "public" ) ) + else if ( inheritance.contains( "public" ) ) inhModifier = ( *varIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; addToUpgradeList( access_attrs, *varIt, inhModifier ); } @@ -937,8 +937,8 @@ bool CppNewClassDialog::isConstructor( TQString className, const FunctionDom &me if ( ( className == method->name() ) ) { qWarning( "1x" ); - if ( ( method->argumentList().count() == 1 ) && ( m_part->formatModelItem( method->argumentList() [ 0 ].data() ).tqcontains( TQRegExp( " *(const)? *" + className + " *& *" ) ) ) ) - // if ( method->asString().tqcontains(TQRegExp(className + "\\s*\\(\\s*(const)?\\s*" + className + "\\s*&[A-Za-z_0-9\\s]*\\)", true, false)) ) + if ( ( method->argumentList().count() == 1 ) && ( m_part->formatModelItem( method->argumentList() [ 0 ].data() ).contains( TQRegExp( " *(const)? *" + className + " *& *" ) ) ) ) + // if ( method->asString().contains(TQRegExp(className + "\\s*\\(\\s*(const)?\\s*" + className + "\\s*&[A-Za-z_0-9\\s]*\\)", true, false)) ) return false; else return true; @@ -955,7 +955,7 @@ void CppNewClassDialog::addToConstructorsList( TQCheckListItem *myClass, Functio void CppNewClassDialog::addToMethodsList( TQListViewItem *tqparent, FunctionDom method ) { PCheckListItem<FunctionDom> *it = new PCheckListItem<FunctionDom>( method, tqparent, m_part->formatModelItem( method.data() ), TQCheckListItem::CheckBox ); - method->isAbstract() ? it->setText( 1, i18n( "tqreplace" ) ) : it->setText( 1, i18n( "extend" ) ); + method->isAbstract() ? it->setText( 1, i18n( "replace" ) ) : it->setText( 1, i18n( "extend" ) ); } void CppNewClassDialog::addToUpgradeList( TQListViewItem *tqparent, FunctionDom method, TQString modifier ) @@ -977,11 +977,11 @@ void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance ) TQStringList clNamespace = currNamespace; bool clFullQualified = false; - if ( clName.tqcontains( "::" ) ) + if ( clName.contains( "::" ) ) { // Full qualified, override imported namespace clFullQualified = true; - int splitpoint = clName.tqfindRev( "::" ); + int splitpoint = clName.findRev( "::" ); clNamespace = TQStringList::split( "::", clName.left( splitpoint ) ); clName = clName.mid( splitpoint + 2 ); } @@ -1034,13 +1034,13 @@ void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance ) TQString inhModifier; //protected inheritance gives protected attributes - if ( inheritance.tqcontains( "protected" ) ) + if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; //private inheritance gives private attributes - else if ( inheritance.tqcontains( "private" ) ) + else if ( inheritance.contains( "private" ) ) inhModifier = "private"; //public inheritance gives protected and public attributes - else if ( inheritance.tqcontains( "public" ) ) + else if ( inheritance.contains( "public" ) ) inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; addToUpgradeList( access_slots, *methodIt, inhModifier ); } @@ -1055,13 +1055,13 @@ void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance ) //see what modifier is given for the base class TQString inhModifier; //protected inheritance gives protected methods - if ( inheritance.tqcontains( "protected" ) ) + if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; //private inheritance gives private methods - else if ( inheritance.tqcontains( "private" ) ) + else if ( inheritance.contains( "private" ) ) inhModifier = "private"; //public inheritance gives protected and public methods - else if ( inheritance.tqcontains( "public" ) ) + else if ( inheritance.contains( "public" ) ) inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; addToUpgradeList( access_methods, *methodIt, inhModifier ); } @@ -1076,13 +1076,13 @@ void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance ) { TQString inhModifier; //protected inheritance gives protected attributes - if ( inheritance.tqcontains( "protected" ) ) + if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; //private inheritance gives private attributes - else if ( inheritance.tqcontains( "private" ) ) + else if ( inheritance.contains( "private" ) ) inhModifier = "private"; //public inheritance gives protected and public attributes - else if ( inheritance.tqcontains( "public" ) ) + else if ( inheritance.contains( "public" ) ) inhModifier = ( *varIt ) ->access() == CodeModelItem::Public ? "public" : "protected"; addToUpgradeList( access_attrs, *varIt, inhModifier ); } @@ -1111,7 +1111,7 @@ void CppNewClassDialog::clearConstructorsList( bool clean ) TQListViewItemIterator it( constructors_view ); while ( it.current() ) { - if ( ! currBaseClasses.tqcontains(it.current().text(0)) ) + if ( ! currBaseClasses.contains(it.current().text(0)) ) delete it.current(); ++it; } @@ -1149,7 +1149,7 @@ void CppNewClassDialog::setAccessForBase( TQString baseclass, TQString newAccess { TQListViewItem * base; - if ( ( base = access_view->tqfindItem( baseclass, 0 ) ) ) + if ( ( base = access_view->findItem( baseclass, 0 ) ) ) { TQListViewItemIterator it( base ); while ( it.current() ) @@ -1211,7 +1211,7 @@ void CppNewClassDialog::extendFunctionality() void CppNewClassDialog::replaceFunctionality() { if ( methods_view->selectedItem() ) - methods_view->selectedItem() ->setText( 1, i18n( "tqreplace" ) ); + methods_view->selectedItem() ->setText( 1, i18n( "replace" ) ); } void CppNewClassDialog::selectall_button_clicked() @@ -1313,13 +1313,13 @@ bool CppNewClassDialog::ClassGenerator::validateInput() { className = dlg.classname_edit->text().simplifyWhiteSpace(); TQString temp = className; - className.tqreplace( TQRegExp( "template *<.*> *(class *)?" ), "" ); - templateStr = temp.tqreplace( TQRegExp( TQRegExp_escape( className ) ), "" ); - templateStr.tqreplace( TQRegExp( " *class *$" ), "" ); + className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" ); + templateStr = temp.replace( TQRegExp( TQRegExp_escape( className ) ), "" ); + templateStr.replace( TQRegExp( " *class *$" ), "" ); templateParams = templateStr; - templateParams.tqreplace( TQRegExp( "^ *template *" ), "" ); - templateParams.tqreplace( TQRegExp( " *class *" ), "" ); + templateParams.replace( TQRegExp( "^ *template *" ), "" ); + templateParams.replace( TQRegExp( " *class *" ), "" ); templateParams.simplifyWhiteSpace(); if ( className.isEmpty() ) @@ -1342,7 +1342,7 @@ bool CppNewClassDialog::ClassGenerator::validateInput() } /// \FIXME - if ( ( header.tqfind( '/' ) != -1 || implementation.tqfind( '/' ) != -1 ) && !( dlg.m_part->project() ->options() & KDevProject::UsesTQMakeBuildSystem) ) + if ( ( header.find( '/' ) != -1 || implementation.find( '/' ) != -1 ) && !( dlg.m_part->project() ->options() & KDevProject::UsesTQMakeBuildSystem) ) { KMessageBox::error( &dlg, i18n( "Generated files will always be added to the " "active directory, so you must not give an " @@ -1482,14 +1482,14 @@ void CppNewClassDialog::ClassGenerator::common_text() if ( !dlg.constructors_h_edit->text().isEmpty() ) { advConstructorsHeader = " " + dlg.constructors_h_edit->text(); - advConstructorsHeader.tqreplace( TQRegExp( "\n" ), "\n " ); + advConstructorsHeader.replace( TQRegExp( "\n" ), "\n " ); } if ( !dlg.constructors_cpp_edit->text().isEmpty() ) { advConstructorsSource = dlg.constructors_cpp_edit->text(); } - advConstructorsHeader.tqreplace( TQRegExp( "[\\n ]*$" ), TQString() ); - advConstructorsSource.tqreplace( TQRegExp( "[\\n ]*$" ), TQString() ); + advConstructorsHeader.replace( TQRegExp( "[\\n ]*$" ), TQString() ); + advConstructorsSource.replace( TQRegExp( "[\\n ]*$" ), TQString() ); //advanced method overriding @@ -1572,7 +1572,7 @@ void CppNewClassDialog::ClassGenerator::common_text() *adv_h += "\n\n";*/ TQString methodName = curr_m->item() ->name(); - if ( !methodName.tqcontains( TQRegExp( "^[a-zA-z_]" ) ) ) + if ( !methodName.contains( TQRegExp( "^[a-zA-z_]" ) ) ) methodName = "operator" + methodName; *adv_h += " using " + curr_m->tqparent() ->tqparent() ->text( 0 ) + "::" + methodName + ";\n"; } @@ -1581,13 +1581,13 @@ void CppNewClassDialog::ClassGenerator::common_text() } TQRegExp e( "[\\n ]*$" ); - advH_public.tqreplace( e, TQString() ); - advH_public_slots.tqreplace( e, TQString() ); - advH_protected.tqreplace( e, TQString() ); - advH_protected_slots.tqreplace( e, TQString() ); - advH_private.tqreplace( e, TQString() ); - advH_private_slots.tqreplace( e, TQString() ); - advCpp.tqreplace( e, TQString() ); + advH_public.replace( e, TQString() ); + advH_public_slots.replace( e, TQString() ); + advH_protected.replace( e, TQString() ); + advH_protected_slots.replace( e, TQString() ); + advH_private.replace( e, TQString() ); + advH_private_slots.replace( e, TQString() ); + advCpp.replace( e, TQString() ); } void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method, @@ -1596,7 +1596,7 @@ void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method /* if ((*adv_h).isEmpty()) *adv_h += "\n\n";*/ TQString methodName = method->name(); - if ( !methodName.tqcontains( TQRegExp( "^[a-zA-z_]" ) ) ) + if ( !methodName.contains( TQRegExp( "^[a-zA-z_]" ) ) ) methodName = "operator" + methodName; *adv_h += " " + ( method->isVirtual() ? TQString( "virtual " ) : TQString( "" ) ) + ( method->isStatic() ? TQString( "static " ) : TQString( "" ) ) @@ -1657,8 +1657,8 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() classImpl = FileTemplate::read( dlg.m_part, fi.extension( true ) ); } - classImpl.tqreplace( TQRegExp( "\\$MODULE\\$" ), module ); - classImpl.tqreplace( TQRegExp( "\\$FILENAME\\$" ), basefilename ); + classImpl.replace( TQRegExp( "\\$MODULE\\$" ), module ); + classImpl.replace( TQRegExp( "\\$FILENAME\\$" ), basefilename ); if ( objc ) { @@ -1689,7 +1689,7 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() } TQString relPath; - for ( int i = implementation.tqfindRev( '/' ); i != -1; i = implementation.tqfindRev( '/', --i ) ) + for ( int i = implementation.findRev( '/' ); i != -1; i = implementation.findRev( '/', --i ) ) relPath += "../"; TQString constructors = ( advConstructorsSource.isEmpty() ? TQString( "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::$CLASSNAME$($ARGS$)\n" @@ -1787,22 +1787,22 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() baseInitializer += "\n"; } - constructors.tqreplace( TQRegExp( "\\$BASEINITIALIZER\\$" ), baseInitializer ); - constructors.tqreplace( TQRegExp( "\\$CLASSNAME\\$" ), className ); + constructors.replace( TQRegExp( "\\$BASEINITIALIZER\\$" ), baseInitializer ); + constructors.replace( TQRegExp( "\\$CLASSNAME\\$" ), className ); // qWarning("NEW CLASS: constructors = %s", constructors.latin1()); if ( templateStr.isEmpty() ) { - constructors.tqreplace( TQRegExp( "\\$TEMPLATESTR\\$\\n" ), "" ); - constructors.tqreplace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), "" ); + constructors.replace( TQRegExp( "\\$TEMPLATESTR\\$\\n" ), "" ); + constructors.replace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), "" ); } else { - constructors.tqreplace( TQRegExp( "\\$TEMPLATESTR\\$" ), templateStr ); - constructors.tqreplace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), templateParams ); - classImpl.tqreplace( TQRegExp( "#include \"\\$HEADER\\$\"\\n" ), "" ); + constructors.replace( TQRegExp( "\\$TEMPLATESTR\\$" ), templateStr ); + constructors.replace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), templateParams ); + classImpl.replace( TQRegExp( "#include \"\\$HEADER\\$\"\\n" ), "" ); } // qWarning("NEW CLASS: constructors = %s", constructors.latin1()); - constructors.tqreplace( TQRegExp( "\\$ARGS\\$" ), argsCpp ); + constructors.replace( TQRegExp( "\\$ARGS\\$" ), argsCpp ); // qWarning("NEW CLASS: constructors = %s", constructors.latin1()); @@ -1810,18 +1810,18 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() TQString hp = relPath + header; beautifySource( classImpl, hp, className, namespaceBeg, constructors, advCpp, namespaceEnd, implementation ); - classImpl.tqreplace( TQRegExp( "\\$HEADER\\$" ), relPath + header ); - classImpl.tqreplace( TQRegExp( "\\$CLASSNAME\\$" ), className ); - classImpl.tqreplace( TQRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg ); - classImpl.tqreplace( TQRegExp( "\\$CONSTRUCTORDEFINITIONS\\$" ), constructors ); - classImpl.tqreplace( TQRegExp( "\\$DEFINITIONS\\$" ), advCpp ); - classImpl.tqreplace( TQRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd ); - classImpl.tqreplace( TQRegExp( "\\$FILENAME\\$" ), implementation ); + classImpl.replace( TQRegExp( "\\$HEADER\\$" ), relPath + header ); + classImpl.replace( TQRegExp( "\\$CLASSNAME\\$" ), className ); + classImpl.replace( TQRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg ); + classImpl.replace( TQRegExp( "\\$CONSTRUCTORDEFINITIONS\\$" ), constructors ); + classImpl.replace( TQRegExp( "\\$DEFINITIONS\\$" ), advCpp ); + classImpl.replace( TQRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd ); + classImpl.replace( TQRegExp( "\\$FILENAME\\$" ), implementation ); if ( ( dlg.m_part->project() ) && ( childClass || qobject ) && ( dlg.m_part->project() ->options() & KDevProject::UsesAutotoolsBuildSystem ) ) { TQString tqmoc = header; - tqmoc.tqreplace( TQRegExp( "\\..*" ), ".tqmoc" ); + tqmoc.replace( TQRegExp( "\\..*" ), ".tqmoc" ); classImpl += "#include \"" + tqmoc + "\"\n"; } @@ -1868,8 +1868,8 @@ void CppNewClassDialog::ClassGenerator::gen_interface() classIntf = FileTemplate::read( dlg.m_part, fi.extension( true ) ); } - classIntf.tqreplace( TQRegExp( "\\$MODULE\\$" ), module ); - classIntf.tqreplace( TQRegExp( "\\$FILENAME\\$" ), basefilename ); + classIntf.replace( TQRegExp( "\\$MODULE\\$" ), module ); + classIntf.replace( TQRegExp( "\\$FILENAME\\$" ), basefilename ); if ( objc ) { @@ -1911,21 +1911,21 @@ void CppNewClassDialog::ClassGenerator::gen_interface() switch ( dlg.gen_config->defCase() ) { case ClassGeneratorConfig::UpperCase: - headerGuard = namespaceStr.upper() + header.mid( header.tqfindRev( "/" )+1 ).upper(); + headerGuard = namespaceStr.upper() + header.mid( header.findRev( "/" )+1 ).upper(); break; case ClassGeneratorConfig::LowerCase: - headerGuard = namespaceStr.lower() + header.mid( header.tqfindRev( "/" )+1 ).lower(); + headerGuard = namespaceStr.lower() + header.mid( header.findRev( "/" )+1 ).lower(); break; case ClassGeneratorConfig::SameAsFileCase: - headerGuard = dlg.header_edit->text().mid( dlg.header_edit->text().tqfindRev( "/" )+1 ); + headerGuard = dlg.header_edit->text().mid( dlg.header_edit->text().findRev( "/" )+1 ); break; case ClassGeneratorConfig::SameAsClassCase: - headerGuard = namespaceStr + header.mid( header.tqfindRev( "/" )+1 ); + headerGuard = namespaceStr + header.mid( header.findRev( "/" )+1 ); break; } - headerGuard.tqreplace( TQRegExp( "\\." ), "_" ); - headerGuard.tqreplace( TQRegExp( "::" ), "_" ); + headerGuard.replace( TQRegExp( "\\." ), "_" ); + headerGuard.replace( TQRegExp( "::" ), "_" ); TQString includeBaseHeader; if( dlg.m_part->qtBuildConfig()->isUsed() ) { @@ -1988,13 +1988,13 @@ void CppNewClassDialog::ClassGenerator::gen_interface() { if ( inheritance != " : " ) inheritance += ", "; - if ( it.current() ->text( 1 ).tqcontains( "virtual" ) ) + if ( it.current() ->text( 1 ).contains( "virtual" ) ) inheritance += "virtual "; - if ( it.current() ->text( 1 ).tqcontains( "public" ) ) + if ( it.current() ->text( 1 ).contains( "public" ) ) inheritance += "public "; - if ( it.current() ->text( 1 ).tqcontains( "protected" ) ) + if ( it.current() ->text( 1 ).contains( "protected" ) ) inheritance += "protected "; - if ( it.current() ->text( 1 ).tqcontains( "private" ) ) + if ( it.current() ->text( 1 ).contains( "private" ) ) inheritance += "private "; inheritance += it.current() ->text( 0 ); } @@ -2008,8 +2008,8 @@ void CppNewClassDialog::ClassGenerator::gen_interface() TQString( " $CLASSNAME$($ARGS$);" ) : advConstructorsHeader ) + TQString( "\n\n ~$CLASSNAME$();" ); - constructors.tqreplace( TQRegExp( "\\$CLASSNAME\\$" ), className ); - constructors.tqreplace( TQRegExp( "\\$ARGS\\$" ), argsH ); + constructors.replace( TQRegExp( "\\$CLASSNAME\\$" ), className ); + constructors.replace( TQRegExp( "\\$ARGS\\$" ), argsH ); TQString qobjectStr; if ( childClass || qobject ) @@ -2026,30 +2026,30 @@ void CppNewClassDialog::ClassGenerator::gen_interface() advH_protected, advH_protected_slots, advH_private, advH_private_slots, namespaceEnd ); - classIntf.tqreplace( TQRegExp( "\\$HEADERGUARD\\$" ), headerGuard ); - classIntf.tqreplace( TQRegExp( "\\$INCLUDEBASEHEADER\\$" ), includeBaseHeader ); - classIntf.tqreplace( TQRegExp( "\\$AUTHOR\\$" ), author ); - classIntf.tqreplace( TQRegExp( "\\$DOC\\$" ), doc ); - classIntf.tqreplace( TQRegExp( "\\$TEMPLATE\\$" ), templateStr ); - classIntf.tqreplace( TQRegExp( "\\$CLASSNAME\\$" ), className ); + classIntf.replace( TQRegExp( "\\$HEADERGUARD\\$" ), headerGuard ); + classIntf.replace( TQRegExp( "\\$INCLUDEBASEHEADER\\$" ), includeBaseHeader ); + classIntf.replace( TQRegExp( "\\$AUTHOR\\$" ), author ); + classIntf.replace( TQRegExp( "\\$DOC\\$" ), doc ); + classIntf.replace( TQRegExp( "\\$TEMPLATE\\$" ), templateStr ); + classIntf.replace( TQRegExp( "\\$CLASSNAME\\$" ), className ); if ( dlg.baseclasses_view->childCount() > 0 ) - classIntf.tqreplace( TQRegExp( "\\$BASECLASS\\$" ), dlg.baseclasses_view->firstChild() ->text( 0 ) ); - classIntf.tqreplace( TQRegExp( "\\$INHERITANCE\\$" ), inheritance ); - classIntf.tqreplace( TQRegExp( "\\$TQOBJECT\\$" ), qobjectStr ); - classIntf.tqreplace( TQRegExp( "\\$ARGS\\$" ), argsH ); - classIntf.tqreplace( TQRegExp( "\\$FILENAME\\$" ), header ); - classIntf.tqreplace( TQRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg ); - classIntf.tqreplace( TQRegExp( "\\$CONSTRUCTORDECLARATIONS\\$" ), constructors ); - classIntf.tqreplace( TQRegExp( "\\$PUBLICDECLARATIONS\\$" ), advH_public ); - classIntf.tqreplace( TQRegExp( "\\$PUBLICSLOTS\\$" ), advH_public_slots ); - classIntf.tqreplace( TQRegExp( "\\$PROTECTEDDECLARATIONS\\$" ), TQString( "protected:\n" ) + advH_protected ); - classIntf.tqreplace( TQRegExp( "\\$PROTECTEDSLOTS\\$" ), TQString( "protected slots:\n" ) + advH_protected_slots ); - classIntf.tqreplace( TQRegExp( "\\$PRIVATEDECLARATIONS\\$" ), TQString( "private:\n" ) + advH_private ); - classIntf.tqreplace( TQRegExp( "\\$PRIVATESLOTS\\$" ), TQString( "private slots:\n" ) + advH_private_slots ); - classIntf.tqreplace( TQRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd ); + classIntf.replace( TQRegExp( "\\$BASECLASS\\$" ), dlg.baseclasses_view->firstChild() ->text( 0 ) ); + classIntf.replace( TQRegExp( "\\$INHERITANCE\\$" ), inheritance ); + classIntf.replace( TQRegExp( "\\$TQOBJECT\\$" ), qobjectStr ); + classIntf.replace( TQRegExp( "\\$ARGS\\$" ), argsH ); + classIntf.replace( TQRegExp( "\\$FILENAME\\$" ), header ); + classIntf.replace( TQRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg ); + classIntf.replace( TQRegExp( "\\$CONSTRUCTORDECLARATIONS\\$" ), constructors ); + classIntf.replace( TQRegExp( "\\$PUBLICDECLARATIONS\\$" ), advH_public ); + classIntf.replace( TQRegExp( "\\$PUBLICSLOTS\\$" ), advH_public_slots ); + classIntf.replace( TQRegExp( "\\$PROTECTEDDECLARATIONS\\$" ), TQString( "protected:\n" ) + advH_protected ); + classIntf.replace( TQRegExp( "\\$PROTECTEDSLOTS\\$" ), TQString( "protected slots:\n" ) + advH_protected_slots ); + classIntf.replace( TQRegExp( "\\$PRIVATEDECLARATIONS\\$" ), TQString( "private:\n" ) + advH_private ); + classIntf.replace( TQRegExp( "\\$PRIVATESLOTS\\$" ), TQString( "private slots:\n" ) + advH_private_slots ); + classIntf.replace( TQRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd ); if ( !templateStr.isEmpty() && (!headeronly) ) - classIntf.tqreplace( TQRegExp( "#endif" ), "#include \"" + dlg.implementation_edit->text() + "\"\n\n#endif" ); + classIntf.replace( TQRegExp( "#endif" ), "#include \"" + dlg.implementation_edit->text() + "\"\n\n#endif" ); if ( dlg.gen_config->reformat_box->isChecked() ) { @@ -2081,45 +2081,45 @@ void CppNewClassDialog::ClassGenerator::beautifyHeader( TQString &templ, TQStrin TQString &namespaceEnd ) { if ( headerGuard.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$HEADERGUARD\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$HEADERGUARD\\$[\\n ]*" ), TQString() ); if ( includeBaseHeader.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$INCLUDEBASEHEADER\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$INCLUDEBASEHEADER\\$[\\n ]*" ), TQString() ); if ( author.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$AUTHOR\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$AUTHOR\\$[\\n ]*" ), TQString() ); if ( doc.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$DOC\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$DOC\\$[\\n ]*" ), TQString() ); if ( className.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString() ); if ( templateStr.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$TEMPLATE\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$TEMPLATE\\$[\\n ]*" ), TQString() ); if ( baseclass.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$BASECLASS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$BASECLASS\\$[\\n ]*" ), TQString() ); if ( inheritance.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$INHERITANCE\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$INHERITANCE\\$[\\n ]*" ), TQString() ); if ( qobjectStr.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$TQOBJECT\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$TQOBJECT\\$[\\n ]*" ), TQString() ); if ( args.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$ARGS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$ARGS\\$[\\n ]*" ), TQString() ); if ( header.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString() ); if ( namespaceBeg.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString() ); if ( constructors.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$CONSTRUCTORDECLARATIONS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$CONSTRUCTORDECLARATIONS\\$[\\n ]*" ), TQString() ); if ( advH_public.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$PUBLICDECLARATIONS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$PUBLICDECLARATIONS\\$[\\n ]*" ), TQString() ); if ( advH_public_slots.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$PUBLICSLOTS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$PUBLICSLOTS\\$[\\n ]*" ), TQString() ); if ( advH_protected.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$PROTECTEDDECLARATIONS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$PROTECTEDDECLARATIONS\\$[\\n ]*" ), TQString() ); if ( advH_protected_slots.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$PROTECTEDSLOTS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$PROTECTEDSLOTS\\$[\\n ]*" ), TQString() ); if ( advH_private.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$PRIVATEDECLARATIONS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$PRIVATEDECLARATIONS\\$[\\n ]*" ), TQString() ); if ( advH_private_slots.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$PRIVATESLOTS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$PRIVATESLOTS\\$[\\n ]*" ), TQString() ); if ( namespaceEnd.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString() ); } @@ -2127,19 +2127,19 @@ void CppNewClassDialog::ClassGenerator::beautifySource( TQString &templ, TQStrin TQString &constructors, TQString &advCpp, TQString &namespaceEnd, TQString &implementation ) { if ( header.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$HEADER\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$HEADER\\$[\\n ]*" ), TQString() ); if ( className.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString() ); if ( namespaceBeg.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString() ); if ( constructors.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$CONSTRUCTORDEFINITIONS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$CONSTRUCTORDEFINITIONS\\$[\\n ]*" ), TQString() ); if ( advCpp.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$DEFINITIONS\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$DEFINITIONS\\$[\\n ]*" ), TQString() ); if ( namespaceEnd.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString() ); if ( implementation.isEmpty() ) - templ.tqreplace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString() ); + templ.replace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString() ); } TQString CppNewClassDialog::classNameFormatted( ) @@ -2150,7 +2150,7 @@ TQString CppNewClassDialog::classNameFormatted( ) TQString CppNewClassDialog::classNameFormatted( const TQString &name ) { TQString temp = name.simplifyWhiteSpace(); - return temp.tqreplace( TQRegExp( "template *<.*> *(class *)?" ), "" ); + return temp.replace( TQRegExp( "template *<.*> *(class *)?" ), "" ); } @@ -2163,9 +2163,9 @@ TQString CppNewClassDialog::templateStrFormatted( const TQString &name ) { TQString className = name.simplifyWhiteSpace(); TQString temp = className; - className.tqreplace( TQRegExp( "template *<.*> *(class *)?" ), "" ); - TQString templateStr = temp.tqreplace( TQRegExp( TQRegExp_escape( className ) ), "" ); - templateStr.tqreplace( TQRegExp( " *class *$" ), "" ); + className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" ); + TQString templateStr = temp.replace( TQRegExp( TQRegExp_escape( className ) ), "" ); + templateStr.replace( TQRegExp( " *class *$" ), "" ); return templateStr; } @@ -2178,13 +2178,13 @@ TQString CppNewClassDialog::templateParamsFormatted( const TQString &name ) { TQString className = name.simplifyWhiteSpace(); TQString temp = className; - className.tqreplace( TQRegExp( "template *<.*> *(class *)?" ), "" ); - TQString templateStr = temp.tqreplace( TQRegExp( TQRegExp_escape( className ) ), "" ); - templateStr.tqreplace( TQRegExp( " *class *$" ), "" ); + className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" ); + TQString templateStr = temp.replace( TQRegExp( TQRegExp_escape( className ) ), "" ); + templateStr.replace( TQRegExp( " *class *$" ), "" ); TQString templateParams = templateStr; - templateParams.tqreplace( TQRegExp( "^ *template *" ), "" ); - templateParams.tqreplace( TQRegExp( " *class *" ), "" ); + templateParams.replace( TQRegExp( "^ *template *" ), "" ); + templateParams.replace( TQRegExp( " *class *" ), "" ); templateParams.simplifyWhiteSpace(); return templateParams; @@ -2194,19 +2194,19 @@ TQString CppNewClassDialog::templateActualParamsFormatted( const TQString & name { TQString className = name.simplifyWhiteSpace(); TQString temp = className; - className.tqreplace( TQRegExp( "<.*> *" ), "" ); - TQString templateStr = temp.tqreplace( TQRegExp( TQRegExp_escape( className ) ), "" ); + className.replace( TQRegExp( "<.*> *" ), "" ); + TQString templateStr = temp.replace( TQRegExp( TQRegExp_escape( className ) ), "" ); return templateStr; } void CppNewClassDialog::removeTemplateParams( TQString & name ) { - name.tqreplace( TQRegExp( "<.*> *" ), "" ); + name.replace( TQRegExp( "<.*> *" ), "" ); } bool CppNewClassDialog::isDestructor( TQString className, const FunctionDom &method ) { - if ( m_part->formatModelItem( method.data() ).tqcontains( TQRegExp( " *~ *" + className ) ) ) + if ( m_part->formatModelItem( method.data() ).contains( TQRegExp( " *~ *" + className ) ) ) return true; return false; } @@ -2218,4 +2218,4 @@ void CppNewClassDialog::headeronly_box_stateChanged(int val) #include "cppnewclassdlg.moc" -//kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on +//kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on |