diff options
Diffstat (limited to 'languages/cpp/cppnewclassdlg.cpp')
-rw-r--r-- | languages/cpp/cppnewclassdlg.cpp | 776 |
1 files changed, 388 insertions, 388 deletions
diff --git a/languages/cpp/cppnewclassdlg.cpp b/languages/cpp/cppnewclassdlg.cpp index b941b46e..fc338900 100644 --- a/languages/cpp/cppnewclassdlg.cpp +++ b/languages/cpp/cppnewclassdlg.cpp @@ -19,23 +19,23 @@ #include "cppnewclassdlg.h" -#include <qcheckbox.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qradiobutton.h> -#include <qregexp.h> -#include <qtextedit.h> -#include <qrect.h> -#include <qstyle.h> +#include <tqcheckbox.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqradiobutton.h> +#include <tqregexp.h> +#include <tqtextedit.h> +#include <tqrect.h> +#include <tqstyle.h> #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> -#include <qcombobox.h> -#include <qlistview.h> -#include <qpopupmenu.h> -#include <qpushbutton.h> -#include <qtabwidget.h> +#include <tqcombobox.h> +#include <tqlistview.h> +#include <tqpopupmenu.h> +#include <tqpushbutton.h> +#include <tqtabwidget.h> #include <klineedit.h> #include <kdeversion.h> @@ -52,14 +52,14 @@ #include "classgeneratorconfig.h" -QString QRegExp_escape( const QString& str ) +TQString QRegExp_escape( const TQString& str ) { #if QT_VERSION >= 0x030100 - return QRegExp::escape( str ); + return TQRegExp::escape( str ); #else // this block is copyrighted by Trolltech AS (GPL) static const char meta[] = "$()*+.?[\\]^{|}"; - QString quoted = str; + TQString quoted = str; int i = 0; while ( i < ( int ) quoted.length() ) @@ -72,7 +72,7 @@ QString QRegExp_escape( const QString& str ) #endif } -CppNewClassDialog::CppNewClassDialog( CppSupportPart *part, QWidget *parent, const char *name ) +CppNewClassDialog::CppNewClassDialog( CppSupportPart *part, TQWidget *parent, const char *name ) : CppNewClassDialogBase( parent, name ), myModel( 0 ) { headerModified = false; @@ -81,7 +81,7 @@ CppNewClassDialog::CppNewClassDialog( CppSupportPart *part, QWidget *parent, con m_part = part; // read file template configuration // KDevProject *project = part->project(); - QDomDocument &dom = *part->projectDom(); + TQDomDocument &dom = *part->projectDom(); interface_url = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/interfaceURL" ); implementation_url = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/implementationURL" ); interface_suffix = DomUtil::readEntry( dom, "/cppsupportpart/filetemplates/interfacesuffix", ".h" ); @@ -92,22 +92,22 @@ CppNewClassDialog::CppNewClassDialog( CppSupportPart *part, QWidget *parent, con baseclasses_view->setSorting( -1 ); constructors_view->setSorting( -1 ); - accessMenu = new QPopupMenu( this ); + accessMenu = new TQPopupMenu( this ); accessMenu->insertItem( i18n( "Use as Private" ), - this, SLOT( changeToPrivate() ), 0, 1 ); + this, TQT_SLOT( changeToPrivate() ), 0, 1 ); accessMenu->insertItem( i18n( "Use as Protected" ), - this, SLOT( changeToProtected() ), 0, 2 ); + this, TQT_SLOT( changeToProtected() ), 0, 2 ); accessMenu->insertItem( i18n( "Use as Public" ), - this, SLOT( changeToPublic() ), 0, 3 ); + this, TQT_SLOT( changeToPublic() ), 0, 3 ); accessMenu->insertSeparator(); accessMenu->insertItem( i18n( "Unset" ), - this, SLOT( changeToInherited() ), 0, 5 ); + this, TQT_SLOT( changeToInherited() ), 0, 5 ); - overMenu = new QPopupMenu( this ); + overMenu = new TQPopupMenu( this ); overMenu->insertItem( i18n( "Extend Base Class Functionality" ), - this, SLOT( extendFunctionality() ), 0, 11 ); + this, TQT_SLOT( extendFunctionality() ), 0, 11 ); overMenu->insertItem( i18n( "Replace Base Class Method" ), - this, SLOT( replaceFunctionality() ), 0, 12 ); + this, TQT_SLOT( replaceFunctionality() ), 0, 12 ); compBasename = basename_edit->completionObject(); setCompletionBasename( m_part->codeModel() ); @@ -135,7 +135,7 @@ void CppNewClassDialog::setCompletionBasename( CodeModel *model ) // Import selected namespace without qualifier NamespaceDom namespaceDom = model->globalNamespace(); - QStringList::const_iterator it = currNamespace.begin(); + TQStringList::const_iterator it = currNamespace.begin(); for ( ; it != currNamespace.end() ; ++it ) { if ( ! namespaceDom->hasNamespace( *it ) ) @@ -149,16 +149,16 @@ void CppNewClassDialog::setCompletionBasename( CodeModel *model ) addCompletionBasenameNamespacesRecursive( model->globalNamespace() ); - QStringList compItems = compBasename->items(); + TQStringList compItems = compBasename->items(); it = compItems.begin(); for ( int i = 0; it != compItems.end(); ++it, ++i ) kdDebug( 9007 ) << "compBasename->items()[" << i << "] = \"" << *it << "\"" << endl; } -QStringList& gres( QStringList &list, const QRegExp & rx, const QString & after ) +TQStringList& gres( TQStringList &list, const TQRegExp & rx, const TQString & after ) { - QStringList::Iterator it = list.begin(); + TQStringList::Iterator it = list.begin(); while ( it != list.end() ) { ( *it ).replace( rx, after ); @@ -168,18 +168,18 @@ QStringList& gres( QStringList &list, const QRegExp & rx, const QString & after } void CppNewClassDialog::addCompletionBasenameNamespacesRecursive( const NamespaceDom & namespaceDom, - const QString & namespaceParent ) + const TQString & namespaceParent ) { // Add classes of this namespace - QStringList classList = sortedNameList( namespaceDom -> classList() ); + TQStringList classList = sortedNameList( namespaceDom -> classList() ); if ( ! namespaceParent.isEmpty() ) { #if QT_VERSION >= 0x030200 - classList.gres( QRegExp( "^" ), namespaceParent + "::" ); + classList.gres( TQRegExp( "^" ), namespaceParent + "::" ); #else - gres( classList, QRegExp( "^" ), namespaceParent + "::" ); + gres( classList, TQRegExp( "^" ), namespaceParent + "::" ); #endif } @@ -193,7 +193,7 @@ void CppNewClassDialog::addCompletionBasenameNamespacesRecursive( const Namespac for ( ; it != namespaceList.end() ; ++it ) { - QString fullNamespace; + TQString fullNamespace; if ( ! namespaceParent.isEmpty() ) fullNamespace = namespaceParent + "::"; @@ -204,13 +204,13 @@ void CppNewClassDialog::addCompletionBasenameNamespacesRecursive( const Namespac } -void CppNewClassDialog::setCompletionNamespaceRecursive( const NamespaceDom & namespaceDom, const QString & namespaceParent ) +void CppNewClassDialog::setCompletionNamespaceRecursive( const NamespaceDom & namespaceDom, const TQString & namespaceParent ) { NamespaceList namespaceList = namespaceDom->namespaceList(); NamespaceList::const_iterator it = namespaceList.begin(); for ( ; it != namespaceList.end() ; ++it ) { - QString fullNamespace; + TQString fullNamespace; if ( ! namespaceParent.isEmpty() ) fullNamespace = namespaceParent + "::"; @@ -222,20 +222,20 @@ void CppNewClassDialog::setCompletionNamespaceRecursive( const NamespaceDom & na } } -void CppNewClassDialog::nameHandlerChanged( const QString &text ) +void CppNewClassDialog::nameHandlerChanged( const TQString &text ) { DomUtil::writeEntry( *m_part->projectDom(), "/cppsupportpart/newclass/filenamesetting", text ); m_parse = text; classNameChanged( classname_edit->text() ); } -void CppNewClassDialog::classNameChanged( const QString &text ) +void CppNewClassDialog::classNameChanged( const TQString &text ) { - QString str = text; + TQString str = text; if ( !headerModified ) { - QString header = str + interface_suffix; + TQString header = str + interface_suffix; switch ( gen_config->fileCase() ) { case ClassGeneratorConfig::LowerCase: @@ -247,12 +247,12 @@ void CppNewClassDialog::classNameChanged( const QString &text ) default: ; } - header = header.replace( QRegExp( "(template *<.*> *)?(class +)?" ), "" ); + header = header.replace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" ); header_edit->setText( header ); } if ( !implementationModified ) { - QString implementation; + TQString implementation; if ( str.contains( "template" ) ) implementation = str + "_impl" + interface_suffix; else @@ -268,23 +268,23 @@ void CppNewClassDialog::classNameChanged( const QString &text ) default: ; } - implementation = implementation.replace( QRegExp( "(template *<.*> *)?(class +)?" ), "" ); + implementation = implementation.replace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" ); implementation_edit->setText( implementation ); } } -void CppNewClassDialog::classNamespaceChanged( const QString &text ) +void CppNewClassDialog::classNamespaceChanged( const TQString &text ) { - currNamespace = QStringList::split( QString( "::" ), text ); + currNamespace = TQStringList::split( TQString( "::" ), text ); setCompletionBasename( m_part -> codeModel() ); reloadAdvancedInheritance( true ); } -void CppNewClassDialog::baseclassname_changed( const QString &text ) +void CppNewClassDialog::baseclassname_changed( const TQString &text ) { if ( ( basename_edit->hasFocus() ) && ( !baseincludeModified ) ) { - QString header = text; + TQString header = text; // handle Qt classes in a special way. if( m_part->qtBuildConfig()->isUsed() && header.startsWith( "Q" ) ) @@ -295,14 +295,14 @@ void CppNewClassDialog::baseclassname_changed( const QString &text ) } else if( m_part->qtBuildConfig()->version() == 4 ) { - // 1:1, e.g QObject is #include <QObject> + // 1:1, e.g TQObject is #include <TQObject> } } else { - if ( header.contains( QRegExp( "::" ) ) ) - header = header.mid( header.findRev( QRegExp( "::" ) ) + 2 ); - header = header.replace( QRegExp( " *<.*>" ), "" ); + if ( header.contains( TQRegExp( "::" ) ) ) + header = header.mid( header.findRev( TQRegExp( "::" ) ) + 2 ); + header = header.replace( TQRegExp( " *<.*>" ), "" ); header += interface_suffix; switch ( gen_config->superCase() ) @@ -322,7 +322,7 @@ void CppNewClassDialog::baseclassname_changed( const QString &text ) } } -void CppNewClassDialog::baseIncludeChanged( const QString &text ) +void CppNewClassDialog::baseIncludeChanged( const TQString &text ) { if ( baseinclude_edit->hasFocus() ) { @@ -395,17 +395,17 @@ void CppNewClassDialog::checkQWidgetInheritance( int val ) if ( baseclasses_view->childCount() == 0 ) { addBaseClass(); - basename_edit->setText( "QWidget" ); + basename_edit->setText( "TQWidget" ); } /* constructors_cpp_edit->append(classname_edit->text() + "::" + classname_edit->text() + - "(QWidget *parent, const char *name):\n QWidget(parent, name)\n{\n}\n"); - constructors_h_edit->append(classname_edit->text() + "(QWidget *parent, const char *name);\n");*/ + "(TQWidget *parent, const char *name):\n TQWidget(parent, name)\n{\n}\n"); + constructors_h_edit->append(classname_edit->text() + "(TQWidget *parent, const char *name);\n");*/ } if ( val && ( baseclasses_view->childCount() > 1 ) ) if ( KMessageBox::warningContinueCancel( this, - i18n( "Multiple inheritance requires QObject derivative to be first and unique in base class list." ), - i18n( "Warning" ), KStdGuiItem::cont(), "Check QWidget inheritance rules" ) == KMessageBox::Cancel ) + i18n( "Multiple inheritance requires TQObject derivative to be first and unique in base class list." ), + i18n( "Warning" ), KStdGuiItem::cont(), "Check TQWidget inheritance rules" ) == KMessageBox::Cancel ) childclass_box->setChecked( false ); } @@ -417,7 +417,7 @@ void CppNewClassDialog::qobject_box_stateChanged( int val ) if ( baseclasses_view->childCount() == 0 ) { addBaseClass(); - basename_edit->setText( "QObject" ); + basename_edit->setText( "TQObject" ); } @@ -451,7 +451,7 @@ void CppNewClassDialog::accept() { ClassGenerator generator( *this ); if ( generator.generate() ) - QDialog::accept(); + TQDialog::accept(); } @@ -481,12 +481,12 @@ void CppNewClassDialog::addBaseClass() baseincludeModified = false; if ( baseclasses_view->selectedItem() ) baseclasses_view->selectedItem() ->setSelected( false ); - QListViewItem* it = new QListViewItem( baseclasses_view, baseclasses_view->lastItem(), - QString::null, "public", QString( "%1" ).arg( scope_box->currentItem() ), QString::null, "false" ); + TQListViewItem* it = new TQListViewItem( baseclasses_view, baseclasses_view->lastItem(), + TQString::null, "public", TQString( "%1" ).arg( scope_box->currentItem() ), TQString::null, "false" ); setStateOfInheritanceEditors( true ); public_button->setChecked( true ); virtual_box->setChecked( false ); - basename_edit->setText( QString::null ); + basename_edit->setText( TQString::null ); basename_edit->setFocus(); baseclasses_view->setSelected( it, true ); } @@ -501,7 +501,7 @@ void CppNewClassDialog::remBaseClass() } if ( baseclasses_view->selectedItem() ) { - QListViewItem * it = baseclasses_view->selectedItem(); + TQListViewItem * it = baseclasses_view->selectedItem(); remClassFromAdv( it->text( 0 ) ); baseclasses_view->selectedItem() ->setSelected( false ); if ( it->itemBelow() ) @@ -521,7 +521,7 @@ void CppNewClassDialog::remBaseClassOnly() { if ( baseclasses_view->selectedItem() ) { - QListViewItem * it = baseclasses_view->selectedItem(); + TQListViewItem * it = baseclasses_view->selectedItem(); baseclasses_view->selectedItem() ->setSelected( false ); if ( it->itemBelow() ) baseclasses_view->setSelected( it->itemBelow(), true ); @@ -534,14 +534,14 @@ void CppNewClassDialog::remBaseClassOnly() } } -void CppNewClassDialog::remClassFromAdv( QString text ) +void CppNewClassDialog::remClassFromAdv( TQString text ) { // Strip off namespace qualification if ( text.contains( "::" ) ) text = text.mid( text.findRev( "::" ) + 2 ); removeTemplateParams( text ); - QListViewItem *it = 0; + TQListViewItem *it = 0; if ( ( it = access_view->findItem( text, 0 ) ) ) delete it; if ( ( it = methods_view->findItem( text, 0 ) ) ) @@ -562,7 +562,7 @@ void CppNewClassDialog::remClassFromAdv( QString text ) } } -void CppNewClassDialog::currBaseNameChanged( const QString &text ) +void CppNewClassDialog::currBaseNameChanged( const TQString &text ) { if ( baseclasses_view->selectedItem() && ( basename_edit->hasFocus() ) ) { @@ -584,7 +584,7 @@ void CppNewClassDialog::currBasePrivateSet() if ( baseclasses_view->selectedItem() ) { setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "private" ); - baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "private" ) ); + baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + TQString( "private" ) ); } } @@ -593,7 +593,7 @@ void CppNewClassDialog::currBaseProtectedSet() if ( baseclasses_view->selectedItem() ) { setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "protected" ); - baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "protected" ) ); + baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + TQString( "protected" ) ); } } @@ -602,7 +602,7 @@ void CppNewClassDialog::currBasePublicSet() if ( baseclasses_view->selectedItem() ) { setAccessForBase( baseclasses_view->selectedItem() ->text( 0 ), "public" ); - baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + QString( "public" ) ); + baseclasses_view->selectedItem() ->setText( 1, ( virtual_box->isChecked() ? "virtual " : "" ) + TQString( "public" ) ); } } @@ -610,7 +610,7 @@ void CppNewClassDialog::scopeboxActivated( int value ) { if ( baseclasses_view->selectedItem() ) { - baseclasses_view->selectedItem() ->setText( 2, QString( "%1" ).arg( value ) ); + baseclasses_view->selectedItem() ->setText( 2, TQString( "%1" ).arg( value ) ); } } @@ -618,14 +618,14 @@ void CppNewClassDialog::currBaseVirtualChanged( int val ) { if ( baseclasses_view->selectedItem() ) { - baseclasses_view->selectedItem() ->setText( 1, QString( val ? "virtual " : "" ) + - QString( private_button->isChecked() ? "private" : "" ) + - QString( protected_button->isChecked() ? "protected" : "" ) + - QString( public_button->isChecked() ? "public" : "" ) ); + baseclasses_view->selectedItem() ->setText( 1, TQString( val ? "virtual " : "" ) + + TQString( private_button->isChecked() ? "private" : "" ) + + TQString( protected_button->isChecked() ? "protected" : "" ) + + TQString( public_button->isChecked() ? "public" : "" ) ); } } -void CppNewClassDialog::currBaseSelected( QListViewItem *it ) +void CppNewClassDialog::currBaseSelected( TQListViewItem *it ) { if ( it == 0 ) { @@ -671,15 +671,15 @@ void CppNewClassDialog::upbaseclass_button_clicked() } if ( baseclasses_view->selectedItem() ) { - QListViewItem * it = baseclasses_view->selectedItem(); + TQListViewItem * it = baseclasses_view->selectedItem(); if ( it->itemAbove() ) { - QListViewItem * newit; + TQListViewItem * newit; if ( it->itemAbove() ->itemAbove() ) - newit = new QListViewItem( baseclasses_view, it->itemAbove() ->itemAbove(), + newit = new TQListViewItem( baseclasses_view, it->itemAbove() ->itemAbove(), it->text( 0 ), it->text( 1 ), it->text( 2 ), it->text( 3 ), it->text( 4 ) ); else - newit = new QListViewItem( baseclasses_view, it->text( 0 ), it->text( 1 ), + newit = new TQListViewItem( baseclasses_view, it->text( 0 ), it->text( 1 ), it->text( 2 ), it->text( 3 ), it->text( 4 ) ); remBaseClassOnly(); baseclasses_view->setSelected( newit, true ); @@ -701,10 +701,10 @@ void CppNewClassDialog::downbaseclass_button_clicked() } if ( baseclasses_view->selectedItem() ) { - QListViewItem * it = baseclasses_view->selectedItem(); + TQListViewItem * it = baseclasses_view->selectedItem(); if ( it->itemBelow() ) { - QListViewItem * newit = new QListViewItem( baseclasses_view, it->itemBelow(), + TQListViewItem * newit = new TQListViewItem( baseclasses_view, it->itemBelow(), it->text( 0 ), it->text( 1 ), it->text( 2 ), it->text( 3 ), it->text( 3 ) ); remBaseClassOnly(); baseclasses_view->setSelected( newit, true ); @@ -719,9 +719,9 @@ void CppNewClassDialog::downbaseclass_button_clicked() void CppNewClassDialog::updateConstructorsOrder() { - QListViewItemIterator it( baseclasses_view ); - QListViewItem *c_it; - QListViewItem *fc_it = 0; + TQListViewItemIterator it( baseclasses_view ); + TQListViewItem *c_it; + TQListViewItem *fc_it = 0; while ( it.current() ) { @@ -776,18 +776,18 @@ void CppNewClassDialog::changeToPublic() void CppNewClassDialog::changeToInherited() { if ( access_view->selectedItem() ) - access_view->selectedItem() ->setText( 2, QString::null ); + access_view->selectedItem() ->setText( 2, TQString::null ); } -void CppNewClassDialog::newTabSelected( const QString& /*text*/ ) +void CppNewClassDialog::newTabSelected( const TQString& /*text*/ ) { /* if (text == i18n("&Advanced Inheritance")) reloadAdvancedInheritance(true);*/ } -void CppNewClassDialog::newTabSelected( QWidget* /*w*/ ) +void CppNewClassDialog::newTabSelected( TQWidget* /*w*/ ) { - /* if ( QString(w->name()) == QString("tab2")) + /* if ( TQString(w->name()) == TQString("tab2")) { reloadAdvancedInheritance(false); }*/ @@ -800,7 +800,7 @@ void CppNewClassDialog::reloadAdvancedInheritance( bool clean ) clearMethodsList( clean ); clearUpgradeList( clean ); - QListViewItemIterator it( baseclasses_view ); + TQListViewItemIterator it( baseclasses_view ); while ( it.current() ) { if ( ! ( it.current() ->text( 0 ).isEmpty() ) ) @@ -811,10 +811,10 @@ void CppNewClassDialog::reloadAdvancedInheritance( bool clean ) } } -void CppNewClassDialog::parseClass( QString clName, QString inheritance ) +void CppNewClassDialog::parseClass( TQString clName, TQString inheritance ) { // Determine namespace - QStringList clNamespace = currNamespace; + TQStringList clNamespace = currNamespace; bool clFullQualified = false; if ( clName.contains( "::" ) ) @@ -822,26 +822,26 @@ void CppNewClassDialog::parseClass( QString clName, QString inheritance ) // Full qualified, override imported namespace clFullQualified = true; int splitpoint = clName.findRev( "::" ); - clNamespace = QStringList::split( "::", clName.left( splitpoint ) ); + clNamespace = TQStringList::split( "::", clName.left( splitpoint ) ); clName = clName.mid( splitpoint + 2 ); } kdDebug( 9007 ) << "clFullQualified = " << clFullQualified << endl; kdDebug( 9007 ) << "clName = " << clName << endl; - QString debMsg = "clNamespace = "; - for ( QStringList::const_iterator it = clNamespace.begin(); + TQString debMsg = "clNamespace = "; + for ( TQStringList::const_iterator it = clNamespace.begin(); it != clNamespace.end(); ++it ) debMsg += ( *it ) + "::"; kdDebug( 9007 ) << debMsg << endl; - QString templateAdd = templateActualParamsFormatted( clName ); + TQString templateAdd = templateActualParamsFormatted( clName ); removeTemplateParams( clName ); ClassList myClasses; // = m_part->codeModel()->globalNamespace()->classByName(clName); NamespaceDom namespaceDom = m_part->codeModel() ->globalNamespace(); - QStringList::const_iterator namespaceIt = clNamespace.begin(); + TQStringList::const_iterator namespaceIt = clNamespace.begin(); for ( ; namespaceIt != clNamespace.end(); ++namespaceIt ) { if ( ! namespaceDom -> hasNamespace( *namespaceIt ) ) @@ -869,12 +869,12 @@ void CppNewClassDialog::parseClass( QString clName, QString inheritance ) it->templateAddition = templateAdd; PListViewItem<ClassDom> *over = new PListViewItem<ClassDom>( *classIt, methods_view, ( *classIt ) ->name() ); over->templateAddition = templateAdd; - QListViewItem *over_methods = new QListViewItem( over, i18n( "Methods" ) ); - QListViewItem *over_slots = new QListViewItem( over, i18n( "Slots (Qt-specific)" ) ); + TQListViewItem *over_methods = new TQListViewItem( over, i18n( "Methods" ) ); + TQListViewItem *over_slots = new TQListViewItem( over, i18n( "Slots (Qt-specific)" ) ); PListViewItem<ClassDom> *access = new PListViewItem<ClassDom>( *classIt, access_view, ( *classIt ) ->name() ); - QListViewItem *access_methods = new QListViewItem( access, i18n( "Methods" ) ); - QListViewItem *access_slots = new QListViewItem( access, i18n( "Slots (Qt-specific)" ) ); - QListViewItem *access_attrs = new QListViewItem( access, i18n( "Attributes" ) ); + TQListViewItem *access_methods = new TQListViewItem( access, i18n( "Methods" ) ); + TQListViewItem *access_slots = new TQListViewItem( access, i18n( "Slots (Qt-specific)" ) ); + TQListViewItem *access_attrs = new TQListViewItem( access, i18n( "Attributes" ) ); FunctionList functionList = ( *classIt ) ->functionList(); for ( FunctionList::const_iterator methodIt = functionList.begin(); @@ -894,7 +894,7 @@ void CppNewClassDialog::parseClass( QString clName, QString inheritance ) { addToMethodsList( over_slots, *methodIt ); - QString inhModifier; + TQString inhModifier; //protected inheritance gives protected attributes if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; @@ -915,7 +915,7 @@ void CppNewClassDialog::parseClass( QString clName, QString inheritance ) addToMethodsList( over_methods, *methodIt ); // see what modifier is given for the base class - QString inhModifier; + TQString inhModifier; //protected inheritance gives protected methods if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; @@ -936,7 +936,7 @@ void CppNewClassDialog::parseClass( QString clName, QString inheritance ) { if ( ( *varIt ) ->access() != CodeModelItem::Private ) { - QString inhModifier; + TQString inhModifier; //protected inheritance gives protected attributes if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; @@ -952,14 +952,14 @@ void CppNewClassDialog::parseClass( QString clName, QString inheritance ) } } -bool CppNewClassDialog::isConstructor( QString className, const FunctionDom &method ) +bool CppNewClassDialog::isConstructor( TQString className, const FunctionDom &method ) { // regexp: myclass\\s*\\(\\s*(const)?\\s*myclass\\s*&[A-Za-z_0-9\\s]*\\) is for copy constructors if ( ( className == method->name() ) ) { qWarning( "1x" ); - if ( ( method->argumentList().count() == 1 ) && ( m_part->formatModelItem( method->argumentList() [ 0 ].data() ).contains( QRegExp( " *(const)? *" + className + " *& *" ) ) ) ) - // if ( method->asString().contains(QRegExp(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; @@ -968,34 +968,34 @@ bool CppNewClassDialog::isConstructor( QString className, const FunctionDom &met return false; } -void CppNewClassDialog::addToConstructorsList( QCheckListItem *myClass, FunctionDom method ) +void CppNewClassDialog::addToConstructorsList( TQCheckListItem *myClass, FunctionDom method ) { - new PCheckListItem<FunctionDom>( method, myClass, m_part->formatModelItem( method.data() ), QCheckListItem::RadioButton ); + new PCheckListItem<FunctionDom>( method, myClass, m_part->formatModelItem( method.data() ), TQCheckListItem::RadioButton ); } -void CppNewClassDialog::addToMethodsList( QListViewItem *parent, FunctionDom method ) +void CppNewClassDialog::addToMethodsList( TQListViewItem *parent, FunctionDom method ) { - PCheckListItem<FunctionDom> *it = new PCheckListItem<FunctionDom>( method, parent, m_part->formatModelItem( method.data() ), QCheckListItem::CheckBox ); + PCheckListItem<FunctionDom> *it = new PCheckListItem<FunctionDom>( method, parent, m_part->formatModelItem( method.data() ), TQCheckListItem::CheckBox ); method->isAbstract() ? it->setText( 1, i18n( "replace" ) ) : it->setText( 1, i18n( "extend" ) ); } -void CppNewClassDialog::addToUpgradeList( QListViewItem *parent, FunctionDom method, QString modifier ) +void CppNewClassDialog::addToUpgradeList( TQListViewItem *parent, FunctionDom method, TQString modifier ) { PListViewItem<FunctionDom> *it = new PListViewItem<FunctionDom>( method, parent, m_part->formatModelItem( method.data() ) ); it->setText( 1, modifier ); } -void CppNewClassDialog::addToUpgradeList( QListViewItem *parent, VariableDom attr, QString modifier ) +void CppNewClassDialog::addToUpgradeList( TQListViewItem *parent, VariableDom attr, TQString modifier ) { PListViewItem<VariableDom> *it = new PListViewItem<VariableDom>( attr, parent, m_part->formatModelItem( attr.data() ) ); it->setText( 1, modifier ); } -void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) +void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance ) { // Determine namespace - QStringList clNamespace = currNamespace; + TQStringList clNamespace = currNamespace; bool clFullQualified = false; if ( clName.contains( "::" ) ) @@ -1003,7 +1003,7 @@ void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) // Full qualified, override imported namespace clFullQualified = true; int splitpoint = clName.findRev( "::" ); - clNamespace = QStringList::split( "::", clName.left( splitpoint ) ); + clNamespace = TQStringList::split( "::", clName.left( splitpoint ) ); clName = clName.mid( splitpoint + 2 ); } @@ -1011,7 +1011,7 @@ void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) kdDebug( 9007 ) << "clName = " << clName << endl; kdDebug( 9007 ) << "clNamespace = " << clNamespace.join( "." ) << endl; - QString templateAdd = templateActualParamsFormatted( clName ); + TQString templateAdd = templateActualParamsFormatted( clName ); removeTemplateParams( clName ); myModel = new CodeModel(); @@ -1028,12 +1028,12 @@ void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) it->templateAddition = templateAdd; PListViewItem<ClassDom> *over = new PListViewItem<ClassDom>( *classIt, methods_view, ( *classIt ) ->name() ); over->templateAddition = templateAdd; - QListViewItem *over_methods = new QListViewItem( over, i18n( "Methods" ) ); - QListViewItem *over_slots = new QListViewItem( over, i18n( "Slots (Qt-specific)" ) ); + TQListViewItem *over_methods = new TQListViewItem( over, i18n( "Methods" ) ); + TQListViewItem *over_slots = new TQListViewItem( over, i18n( "Slots (Qt-specific)" ) ); PListViewItem<ClassDom> *access = new PListViewItem<ClassDom>( *classIt, access_view, ( *classIt ) ->name() ); - QListViewItem *access_methods = new QListViewItem( access, i18n( "Methods" ) ); - QListViewItem *access_slots = new QListViewItem( access, i18n( "Slots (Qt-specific)" ) ); - QListViewItem *access_attrs = new QListViewItem( access, i18n( "Attributes" ) ); + TQListViewItem *access_methods = new TQListViewItem( access, i18n( "Methods" ) ); + TQListViewItem *access_slots = new TQListViewItem( access, i18n( "Slots (Qt-specific)" ) ); + TQListViewItem *access_attrs = new TQListViewItem( access, i18n( "Attributes" ) ); FunctionList functionList = ( *classIt ) ->functionList(); for ( FunctionList::const_iterator methodIt = functionList.begin(); @@ -1053,7 +1053,7 @@ void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) { addToMethodsList( over_slots, *methodIt ); - QString inhModifier; + TQString inhModifier; //protected inheritance gives protected attributes if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; @@ -1074,7 +1074,7 @@ void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) addToMethodsList( over_methods, *methodIt ); //see what modifier is given for the base class - QString inhModifier; + TQString inhModifier; //protected inheritance gives protected methods if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; @@ -1095,7 +1095,7 @@ void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) { if ( ( *varIt ) ->access() != CodeModelItem::Private ) { - QString inhModifier; + TQString inhModifier; //protected inheritance gives protected attributes if ( inheritance.contains( "protected" ) ) inhModifier = "protected"; @@ -1113,7 +1113,7 @@ void CppNewClassDialog::parsePCSClass( QString clName, QString inheritance ) void CppNewClassDialog::clear_selection_button_clicked() { - QListViewItemIterator it( constructors_view ); + TQListViewItemIterator it( constructors_view ); while ( it.current() ) { PCheckListItem<FunctionDom> *curr; @@ -1129,7 +1129,7 @@ void CppNewClassDialog::clearConstructorsList( bool clean ) constructors_view->clear(); /* else { - QListViewItemIterator it( constructors_view ); + TQListViewItemIterator it( constructors_view ); while ( it.current() ) { if ( ! currBaseClasses.contains(it.current().text(0)) ) @@ -1151,7 +1151,7 @@ void CppNewClassDialog::clearUpgradeList( bool clean ) access_view->clear(); } -void CppNewClassDialog::setAccessForItem( QListViewItem *curr, QString newAccess, bool isPublic ) +void CppNewClassDialog::setAccessForItem( TQListViewItem *curr, TQString newAccess, bool isPublic ) { if ( newAccess == "public" ) curr->setText( 1, isPublic ? "public" : "protected" ); @@ -1160,19 +1160,19 @@ void CppNewClassDialog::setAccessForItem( QListViewItem *curr, QString newAccess if ( !curr->text( 2 ).isEmpty() ) { if ( ( curr->text( 2 ) == "private" ) && ( ( newAccess == "public" ) || ( newAccess == "protected" ) ) ) - curr->setText( 2, QString::null ); + curr->setText( 2, TQString::null ); if ( ( curr->text( 2 ) == "protected" ) && ( ( newAccess == "public" ) && ( isPublic ) ) ) - curr->setText( 2, QString::null ); + curr->setText( 2, TQString::null ); } } -void CppNewClassDialog::setAccessForBase( QString baseclass, QString newAccess ) +void CppNewClassDialog::setAccessForBase( TQString baseclass, TQString newAccess ) { - QListViewItem * base; + TQListViewItem * base; if ( ( base = access_view->findItem( baseclass, 0 ) ) ) { - QListViewItemIterator it( base ); + TQListViewItemIterator it( base ); while ( it.current() ) { if ( !it.current() ->text( 1 ).isEmpty() ) @@ -1190,7 +1190,7 @@ void CppNewClassDialog::setAccessForBase( QString baseclass, QString newAccess ) } -void CppNewClassDialog::access_view_mouseButtonPressed( int button, QListViewItem * item, const QPoint &p, int /*c*/ ) +void CppNewClassDialog::access_view_mouseButtonPressed( int button, TQListViewItem * item, const TQPoint &p, int /*c*/ ) { if ( item && ( ( button == LeftButton ) || ( button == RightButton ) ) && ( item->depth() > 1 ) ) { @@ -1215,7 +1215,7 @@ void CppNewClassDialog::access_view_mouseButtonPressed( int button, QListViewIte } -void CppNewClassDialog::methods_view_mouseButtonPressed( int button , QListViewItem * item, const QPoint&p , int /*c*/ ) +void CppNewClassDialog::methods_view_mouseButtonPressed( int button , TQListViewItem * item, const TQPoint&p , int /*c*/ ) { if ( item && ( button == RightButton ) && ( item->depth() > 1 ) && ( ! item->text( 1 ).isEmpty() ) ) { @@ -1237,7 +1237,7 @@ void CppNewClassDialog::replaceFunctionality() void CppNewClassDialog::selectall_button_clicked() { - QListViewItemIterator it( constructors_view ); + TQListViewItemIterator it( constructors_view ); while ( it.current() ) { PCheckListItem<FunctionDom> *curr; @@ -1249,17 +1249,17 @@ void CppNewClassDialog::selectall_button_clicked() void CppNewClassDialog::to_constructors_list_clicked() { - QString templateAdd = templateStrFormatted().isEmpty() ? QString::null : templateStrFormatted() + "\n"; - QString constructor_h = classNameFormatted(); - QString constructor_cpp = templateAdd + classNameFormatted() + templateParamsFormatted() + "::" + classNameFormatted(); + TQString templateAdd = templateStrFormatted().isEmpty() ? TQString::null : templateStrFormatted() + "\n"; + TQString constructor_h = classNameFormatted(); + TQString constructor_cpp = templateAdd + classNameFormatted() + templateParamsFormatted() + "::" + classNameFormatted(); constructor_h += "("; constructor_cpp += "("; - QString params_h; - QString params_cpp; - QString base; + TQString params_h; + TQString params_cpp; + TQString base; int unnamed = 1; - QListViewItemIterator it( constructors_view ); + TQListViewItemIterator it( constructors_view ); while ( it.current() ) { PCheckListItem<FunctionDom> *curr; @@ -1278,8 +1278,8 @@ void CppNewClassDialog::to_constructors_list_clicked() params_h += params_h.isEmpty() ? "" : ", "; //fill arguments for both constructor and base class initializer - QString cparams; - QString bparams; + TQString cparams; + TQString bparams; ArgumentList argumentList = curr->item() ->argumentList(); for ( ArgumentList::const_iterator argIt = argumentList.begin(); argIt != argumentList.end(); ++argIt ) @@ -1289,8 +1289,8 @@ void CppNewClassDialog::to_constructors_list_clicked() cparams += ( *argIt ) ->type() + " "; if ( ( *argIt ) ->name().isEmpty() ) { - cparams += QString( "arg%1" ).arg( unnamed ); - bparams += QString( "arg%1" ).arg( unnamed++ ); + cparams += TQString( "arg%1" ).arg( unnamed ); + bparams += TQString( "arg%1" ).arg( unnamed++ ); } else { @@ -1308,7 +1308,7 @@ void CppNewClassDialog::to_constructors_list_clicked() ++it; } - constructor_cpp += params_cpp + ")" + base + QString( "\n{\n}\n\n\n" ); + constructor_cpp += params_cpp + ")" + base + TQString( "\n{\n}\n\n\n" ); constructor_h += params_h + ");\n\n"; constructors_h_edit->append( constructor_h ); @@ -1333,14 +1333,14 @@ void CppNewClassDialog::to_constructors_list_clicked() bool CppNewClassDialog::ClassGenerator::validateInput() { className = dlg.classname_edit->text().simplifyWhiteSpace(); - QString temp = className; - className.replace( QRegExp( "template *<.*> *(class *)?" ), "" ); - templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" ); - templateStr.replace( QRegExp( " *class *$" ), "" ); + TQString temp = className; + className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" ); + templateStr = temp.replace( TQRegExp( QRegExp_escape( className ) ), "" ); + templateStr.replace( TQRegExp( " *class *$" ), "" ); templateParams = templateStr; - templateParams.replace( QRegExp( "^ *template *" ), "" ); - templateParams.replace( QRegExp( " *class *" ), "" ); + templateParams.replace( TQRegExp( "^ *template *" ), "" ); + templateParams.replace( TQRegExp( " *class *" ), "" ); templateParams.simplifyWhiteSpace(); if ( className.isEmpty() ) @@ -1384,13 +1384,13 @@ bool CppNewClassDialog::ClassGenerator::generate() subDir = project->projectDirectory() + "/"; if ( !project->activeDirectory().isEmpty() ){ subDir += project->activeDirectory(); - subDir = QDir::cleanDirPath(subDir); + subDir = TQDir::cleanDirPath(subDir); subDir += "/"; } headerPath = subDir + header; implementationPath = subDir + implementation; - if ( QFileInfo( headerPath ).exists() || QFileInfo( implementationPath ).exists() ) + if ( TQFileInfo( headerPath ).exists() || TQFileInfo( implementationPath ).exists() ) { KMessageBox::error( &dlg, i18n( "KDevelop is not able to add classes " "to existing header or implementation files." ) ); @@ -1399,12 +1399,12 @@ bool CppNewClassDialog::ClassGenerator::generate() if( ( dlg.m_part->project() ->options() & KDevProject::UsesQMakeBuildSystem) ) { - QDir dir( QFileInfo( project->projectDirectory()+QString( QChar( QDir::separator() ) )+project->activeDirectory() + QString( QChar( QDir::separator() ) ) + header ).dirPath() ); + TQDir dir( TQFileInfo( project->projectDirectory()+TQString( TQChar( TQDir::separator() ) )+project->activeDirectory() + TQString( TQChar( TQDir::separator() ) ) + header ).dirPath() ); kdDebug(9024) << "Dir for new file:" << dir.absPath() << endl; if( dir.isRelative() ) dir.convertToAbs(); - QValueStack<QString> dirsToCreate; + TQValueStack<TQString> dirsToCreate; while( !dir.exists() ) { dirsToCreate.push( dir.dirName() ); @@ -1423,8 +1423,8 @@ bool CppNewClassDialog::ClassGenerator::generate() gen_interface(); - QStringList fileList; - QString file; + TQStringList fileList; + TQString file; if( project->activeDirectory().isEmpty() ) file = header; else @@ -1449,7 +1449,7 @@ void CppNewClassDialog::ClassGenerator::common_text() // common namespaceStr = dlg.namespace_edit->text(); - namespaces = QStringList::split( QString( "::" ), namespaceStr ); + namespaces = TQStringList::split( TQString( "::" ), namespaceStr ); childClass = dlg.childclass_box->isChecked(); objc = dlg.objc_box->isChecked(); @@ -1458,25 +1458,25 @@ void CppNewClassDialog::ClassGenerator::common_text() headeronly = dlg.headeronly_box->isChecked(); if ( ( dlg.baseclasses_view->childCount() == 0 ) && childClass ) - new QListViewItem( dlg.baseclasses_view, "QWidget", "public" ); + new TQListViewItem( dlg.baseclasses_view, "TQWidget", "public" ); if ( objc && ( dlg.baseclasses_view->childCount() == 0 ) ) - new QListViewItem( dlg.baseclasses_view, "NSObject", "public" ); + new TQListViewItem( dlg.baseclasses_view, "NSObject", "public" ); if ( dlg.documentation_edit->text().isEmpty() && ( !dlg.gen_config->doc_box->isChecked() ) ) doc = ""; else { - doc = QString( "/**\n" ); + doc = TQString( "/**\n" ); if ( !dlg.documentation_edit->text().isEmpty() ) { doc.append( dlg.documentation_edit->text() ); if ( dlg.gen_config->author_box->isChecked() ) doc.append( "\n\n" ); } - QString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" ); - QString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" ); + TQString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" ); + TQString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" ); if( !email.isEmpty() ) - author += QString( " <%1>" ).arg( email ); + author += TQString( " <%1>" ).arg( email ); if ( dlg.gen_config->author_box->isChecked() ) doc.append( "\t@author " + author + "\n" ); @@ -1485,7 +1485,7 @@ void CppNewClassDialog::ClassGenerator::common_text() if ( !namespaceStr.isEmpty() ) { - for ( QStringList::Iterator it = namespaces.begin(); it != namespaces.end(); ++it ) + for ( TQStringList::Iterator it = namespaces.begin(); it != namespaces.end(); ++it ) { if ( !namespaceBeg.isEmpty() ) namespaceBeg += "\n\n"; @@ -1498,31 +1498,31 @@ void CppNewClassDialog::ClassGenerator::common_text() //advanced constructor creation - advConstructorsHeader = QString::null; - advConstructorsSource = QString::null; + advConstructorsHeader = TQString::null; + advConstructorsSource = TQString::null; if ( !dlg.constructors_h_edit->text().isEmpty() ) { advConstructorsHeader = " " + dlg.constructors_h_edit->text(); - advConstructorsHeader.replace( QRegExp( "\n" ), "\n " ); + advConstructorsHeader.replace( TQRegExp( "\n" ), "\n " ); } if ( !dlg.constructors_cpp_edit->text().isEmpty() ) { advConstructorsSource = dlg.constructors_cpp_edit->text(); } - advConstructorsHeader.replace( QRegExp( "[\\n ]*$" ), QString::null ); - advConstructorsSource.replace( QRegExp( "[\\n ]*$" ), QString::null ); + advConstructorsHeader.replace( TQRegExp( "[\\n ]*$" ), TQString::null ); + advConstructorsSource.replace( TQRegExp( "[\\n ]*$" ), TQString::null ); //advanced method overriding - advH_public = QString::null; - advH_public_slots = QString::null; - advH_protected = QString::null; - advH_protected_slots = QString::null; - advH_private = QString::null; - advH_private_slots = QString::null; - advCpp = QString::null; + advH_public = TQString::null; + advH_public_slots = TQString::null; + advH_protected = TQString::null; + advH_protected_slots = TQString::null; + advH_private = TQString::null; + advH_private_slots = TQString::null; + advCpp = TQString::null; - QListViewItemIterator it( dlg.methods_view ); + TQListViewItemIterator it( dlg.methods_view ); while ( it.current() ) { PCheckListItem<FunctionDom> *curr; @@ -1530,7 +1530,7 @@ void CppNewClassDialog::ClassGenerator::common_text() { if ( curr->isOn() && ( curr->parent() ) && ( curr->parent() ->parent() ) ) { - QString * adv_h = 0; + TQString * adv_h = 0; if ( curr->item() ->access() == CodeModelItem::Private ) adv_h = curr->item() ->isSlot() ? &advH_private_slots : &advH_private; if ( curr->item() ->access() == CodeModelItem::Protected ) @@ -1540,7 +1540,7 @@ void CppNewClassDialog::ClassGenerator::common_text() // if (advCpp.isEmpty()) advCpp += "\n\n"; - QString bcName = curr->parent() ->parent() ->text( 0 ); + TQString bcName = curr->parent() ->parent() ->text( 0 ); PListViewItem<ClassDom> *bc; if ( ( bc = dynamic_cast<PListViewItem<ClassDom>* >( curr->parent() ->parent() ) ) ) { @@ -1554,7 +1554,7 @@ void CppNewClassDialog::ClassGenerator::common_text() } //advanced access control and upgrading - QListViewItemIterator ita( dlg.access_view ); + TQListViewItemIterator ita( dlg.access_view ); while ( ita.current() ) { PListViewItem<VariableDom> *curr; @@ -1563,7 +1563,7 @@ void CppNewClassDialog::ClassGenerator::common_text() { if ( ( !curr->text( 2 ).isEmpty() ) && ( curr->parent() ) && ( curr->parent() ->parent() ) ) { - QString * adv_h = 0; + TQString * adv_h = 0; if ( curr->text( 2 ) == "private" ) adv_h = &advH_private; if ( curr->text( 2 ) == "public" ) @@ -1574,14 +1574,14 @@ void CppNewClassDialog::ClassGenerator::common_text() /* if ((*adv_h).isEmpty()) *adv_h += "\n\n";*/ if ( adv_h ) - *adv_h += QString( " using " ) + curr->parent() ->parent() ->text( 0 ) + "::" + curr->item() ->name() + ";\n"; + *adv_h += TQString( " using " ) + curr->parent() ->parent() ->text( 0 ) + "::" + curr->item() ->name() + ";\n"; } } else if ( ( curr_m = dynamic_cast<PListViewItem<FunctionDom>* >( ita.current() ) ) ) { if ( ( !curr_m->text( 2 ).isEmpty() ) && ( curr_m->parent() ) && ( curr_m->parent() ->parent() ) ) { - QString * adv_h = 0; + TQString * adv_h = 0; if ( curr_m->text( 2 ) == "private" ) adv_h = &advH_private; if ( curr_m->text( 2 ) == "public" ) @@ -1592,8 +1592,8 @@ void CppNewClassDialog::ClassGenerator::common_text() /* if ((*adv_h).isEmpty()) *adv_h += "\n\n";*/ - QString methodName = curr_m->item() ->name(); - if ( !methodName.contains( QRegExp( "^[a-zA-z_]" ) ) ) + TQString methodName = curr_m->item() ->name(); + if ( !methodName.contains( TQRegExp( "^[a-zA-z_]" ) ) ) methodName = "operator" + methodName; *adv_h += " using " + curr_m->parent() ->parent() ->text( 0 ) + "::" + methodName + ";\n"; } @@ -1601,33 +1601,33 @@ void CppNewClassDialog::ClassGenerator::common_text() ++ita; } - QRegExp e( "[\\n ]*$" ); - advH_public.replace( e, QString::null ); - advH_public_slots.replace( e, QString::null ); - advH_protected.replace( e, QString::null ); - advH_protected_slots.replace( e, QString::null ); - advH_private.replace( e, QString::null ); - advH_private_slots.replace( e, QString::null ); - advCpp.replace( e, QString::null ); + TQRegExp e( "[\\n ]*$" ); + advH_public.replace( e, TQString::null ); + advH_public_slots.replace( e, TQString::null ); + advH_protected.replace( e, TQString::null ); + advH_protected_slots.replace( e, TQString::null ); + advH_private.replace( e, TQString::null ); + advH_private_slots.replace( e, TQString::null ); + advCpp.replace( e, TQString::null ); } void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method, - QString className, QString templateStr, QString *adv_h, QString *adv_cpp, bool extend, QString baseClassName ) + TQString className, TQString templateStr, TQString *adv_h, TQString *adv_cpp, bool extend, TQString baseClassName ) { /* if ((*adv_h).isEmpty()) *adv_h += "\n\n";*/ - QString methodName = method->name(); - if ( !methodName.contains( QRegExp( "^[a-zA-z_]" ) ) ) + TQString methodName = method->name(); + if ( !methodName.contains( TQRegExp( "^[a-zA-z_]" ) ) ) methodName = "operator" + methodName; - *adv_h += " " + ( method->isVirtual() ? QString( "virtual " ) : QString( "" ) ) - + ( method->isStatic() ? QString( "static " ) : QString( "" ) ) + *adv_h += " " + ( method->isVirtual() ? TQString( "virtual " ) : TQString( "" ) ) + + ( method->isStatic() ? TQString( "static " ) : TQString( "" ) ) + method->resultType() + " " + methodName + "("; if ( !templateStr.isEmpty() ) * adv_cpp += templateStr + "\n"; *adv_cpp += method->resultType() + " " + className + templateParams + "::" + methodName + "("; - QString bparams; - QString cparams; + TQString bparams; + TQString cparams; int unnamed = 1; ArgumentList argumentList = method->argumentList(); @@ -1639,8 +1639,8 @@ void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method cparams += ( *argIt ) ->type() + " "; if ( ( *argIt ) ->name().isEmpty() ) { - cparams += QString( "arg%1" ).arg( unnamed ); - bparams += QString( "arg%1" ).arg( unnamed++ ); + cparams += TQString( "arg%1" ).arg( unnamed ); + bparams += TQString( "arg%1" ).arg( unnamed++ ); } else { @@ -1664,22 +1664,22 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() // implementation - QString classImpl; - QFileInfo fi( implementationPath ); - QString module = fi.baseName(); - QString basefilename = fi.baseName( true ); + TQString classImpl; + TQFileInfo fi( implementationPath ); + TQString module = fi.baseName(); + TQString basefilename = fi.baseName( true ); if ( dlg.filetemplate_box->isChecked() ) { - /* QDomDocument dom = *dlg.m_part->projectDom(); + /* TQDomDocument dom = *dlg.m_part->projectDom(); if(DomUtil::readBoolEntry(dom,"/cppsupportpart/filetemplates/choosefiles",false)) classImpl = FileTemplate::read(dlg.m_part, DomUtil::readEntry(dom,"/cppsupportpart/filetemplates/implementationURL",""), FileTemplate::Custom); else*/ classImpl = FileTemplate::read( dlg.m_part, fi.extension( true ) ); } - classImpl.replace( QRegExp( "\\$MODULE\\$" ), module ); - classImpl.replace( QRegExp( "\\$FILENAME\\$" ), basefilename ); + classImpl.replace( TQRegExp( "\\$MODULE\\$" ), module ); + classImpl.replace( TQRegExp( "\\$FILENAME\\$" ), basefilename ); if ( objc ) { @@ -1692,16 +1692,16 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() else { classImpl += dlg.gen_config->cppSource(); - /* classImpl += QString( + /* classImpl += TQString( "#include \"$HEADER$\"\n" "\n" "\n") + namespaceBeg - + ( advConstructorsSource.isEmpty() ? QString("$CLASSNAME$::$CLASSNAME$($ARGS$)\n" + + ( advConstructorsSource.isEmpty() ? TQString("$CLASSNAME$::$CLASSNAME$($ARGS$)\n" "$BASEINITIALIZER$" "{\n" "}\n") : advConstructorsSource ) - + QString("\n" + + TQString("\n" "$CLASSNAME$::~$CLASSNAME$()\n" "{\n" "}\n") @@ -1709,15 +1709,15 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() + namespaceEnd;*/ } - QString relPath; + TQString relPath; for ( int i = implementation.findRev( '/' ); i != -1; i = implementation.findRev( '/', --i ) ) relPath += "../"; - QString constructors = ( advConstructorsSource.isEmpty() ? QString( "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::$CLASSNAME$($ARGS$)\n" + TQString constructors = ( advConstructorsSource.isEmpty() ? TQString( "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::$CLASSNAME$($ARGS$)\n" "$BASEINITIALIZER$" "{\n" "}" ) : advConstructorsSource ) - + QString( "\n\n\n" + + TQString( "\n\n\n" "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::~$CLASSNAME$()\n" "{\n" "}\n" ); @@ -1728,26 +1728,26 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() { if( dlg.m_part->qtBuildConfig()->version() == 3 ) { - argsH = "QWidget *parent = 0, const char *name = 0"; - argsCpp = "QWidget *parent, const char *name"; + argsH = "TQWidget *parent = 0, const char *name = 0"; + argsCpp = "TQWidget *parent, const char *name"; } else { - argsH = "QWidget *parent = 0"; - argsCpp = "QWidget *parent"; + argsH = "TQWidget *parent = 0"; + argsCpp = "TQWidget *parent"; } } else if ( qobject ) { if( dlg.m_part->qtBuildConfig()->version() == 3 ) { - argsH = "QObject *parent = 0, const char *name = 0"; - argsCpp = "QObject *parent, const char *name"; + argsH = "TQObject *parent = 0, const char *name = 0"; + argsCpp = "TQObject *parent, const char *name"; } else { - argsH = "QObject *parent = 0"; - argsCpp = "QObject *parent"; + argsH = "TQObject *parent = 0"; + argsCpp = "TQObject *parent"; } } else @@ -1755,25 +1755,25 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() argsH = ""; argsCpp = ""; } - QString baseInitializer; + TQString baseInitializer; if ( childClass && ( dlg.baseclasses_view->childCount() == 0 ) ) { if( dlg.m_part->qtBuildConfig()->version() == 3 ) - baseInitializer = " : QWidget(parent, name)"; + baseInitializer = " : TQWidget(parent, name)"; else - baseInitializer = " : QWidget(parent)"; + baseInitializer = " : TQWidget(parent)"; } else if ( qobject && ( dlg.baseclasses_view->childCount() == 0 ) ) { if( dlg.m_part->qtBuildConfig()->version() == 3 ) - baseInitializer = " : QObject(parent, name)"; + baseInitializer = " : TQObject(parent, name)"; else - baseInitializer = " : QObject(parent)"; + baseInitializer = " : TQObject(parent)"; } else if ( dlg.baseclasses_view->childCount() != 0 ) { - QListViewItemIterator it( dlg.baseclasses_view ); + TQListViewItemIterator it( dlg.baseclasses_view ); baseInitializer += " : "; while ( it.current() ) { @@ -1808,41 +1808,41 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() baseInitializer += "\n"; } - constructors.replace( QRegExp( "\\$BASEINITIALIZER\\$" ), baseInitializer ); - constructors.replace( QRegExp( "\\$CLASSNAME\\$" ), className ); + constructors.replace( TQRegExp( "\\$BASEINITIALIZER\\$" ), baseInitializer ); + constructors.replace( TQRegExp( "\\$CLASSNAME\\$" ), className ); // qWarning("NEW CLASS: constructors = %s", constructors.latin1()); if ( templateStr.isEmpty() ) { - constructors.replace( QRegExp( "\\$TEMPLATESTR\\$\\n" ), "" ); - constructors.replace( QRegExp( "\\$TEMPLATEPARAMS\\$" ), "" ); + constructors.replace( TQRegExp( "\\$TEMPLATESTR\\$\\n" ), "" ); + constructors.replace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), "" ); } else { - constructors.replace( QRegExp( "\\$TEMPLATESTR\\$" ), templateStr ); - constructors.replace( QRegExp( "\\$TEMPLATEPARAMS\\$" ), templateParams ); - classImpl.replace( QRegExp( "#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.replace( QRegExp( "\\$ARGS\\$" ), argsCpp ); + constructors.replace( TQRegExp( "\\$ARGS\\$" ), argsCpp ); // qWarning("NEW CLASS: constructors = %s", constructors.latin1()); //remove unnesessary carriadge returns - QString hp = relPath + header; + TQString hp = relPath + header; beautifySource( classImpl, hp, className, namespaceBeg, constructors, advCpp, namespaceEnd, implementation ); - classImpl.replace( QRegExp( "\\$HEADER\\$" ), relPath + header ); - classImpl.replace( QRegExp( "\\$CLASSNAME\\$" ), className ); - classImpl.replace( QRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg ); - classImpl.replace( QRegExp( "\\$CONSTRUCTORDEFINITIONS\\$" ), constructors ); - classImpl.replace( QRegExp( "\\$DEFINITIONS\\$" ), advCpp ); - classImpl.replace( QRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd ); - classImpl.replace( QRegExp( "\\$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 ) ) { - QString moc = header; - moc.replace( QRegExp( "\\..*" ), ".moc" ); + TQString moc = header; + moc.replace( TQRegExp( "\\..*" ), ".moc" ); classImpl += "#include \"" + moc + "\"\n"; } @@ -1855,13 +1855,13 @@ void CppNewClassDialog::ClassGenerator::gen_implementation() kdDebug( 9007 ) << "implementationPath = " << implementationPath << endl; - QFile ifile( implementationPath ); + TQFile ifile( implementationPath ); if ( !ifile.open( IO_WriteOnly ) ) { KMessageBox::error( &dlg, i18n( "Cannot write to implementation file" ) ); return ; } - QTextStream istream( &ifile ); + TQTextStream istream( &ifile ); istream << classImpl; ifile.close(); @@ -1875,22 +1875,22 @@ void CppNewClassDialog::ClassGenerator::gen_interface() { // interface - QString classIntf; - QFileInfo fi( headerPath ); - QString module = fi.baseName(); - QString basefilename = fi.baseName( true ); + TQString classIntf; + TQFileInfo fi( headerPath ); + TQString module = fi.baseName(); + TQString basefilename = fi.baseName( true ); if ( dlg.filetemplate_box->isChecked() ) { - /* QDomDocument dom = *dlg.m_part->projectDom(); + /* TQDomDocument dom = *dlg.m_part->projectDom(); if(DomUtil::readBoolEntry(dom,"/cppsupportpart/filetemplates/choosefiles",false)) classIntf = FileTemplate::read(dlg.m_part, DomUtil::readEntry(dom,"/cppsupportpart/filetemplates/interfaceURL",""), FileTemplate::Custom); else*/ classIntf = FileTemplate::read( dlg.m_part, fi.extension( true ) ); } - classIntf.replace( QRegExp( "\\$MODULE\\$" ), module ); - classIntf.replace( QRegExp( "\\$FILENAME\\$" ), basefilename ); + classIntf.replace( TQRegExp( "\\$MODULE\\$" ), module ); + classIntf.replace( TQRegExp( "\\$FILENAME\\$" ), basefilename ); if ( objc ) { @@ -1903,32 +1903,32 @@ void CppNewClassDialog::ClassGenerator::gen_interface() else { classIntf += dlg.gen_config->cppHeader(); - /* classIntf = QString("\n" + /* classIntf = TQString("\n" "#ifndef $HEADERGUARD$\n" "#define $HEADERGUARD$\n" "\n" "$INCLUDEBASEHEADER$\n" "\n") + namespaceBeg - + QString("class $CLASSNAME$$INHERITANCE$\n" + + TQString("class $CLASSNAME$$INHERITANCE$\n" "{\n" "$QOBJECT$" "public:\n") - + ( advConstructorsHeader.isEmpty() ? QString(" $CLASSNAME$($ARGS$);\n") : advConstructorsHeader ) - + QString("\n ~$CLASSNAME$();\n") + + ( advConstructorsHeader.isEmpty() ? TQString(" $CLASSNAME$($ARGS$);\n") : advConstructorsHeader ) + + TQString("\n ~$CLASSNAME$();\n") + advH_public - + (advH_public_slots.isEmpty() ? QString::fromLatin1("") : ("\n\npublic slots:" + advH_public_slots)) - + (advH_protected.isEmpty() ? QString::fromLatin1("") : ("\n\nprotected:" + advH_protected)) - + (advH_protected_slots.isEmpty() ? QString::fromLatin1("") : ("\n\nprotected slots:" + advH_protected_slots)) - + (advH_private.isEmpty() ? QString::fromLatin1("") : ("\n\nprivate:" + advH_private)) - + (advH_private_slots.isEmpty() ? QString::fromLatin1("") : ("\n\nprivate slots:" + advH_private_slots)) - + QString("};\n" + + (advH_public_slots.isEmpty() ? TQString::fromLatin1("") : ("\n\npublic slots:" + advH_public_slots)) + + (advH_protected.isEmpty() ? TQString::fromLatin1("") : ("\n\nprotected:" + advH_protected)) + + (advH_protected_slots.isEmpty() ? TQString::fromLatin1("") : ("\n\nprotected slots:" + advH_protected_slots)) + + (advH_private.isEmpty() ? TQString::fromLatin1("") : ("\n\nprivate:" + advH_private)) + + (advH_private_slots.isEmpty() ? TQString::fromLatin1("") : ("\n\nprivate slots:" + advH_private_slots)) + + TQString("};\n" "\n") + namespaceEnd + "#endif\n";*/ } - QString headerGuard; + TQString headerGuard; switch ( dlg.gen_config->defCase() ) { case ClassGeneratorConfig::UpperCase: @@ -1945,24 +1945,24 @@ void CppNewClassDialog::ClassGenerator::gen_interface() break; } - headerGuard.replace( QRegExp( "\\." ), "_" ); - headerGuard.replace( QRegExp( "::" ), "_" ); - QString includeBaseHeader; + headerGuard.replace( TQRegExp( "\\." ), "_" ); + headerGuard.replace( TQRegExp( "::" ), "_" ); + TQString includeBaseHeader; if( dlg.m_part->qtBuildConfig()->isUsed() ) { if( childClass && ( dlg.baseclasses_view->childCount() == 0 ) ) { if( dlg.m_part->qtBuildConfig()->version() == 3 ) - includeBaseHeader = "#include <qwidget.h>"; + includeBaseHeader = "#include <tqwidget.h>"; else - includeBaseHeader = "#include <QWidget>"; + includeBaseHeader = "#include <TQWidget>"; } else if( qobject && ( dlg.baseclasses_view->childCount() == 0 ) ) { if( dlg.m_part->qtBuildConfig()->version() == 3 ) - includeBaseHeader = "#include <qobject.h>"; + includeBaseHeader = "#include <tqobject.h>"; else - includeBaseHeader = "#include <QObject>"; + includeBaseHeader = "#include <TQObject>"; } } @@ -1972,37 +1972,37 @@ void CppNewClassDialog::ClassGenerator::gen_interface() if ( dlg.baseclasses_view->firstChild() ->text( 0 ) != "NSObject" ) if ( !dlg.baseclasses_view->firstChild() ->text( 3 ).isEmpty() ) includeBaseHeader = "#include " - + ( dlg.baseclasses_view->firstChild() ->text( 2 ).toInt() == 0 ? QString( "<" ) : QString( "\"" ) ) + + ( dlg.baseclasses_view->firstChild() ->text( 2 ).toInt() == 0 ? TQString( "<" ) : TQString( "\"" ) ) + dlg.baseclasses_view->firstChild() ->text( 3 ) - + ( dlg.baseclasses_view->firstChild() ->text( 2 ).toInt() == 0 ? QString( ">" ) : QString( "\"" ) ); + + ( dlg.baseclasses_view->firstChild() ->text( 2 ).toInt() == 0 ? TQString( ">" ) : TQString( "\"" ) ); } else { - QListViewItemIterator it( dlg.baseclasses_view ); + TQListViewItemIterator it( dlg.baseclasses_view ); while ( it.current() ) { if ( !it.current() ->text( 0 ).isEmpty() ) if ( !it.current() ->text( 3 ).isEmpty() ) - // if ((!childClass) || (it.current()->text(0) != "QWidget")) - includeBaseHeader += ( includeBaseHeader.isEmpty() ? QString( "" ) : QString( "\n" ) ) + QString::fromLatin1( "#include " ) + - ( it.current() ->text( 2 ).toInt() == 0 ? QString( "<" ) : QString( "\"" ) ) + // if ((!childClass) || (it.current()->text(0) != "TQWidget")) + includeBaseHeader += ( includeBaseHeader.isEmpty() ? TQString( "" ) : TQString( "\n" ) ) + TQString::fromLatin1( "#include " ) + + ( it.current() ->text( 2 ).toInt() == 0 ? TQString( "<" ) : TQString( "\"" ) ) + it.current() ->text( 3 ) - + ( it.current() ->text( 2 ).toInt() == 0 ? QString( ">" ) : QString( "\"" ) ); + + ( it.current() ->text( 2 ).toInt() == 0 ? TQString( ">" ) : TQString( "\"" ) ); ++it; } } - QString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" ); - QString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" ); + TQString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" ); + TQString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" ); if( !email.isEmpty() ) - author += QString( " <%1>" ).arg( email ); + author += TQString( " <%1>" ).arg( email ); - QString inheritance; + TQString inheritance; if ( dlg.baseclasses_view->childCount() > 0 ) { inheritance += " : "; - QListViewItemIterator it( dlg.baseclasses_view ); + TQListViewItemIterator it( dlg.baseclasses_view ); while ( it.current() ) { if ( !it.current() ->text( 0 ).isEmpty() ) @@ -2023,21 +2023,21 @@ void CppNewClassDialog::ClassGenerator::gen_interface() } } else if ( qobject ) - inheritance += ": public QObject"; + inheritance += ": public TQObject"; - QString constructors = QString( advConstructorsHeader.isEmpty() ? - QString( " $CLASSNAME$($ARGS$);" ) : advConstructorsHeader ) - + QString( "\n\n ~$CLASSNAME$();" ); + TQString constructors = TQString( advConstructorsHeader.isEmpty() ? + TQString( " $CLASSNAME$($ARGS$);" ) : advConstructorsHeader ) + + TQString( "\n\n ~$CLASSNAME$();" ); - constructors.replace( QRegExp( "\\$CLASSNAME\\$" ), className ); - constructors.replace( QRegExp( "\\$ARGS\\$" ), argsH ); + constructors.replace( TQRegExp( "\\$CLASSNAME\\$" ), className ); + constructors.replace( TQRegExp( "\\$ARGS\\$" ), argsH ); - QString qobjectStr; + TQString qobjectStr; if ( childClass || qobject ) qobjectStr = "Q_OBJECT"; - QString baseclass; + TQString baseclass; if ( dlg.baseclasses_view->childCount() > 0 ) baseclass = dlg.baseclasses_view->firstChild() ->text( 0 ); //remove unnesessary carriadge returns @@ -2047,30 +2047,30 @@ void CppNewClassDialog::ClassGenerator::gen_interface() advH_protected, advH_protected_slots, advH_private, advH_private_slots, namespaceEnd ); - classIntf.replace( QRegExp( "\\$HEADERGUARD\\$" ), headerGuard ); - classIntf.replace( QRegExp( "\\$INCLUDEBASEHEADER\\$" ), includeBaseHeader ); - classIntf.replace( QRegExp( "\\$AUTHOR\\$" ), author ); - classIntf.replace( QRegExp( "\\$DOC\\$" ), doc ); - classIntf.replace( QRegExp( "\\$TEMPLATE\\$" ), templateStr ); - classIntf.replace( QRegExp( "\\$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.replace( QRegExp( "\\$BASECLASS\\$" ), dlg.baseclasses_view->firstChild() ->text( 0 ) ); - classIntf.replace( QRegExp( "\\$INHERITANCE\\$" ), inheritance ); - classIntf.replace( QRegExp( "\\$QOBJECT\\$" ), qobjectStr ); - classIntf.replace( QRegExp( "\\$ARGS\\$" ), argsH ); - classIntf.replace( QRegExp( "\\$FILENAME\\$" ), header ); - classIntf.replace( QRegExp( "\\$NAMESPACEBEG\\$" ), namespaceBeg ); - classIntf.replace( QRegExp( "\\$CONSTRUCTORDECLARATIONS\\$" ), constructors ); - classIntf.replace( QRegExp( "\\$PUBLICDECLARATIONS\\$" ), advH_public ); - classIntf.replace( QRegExp( "\\$PUBLICSLOTS\\$" ), advH_public_slots ); - classIntf.replace( QRegExp( "\\$PROTECTEDDECLARATIONS\\$" ), QString( "protected:\n" ) + advH_protected ); - classIntf.replace( QRegExp( "\\$PROTECTEDSLOTS\\$" ), QString( "protected slots:\n" ) + advH_protected_slots ); - classIntf.replace( QRegExp( "\\$PRIVATEDECLARATIONS\\$" ), QString( "private:\n" ) + advH_private ); - classIntf.replace( QRegExp( "\\$PRIVATESLOTS\\$" ), QString( "private slots:\n" ) + advH_private_slots ); - classIntf.replace( QRegExp( "\\$NAMESPACEEND\\$" ), namespaceEnd ); + classIntf.replace( TQRegExp( "\\$BASECLASS\\$" ), dlg.baseclasses_view->firstChild() ->text( 0 ) ); + classIntf.replace( TQRegExp( "\\$INHERITANCE\\$" ), inheritance ); + classIntf.replace( TQRegExp( "\\$QOBJECT\\$" ), 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.replace( QRegExp( "#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() ) { @@ -2079,13 +2079,13 @@ void CppNewClassDialog::ClassGenerator::gen_interface() classIntf = fmt->formatSource( classIntf ); } - QFile hfile( headerPath ); + TQFile hfile( headerPath ); if ( !hfile.open( IO_WriteOnly ) ) { KMessageBox::error( &dlg, i18n( "Cannot write to header file" ) ); return ; } - QTextStream hstream( &hfile ); + TQTextStream hstream( &hfile ); hstream << classIntf; hfile.close(); @@ -2094,140 +2094,140 @@ void CppNewClassDialog::ClassGenerator::gen_interface() dlg.m_part->partController()->editDocument( u ); } -void CppNewClassDialog::ClassGenerator::beautifyHeader( QString &templ, QString &headerGuard, - QString &includeBaseHeader, QString &author, QString &doc, QString &className, QString &templateStr, - QString &baseclass, QString &inheritance, QString &qobjectStr, QString &args, - QString &header, QString &namespaceBeg, QString &constructors, QString &advH_public, QString &advH_public_slots, - QString &advH_protected, QString &advH_protected_slots, QString &advH_private, QString &advH_private_slots, - QString &namespaceEnd ) +void CppNewClassDialog::ClassGenerator::beautifyHeader( TQString &templ, TQString &headerGuard, + TQString &includeBaseHeader, TQString &author, TQString &doc, TQString &className, TQString &templateStr, + TQString &baseclass, TQString &inheritance, TQString &qobjectStr, TQString &args, + TQString &header, TQString &namespaceBeg, TQString &constructors, TQString &advH_public, TQString &advH_public_slots, + TQString &advH_protected, TQString &advH_protected_slots, TQString &advH_private, TQString &advH_private_slots, + TQString &namespaceEnd ) { if ( headerGuard.isEmpty() ) - templ.replace( QRegExp( "\\$HEADERGUARD\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$HEADERGUARD\\$[\\n ]*" ), TQString::null ); if ( includeBaseHeader.isEmpty() ) - templ.replace( QRegExp( "\\$INCLUDEBASEHEADER\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$INCLUDEBASEHEADER\\$[\\n ]*" ), TQString::null ); if ( author.isEmpty() ) - templ.replace( QRegExp( "\\$AUTHOR\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$AUTHOR\\$[\\n ]*" ), TQString::null ); if ( doc.isEmpty() ) - templ.replace( QRegExp( "\\$DOC\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$DOC\\$[\\n ]*" ), TQString::null ); if ( className.isEmpty() ) - templ.replace( QRegExp( "\\$CLASSNAME\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString::null ); if ( templateStr.isEmpty() ) - templ.replace( QRegExp( "\\$TEMPLATE\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$TEMPLATE\\$[\\n ]*" ), TQString::null ); if ( baseclass.isEmpty() ) - templ.replace( QRegExp( "\\$BASECLASS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$BASECLASS\\$[\\n ]*" ), TQString::null ); if ( inheritance.isEmpty() ) - templ.replace( QRegExp( "\\$INHERITANCE\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$INHERITANCE\\$[\\n ]*" ), TQString::null ); if ( qobjectStr.isEmpty() ) - templ.replace( QRegExp( "\\$QOBJECT\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$QOBJECT\\$[\\n ]*" ), TQString::null ); if ( args.isEmpty() ) - templ.replace( QRegExp( "\\$ARGS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$ARGS\\$[\\n ]*" ), TQString::null ); if ( header.isEmpty() ) - templ.replace( QRegExp( "\\$FILENAME\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString::null ); if ( namespaceBeg.isEmpty() ) - templ.replace( QRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString::null ); if ( constructors.isEmpty() ) - templ.replace( QRegExp( "\\$CONSTRUCTORDECLARATIONS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$CONSTRUCTORDECLARATIONS\\$[\\n ]*" ), TQString::null ); if ( advH_public.isEmpty() ) - templ.replace( QRegExp( "\\$PUBLICDECLARATIONS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$PUBLICDECLARATIONS\\$[\\n ]*" ), TQString::null ); if ( advH_public_slots.isEmpty() ) - templ.replace( QRegExp( "\\$PUBLICSLOTS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$PUBLICSLOTS\\$[\\n ]*" ), TQString::null ); if ( advH_protected.isEmpty() ) - templ.replace( QRegExp( "\\$PROTECTEDDECLARATIONS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$PROTECTEDDECLARATIONS\\$[\\n ]*" ), TQString::null ); if ( advH_protected_slots.isEmpty() ) - templ.replace( QRegExp( "\\$PROTECTEDSLOTS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$PROTECTEDSLOTS\\$[\\n ]*" ), TQString::null ); if ( advH_private.isEmpty() ) - templ.replace( QRegExp( "\\$PRIVATEDECLARATIONS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$PRIVATEDECLARATIONS\\$[\\n ]*" ), TQString::null ); if ( advH_private_slots.isEmpty() ) - templ.replace( QRegExp( "\\$PRIVATESLOTS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$PRIVATESLOTS\\$[\\n ]*" ), TQString::null ); if ( namespaceEnd.isEmpty() ) - templ.replace( QRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString::null ); } -void CppNewClassDialog::ClassGenerator::beautifySource( QString &templ, QString &header, QString &className, QString &namespaceBeg, - QString &constructors, QString &advCpp, QString &namespaceEnd, QString &implementation ) +void CppNewClassDialog::ClassGenerator::beautifySource( TQString &templ, TQString &header, TQString &className, TQString &namespaceBeg, + TQString &constructors, TQString &advCpp, TQString &namespaceEnd, TQString &implementation ) { if ( header.isEmpty() ) - templ.replace( QRegExp( "\\$HEADER\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$HEADER\\$[\\n ]*" ), TQString::null ); if ( className.isEmpty() ) - templ.replace( QRegExp( "\\$CLASSNAME\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString::null ); if ( namespaceBeg.isEmpty() ) - templ.replace( QRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString::null ); if ( constructors.isEmpty() ) - templ.replace( QRegExp( "\\$CONSTRUCTORDEFINITIONS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$CONSTRUCTORDEFINITIONS\\$[\\n ]*" ), TQString::null ); if ( advCpp.isEmpty() ) - templ.replace( QRegExp( "\\$DEFINITIONS\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$DEFINITIONS\\$[\\n ]*" ), TQString::null ); if ( namespaceEnd.isEmpty() ) - templ.replace( QRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString::null ); if ( implementation.isEmpty() ) - templ.replace( QRegExp( "\\$FILENAME\\$[\\n ]*" ), QString::null ); + templ.replace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString::null ); } -QString CppNewClassDialog::classNameFormatted( ) +TQString CppNewClassDialog::classNameFormatted( ) { return classNameFormatted( classname_edit->text() ); } -QString CppNewClassDialog::classNameFormatted( const QString &name ) +TQString CppNewClassDialog::classNameFormatted( const TQString &name ) { - QString temp = name.simplifyWhiteSpace(); - return temp.replace( QRegExp( "template *<.*> *(class *)?" ), "" ); + TQString temp = name.simplifyWhiteSpace(); + return temp.replace( TQRegExp( "template *<.*> *(class *)?" ), "" ); } -QString CppNewClassDialog::templateStrFormatted( ) +TQString CppNewClassDialog::templateStrFormatted( ) { return templateStrFormatted( classname_edit->text() ); } -QString CppNewClassDialog::templateStrFormatted( const QString &name ) +TQString CppNewClassDialog::templateStrFormatted( const TQString &name ) { - QString className = name.simplifyWhiteSpace(); - QString temp = className; - className.replace( QRegExp( "template *<.*> *(class *)?" ), "" ); - QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" ); - templateStr.replace( QRegExp( " *class *$" ), "" ); + TQString className = name.simplifyWhiteSpace(); + TQString temp = className; + className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" ); + TQString templateStr = temp.replace( TQRegExp( QRegExp_escape( className ) ), "" ); + templateStr.replace( TQRegExp( " *class *$" ), "" ); return templateStr; } -QString CppNewClassDialog::templateParamsFormatted( ) +TQString CppNewClassDialog::templateParamsFormatted( ) { return templateParamsFormatted( classname_edit->text() ); } -QString CppNewClassDialog::templateParamsFormatted( const QString &name ) +TQString CppNewClassDialog::templateParamsFormatted( const TQString &name ) { - QString className = name.simplifyWhiteSpace(); - QString temp = className; - className.replace( QRegExp( "template *<.*> *(class *)?" ), "" ); - QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" ); - templateStr.replace( QRegExp( " *class *$" ), "" ); + TQString className = name.simplifyWhiteSpace(); + TQString temp = className; + className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" ); + TQString templateStr = temp.replace( TQRegExp( QRegExp_escape( className ) ), "" ); + templateStr.replace( TQRegExp( " *class *$" ), "" ); - QString templateParams = templateStr; - templateParams.replace( QRegExp( "^ *template *" ), "" ); - templateParams.replace( QRegExp( " *class *" ), "" ); + TQString templateParams = templateStr; + templateParams.replace( TQRegExp( "^ *template *" ), "" ); + templateParams.replace( TQRegExp( " *class *" ), "" ); templateParams.simplifyWhiteSpace(); return templateParams; } -QString CppNewClassDialog::templateActualParamsFormatted( const QString & name ) +TQString CppNewClassDialog::templateActualParamsFormatted( const TQString & name ) { - QString className = name.simplifyWhiteSpace(); - QString temp = className; - className.replace( QRegExp( "<.*> *" ), "" ); - QString templateStr = temp.replace( QRegExp( QRegExp_escape( className ) ), "" ); + TQString className = name.simplifyWhiteSpace(); + TQString temp = className; + className.replace( TQRegExp( "<.*> *" ), "" ); + TQString templateStr = temp.replace( TQRegExp( QRegExp_escape( className ) ), "" ); return templateStr; } -void CppNewClassDialog::removeTemplateParams( QString & name ) +void CppNewClassDialog::removeTemplateParams( TQString & name ) { - name.replace( QRegExp( "<.*> *" ), "" ); + name.replace( TQRegExp( "<.*> *" ), "" ); } -bool CppNewClassDialog::isDestructor( QString className, const FunctionDom &method ) +bool CppNewClassDialog::isDestructor( TQString className, const FunctionDom &method ) { - if ( m_part->formatModelItem( method.data() ).contains( QRegExp( " *~ *" + className ) ) ) + if ( m_part->formatModelItem( method.data() ).contains( TQRegExp( " *~ *" + className ) ) ) return true; return false; } |