summaryrefslogtreecommitdiffstats
path: root/languages/cpp/cppnewclassdlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'languages/cpp/cppnewclassdlg.cpp')
-rw-r--r--languages/cpp/cppnewclassdlg.cpp503
1 files changed, 241 insertions, 262 deletions
diff --git a/languages/cpp/cppnewclassdlg.cpp b/languages/cpp/cppnewclassdlg.cpp
index fc338900..773f36ae 100644
--- a/languages/cpp/cppnewclassdlg.cpp
+++ b/languages/cpp/cppnewclassdlg.cpp
@@ -52,28 +52,13 @@
#include "classgeneratorconfig.h"
-TQString QRegExp_escape( const TQString& str )
+TQString TQRegExp_escape( const TQString& str )
{
-#if QT_VERSION >= 0x030100
return TQRegExp::escape( str );
-#else
- // this block is copyrighted by Trolltech AS (GPL)
- static const char meta[] = "$()*+.?[\\]^{|}";
- TQString quoted = str;
- int i = 0;
-
- while ( i < ( int ) quoted.length() )
- {
- if ( strchr( meta, quoted[ i ].latin1() ) != 0 )
- quoted.insert( i++, "\\" );
- i++;
- }
- return quoted;
-#endif
}
-CppNewClassDialog::CppNewClassDialog( CppSupportPart *part, TQWidget *parent, const char *name )
- : CppNewClassDialogBase( parent, name ), myModel( 0 )
+CppNewClassDialog::CppNewClassDialog( CppSupportPart *part, TQWidget *tqparent, const char *name )
+ : CppNewClassDialogBase( tqparent, name ), myModel( 0 )
{
headerModified = false;
baseincludeModified = false;
@@ -161,7 +146,7 @@ TQStringList& gres( TQStringList &list, const TQRegExp & rx, const TQString & af
TQStringList::Iterator it = list.begin();
while ( it != list.end() )
{
- ( *it ).replace( rx, after );
+ ( *it ).tqreplace( rx, after );
++it;
}
return list;
@@ -175,13 +160,7 @@ void CppNewClassDialog::addCompletionBasenameNamespacesRecursive( const Namespac
if ( ! namespaceParent.isEmpty() )
{
-#if QT_VERSION >= 0x030200
classList.gres( TQRegExp( "^" ), namespaceParent + "::" );
-#else
-
- gres( classList, TQRegExp( "^" ), namespaceParent + "::" );
-#endif
-
}
compBasename -> insertItems( classList );
@@ -247,13 +226,13 @@ void CppNewClassDialog::classNameChanged( const TQString &text )
default:
;
}
- header = header.replace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" );
+ header = header.tqreplace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" );
header_edit->setText( header );
}
if ( !implementationModified )
{
TQString implementation;
- if ( str.contains( "template" ) )
+ if ( str.tqcontains( "template" ) )
implementation = str + "_impl" + interface_suffix;
else
implementation = str + implementation_suffix;
@@ -268,7 +247,7 @@ void CppNewClassDialog::classNameChanged( const TQString &text )
default:
;
}
- implementation = implementation.replace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" );
+ implementation = implementation.tqreplace( TQRegExp( "(template *<.*> *)?(class +)?" ), "" );
implementation_edit->setText( implementation );
}
}
@@ -286,7 +265,7 @@ void CppNewClassDialog::baseclassname_changed( const TQString &text )
{
TQString header = text;
- // handle Qt classes in a special way.
+ // handle TQt classes in a special way.
if( m_part->qtBuildConfig()->isUsed() && header.startsWith( "Q" ) )
{
if( m_part->qtBuildConfig()->version() == 3 )
@@ -300,9 +279,9 @@ void CppNewClassDialog::baseclassname_changed( const TQString &text )
}
else
{
- if ( header.contains( TQRegExp( "::" ) ) )
- header = header.mid( header.findRev( TQRegExp( "::" ) ) + 2 );
- header = header.replace( TQRegExp( " *<.*>" ), "" );
+ if ( header.tqcontains( TQRegExp( "::" ) ) )
+ header = header.mid( header.tqfindRev( TQRegExp( "::" ) ) + 2 );
+ header = header.tqreplace( TQRegExp( " *<.*>" ), "" );
header += interface_suffix;
switch ( gen_config->superCase() )
@@ -369,7 +348,7 @@ void CppNewClassDialog::checkObjCInheritance( int val )
objc_box->setChecked( false );
}
-void CppNewClassDialog::checkQWidgetInheritance( int val )
+void CppNewClassDialog::checkTQWidgetInheritance( int val )
{
if ( val )
{
@@ -395,11 +374,11 @@ void CppNewClassDialog::checkQWidgetInheritance( int val )
if ( baseclasses_view->childCount() == 0 )
{
addBaseClass();
- basename_edit->setText( "TQWidget" );
+ basename_edit->setText( TQWIDGET_OBJECT_NAME_STRING );
}
/* constructors_cpp_edit->append(classname_edit->text() + "::" + classname_edit->text() +
- "(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");*/
+ "(TQWidget *tqparent, const char *name):\n TQWidget(tqparent, name)\n{\n}\n");
+ constructors_h_edit->append(classname_edit->text() + "(TQWidget *tqparent, const char *name);\n");*/
}
if ( val && ( baseclasses_view->childCount() > 1 ) )
@@ -417,7 +396,7 @@ void CppNewClassDialog::qobject_box_stateChanged( int val )
if ( baseclasses_view->childCount() == 0 )
{
addBaseClass();
- basename_edit->setText( "TQObject" );
+ basename_edit->setText( TQOBJECT_OBJECT_NAME_STRING );
}
@@ -482,11 +461,11 @@ void CppNewClassDialog::addBaseClass()
if ( baseclasses_view->selectedItem() )
baseclasses_view->selectedItem() ->setSelected( false );
TQListViewItem* it = new TQListViewItem( baseclasses_view, baseclasses_view->lastItem(),
- TQString::null, "public", TQString( "%1" ).arg( scope_box->currentItem() ), TQString::null, "false" );
+ TQString(), "public", TQString( "%1" ).tqarg( scope_box->currentItem() ), TQString(), "false" );
setStateOfInheritanceEditors( true );
public_button->setChecked( true );
virtual_box->setChecked( false );
- basename_edit->setText( TQString::null );
+ basename_edit->setText( TQString() );
basename_edit->setFocus();
baseclasses_view->setSelected( it, true );
}
@@ -537,23 +516,23 @@ void CppNewClassDialog::remBaseClassOnly()
void CppNewClassDialog::remClassFromAdv( TQString text )
{
// Strip off namespace qualification
- if ( text.contains( "::" ) )
- text = text.mid( text.findRev( "::" ) + 2 );
+ if ( text.tqcontains( "::" ) )
+ text = text.mid( text.tqfindRev( "::" ) + 2 );
removeTemplateParams( text );
TQListViewItem *it = 0;
- if ( ( it = access_view->findItem( text, 0 ) ) )
+ if ( ( it = access_view->tqfindItem( text, 0 ) ) )
delete it;
- if ( ( it = methods_view->findItem( text, 0 ) ) )
+ if ( ( it = methods_view->tqfindItem( text, 0 ) ) )
delete it;
- if ( ( it = constructors_view->findItem( text, 0 ) ) )
+ if ( ( it = constructors_view->tqfindItem( 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->find(text + "(", true, false, true, para, index))
+ if (constructors_cpp_edit->tqfind(text + "(", true, false, true, para, index))
{
qWarning("%s( found", text.latin1());
if (para) constructors_cpp_edit->removeParagraph(*para);
@@ -610,7 +589,7 @@ void CppNewClassDialog::scopeboxActivated( int value )
{
if ( baseclasses_view->selectedItem() )
{
- baseclasses_view->selectedItem() ->setText( 2, TQString( "%1" ).arg( value ) );
+ baseclasses_view->selectedItem() ->setText( 2, TQString( "%1" ).tqarg( value ) );
}
}
@@ -636,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 ).contains( "private" ) )
+ if ( it->text( 1 ).tqcontains( "private" ) )
private_button->setChecked( true );
else
private_button->setChecked( false );
- if ( it->text( 1 ).contains( "protected" ) )
+ if ( it->text( 1 ).tqcontains( "protected" ) )
protected_button->setChecked( true );
else
protected_button->setChecked( false );
- if ( it->text( 1 ).contains( "public" ) )
+ if ( it->text( 1 ).tqcontains( "public" ) )
public_button->setChecked( true );
else
public_button->setChecked( false );
- if ( it->text( 1 ).contains( "virtual" ) )
+ if ( it->text( 1 ).tqcontains( "virtual" ) )
virtual_box->setChecked( true );
else
virtual_box->setChecked( false );
@@ -725,7 +704,7 @@ void CppNewClassDialog::updateConstructorsOrder()
while ( it.current() )
{
- if ( ( c_it = constructors_view->findItem( it.current() ->text( 0 ), 0 ) ) )
+ if ( ( c_it = constructors_view->tqfindItem( it.current() ->text( 0 ), 0 ) ) )
{
c_it->moveItem( fc_it );
fc_it = c_it;
@@ -776,7 +755,7 @@ void CppNewClassDialog::changeToPublic()
void CppNewClassDialog::changeToInherited()
{
if ( access_view->selectedItem() )
- access_view->selectedItem() ->setText( 2, TQString::null );
+ access_view->selectedItem() ->setText( 2, TQString() );
}
void CppNewClassDialog::newTabSelected( const TQString& /*text*/ )
@@ -817,11 +796,11 @@ void CppNewClassDialog::parseClass( TQString clName, TQString inheritance )
TQStringList clNamespace = currNamespace;
bool clFullQualified = false;
- if ( clName.contains( "::" ) )
+ if ( clName.tqcontains( "::" ) )
{
// Full qualified, override imported namespace
clFullQualified = true;
- int splitpoint = clName.findRev( "::" );
+ int splitpoint = clName.tqfindRev( "::" );
clNamespace = TQStringList::split( "::", clName.left( splitpoint ) );
clName = clName.mid( splitpoint + 2 );
}
@@ -870,10 +849,10 @@ void CppNewClassDialog::parseClass( TQString clName, TQString inheritance )
PListViewItem<ClassDom> *over = new PListViewItem<ClassDom>( *classIt, methods_view, ( *classIt ) ->name() );
over->templateAddition = templateAdd;
TQListViewItem *over_methods = new TQListViewItem( over, i18n( "Methods" ) );
- TQListViewItem *over_slots = new TQListViewItem( over, i18n( "Slots (Qt-specific)" ) );
+ TQListViewItem *over_slots = new TQListViewItem( over, i18n( "Slots (TQt-specific)" ) );
PListViewItem<ClassDom> *access = new PListViewItem<ClassDom>( *classIt, access_view, ( *classIt ) ->name() );
TQListViewItem *access_methods = new TQListViewItem( access, i18n( "Methods" ) );
- TQListViewItem *access_slots = new TQListViewItem( access, i18n( "Slots (Qt-specific)" ) );
+ TQListViewItem *access_slots = new TQListViewItem( access, i18n( "Slots (TQt-specific)" ) );
TQListViewItem *access_attrs = new TQListViewItem( access, i18n( "Attributes" ) );
FunctionList functionList = ( *classIt ) ->functionList();
@@ -896,13 +875,13 @@ void CppNewClassDialog::parseClass( TQString clName, TQString inheritance )
TQString inhModifier;
//protected inheritance gives protected attributes
- if ( inheritance.contains( "protected" ) )
+ if ( inheritance.tqcontains( "protected" ) )
inhModifier = "protected";
//private inheritance gives private attributes
- else if ( inheritance.contains( "private" ) )
+ else if ( inheritance.tqcontains( "private" ) )
inhModifier = "private";
//public inheritance gives protected and public attributes
- else if ( inheritance.contains( "public" ) )
+ else if ( inheritance.tqcontains( "public" ) )
inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
addToUpgradeList( access_slots, *methodIt, inhModifier );
}
@@ -917,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.contains( "protected" ) )
+ if ( inheritance.tqcontains( "protected" ) )
inhModifier = "protected";
//private inheritance gives private methods
- else if ( inheritance.contains( "private" ) )
+ else if ( inheritance.tqcontains( "private" ) )
inhModifier = "private";
//public inheritance gives protected and public methods
- else if ( inheritance.contains( "public" ) )
+ else if ( inheritance.tqcontains( "public" ) )
inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
addToUpgradeList( access_methods, *methodIt, inhModifier );
}
@@ -938,13 +917,13 @@ void CppNewClassDialog::parseClass( TQString clName, TQString inheritance )
{
TQString inhModifier;
//protected inheritance gives protected attributes
- if ( inheritance.contains( "protected" ) )
+ if ( inheritance.tqcontains( "protected" ) )
inhModifier = "protected";
//private inheritance gives private attributes
- else if ( inheritance.contains( "private" ) )
+ else if ( inheritance.tqcontains( "private" ) )
inhModifier = "private";
//public inheritance gives protected and public attributes
- else if ( inheritance.contains( "public" ) )
+ else if ( inheritance.tqcontains( "public" ) )
inhModifier = ( *varIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
addToUpgradeList( access_attrs, *varIt, inhModifier );
}
@@ -958,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() ).contains( TQRegExp( " *(const)? *" + className + " *& *" ) ) ) )
- // if ( method->asString().contains(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() ).tqcontains( TQRegExp( " *(const)? *" + className + " *& *" ) ) ) )
+ // if ( method->asString().tqcontains(TQRegExp(className + "\\s*\\(\\s*(const)?\\s*" + className + "\\s*&[A-Za-z_0-9\\s]*\\)", true, false)) )
return false;
else
return true;
@@ -973,21 +952,21 @@ void CppNewClassDialog::addToConstructorsList( TQCheckListItem *myClass, Functio
new PCheckListItem<FunctionDom>( method, myClass, m_part->formatModelItem( method.data() ), TQCheckListItem::RadioButton );
}
-void CppNewClassDialog::addToMethodsList( TQListViewItem *parent, FunctionDom method )
+void CppNewClassDialog::addToMethodsList( TQListViewItem *tqparent, FunctionDom method )
{
- 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" ) );
+ 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" ) );
}
-void CppNewClassDialog::addToUpgradeList( TQListViewItem *parent, FunctionDom method, TQString modifier )
+void CppNewClassDialog::addToUpgradeList( TQListViewItem *tqparent, FunctionDom method, TQString modifier )
{
- PListViewItem<FunctionDom> *it = new PListViewItem<FunctionDom>( method, parent, m_part->formatModelItem( method.data() ) );
+ PListViewItem<FunctionDom> *it = new PListViewItem<FunctionDom>( method, tqparent, m_part->formatModelItem( method.data() ) );
it->setText( 1, modifier );
}
-void CppNewClassDialog::addToUpgradeList( TQListViewItem *parent, VariableDom attr, TQString modifier )
+void CppNewClassDialog::addToUpgradeList( TQListViewItem *tqparent, VariableDom attr, TQString modifier )
{
- PListViewItem<VariableDom> *it = new PListViewItem<VariableDom>( attr, parent, m_part->formatModelItem( attr.data() ) );
+ PListViewItem<VariableDom> *it = new PListViewItem<VariableDom>( attr, tqparent, m_part->formatModelItem( attr.data() ) );
it->setText( 1, modifier );
}
@@ -998,11 +977,11 @@ void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance )
TQStringList clNamespace = currNamespace;
bool clFullQualified = false;
- if ( clName.contains( "::" ) )
+ if ( clName.tqcontains( "::" ) )
{
// Full qualified, override imported namespace
clFullQualified = true;
- int splitpoint = clName.findRev( "::" );
+ int splitpoint = clName.tqfindRev( "::" );
clNamespace = TQStringList::split( "::", clName.left( splitpoint ) );
clName = clName.mid( splitpoint + 2 );
}
@@ -1029,10 +1008,10 @@ void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance )
PListViewItem<ClassDom> *over = new PListViewItem<ClassDom>( *classIt, methods_view, ( *classIt ) ->name() );
over->templateAddition = templateAdd;
TQListViewItem *over_methods = new TQListViewItem( over, i18n( "Methods" ) );
- TQListViewItem *over_slots = new TQListViewItem( over, i18n( "Slots (Qt-specific)" ) );
+ TQListViewItem *over_slots = new TQListViewItem( over, i18n( "Slots (TQt-specific)" ) );
PListViewItem<ClassDom> *access = new PListViewItem<ClassDom>( *classIt, access_view, ( *classIt ) ->name() );
TQListViewItem *access_methods = new TQListViewItem( access, i18n( "Methods" ) );
- TQListViewItem *access_slots = new TQListViewItem( access, i18n( "Slots (Qt-specific)" ) );
+ TQListViewItem *access_slots = new TQListViewItem( access, i18n( "Slots (TQt-specific)" ) );
TQListViewItem *access_attrs = new TQListViewItem( access, i18n( "Attributes" ) );
FunctionList functionList = ( *classIt ) ->functionList();
@@ -1055,13 +1034,13 @@ void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance )
TQString inhModifier;
//protected inheritance gives protected attributes
- if ( inheritance.contains( "protected" ) )
+ if ( inheritance.tqcontains( "protected" ) )
inhModifier = "protected";
//private inheritance gives private attributes
- else if ( inheritance.contains( "private" ) )
+ else if ( inheritance.tqcontains( "private" ) )
inhModifier = "private";
//public inheritance gives protected and public attributes
- else if ( inheritance.contains( "public" ) )
+ else if ( inheritance.tqcontains( "public" ) )
inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
addToUpgradeList( access_slots, *methodIt, inhModifier );
}
@@ -1076,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.contains( "protected" ) )
+ if ( inheritance.tqcontains( "protected" ) )
inhModifier = "protected";
//private inheritance gives private methods
- else if ( inheritance.contains( "private" ) )
+ else if ( inheritance.tqcontains( "private" ) )
inhModifier = "private";
//public inheritance gives protected and public methods
- else if ( inheritance.contains( "public" ) )
+ else if ( inheritance.tqcontains( "public" ) )
inhModifier = ( *methodIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
addToUpgradeList( access_methods, *methodIt, inhModifier );
}
@@ -1097,13 +1076,13 @@ void CppNewClassDialog::parsePCSClass( TQString clName, TQString inheritance )
{
TQString inhModifier;
//protected inheritance gives protected attributes
- if ( inheritance.contains( "protected" ) )
+ if ( inheritance.tqcontains( "protected" ) )
inhModifier = "protected";
//private inheritance gives private attributes
- else if ( inheritance.contains( "private" ) )
+ else if ( inheritance.tqcontains( "private" ) )
inhModifier = "private";
//public inheritance gives protected and public attributes
- else if ( inheritance.contains( "public" ) )
+ else if ( inheritance.tqcontains( "public" ) )
inhModifier = ( *varIt ) ->access() == CodeModelItem::Public ? "public" : "protected";
addToUpgradeList( access_attrs, *varIt, inhModifier );
}
@@ -1132,7 +1111,7 @@ void CppNewClassDialog::clearConstructorsList( bool clean )
TQListViewItemIterator it( constructors_view );
while ( it.current() )
{
- if ( ! currBaseClasses.contains(it.current().text(0)) )
+ if ( ! currBaseClasses.tqcontains(it.current().text(0)) )
delete it.current();
++it;
}
@@ -1160,9 +1139,9 @@ void CppNewClassDialog::setAccessForItem( TQListViewItem *curr, TQString newAcce
if ( !curr->text( 2 ).isEmpty() )
{
if ( ( curr->text( 2 ) == "private" ) && ( ( newAccess == "public" ) || ( newAccess == "protected" ) ) )
- curr->setText( 2, TQString::null );
+ curr->setText( 2, TQString() );
if ( ( curr->text( 2 ) == "protected" ) && ( ( newAccess == "public" ) && ( isPublic ) ) )
- curr->setText( 2, TQString::null );
+ curr->setText( 2, TQString() );
}
}
@@ -1170,7 +1149,7 @@ void CppNewClassDialog::setAccessForBase( TQString baseclass, TQString newAccess
{
TQListViewItem * base;
- if ( ( base = access_view->findItem( baseclass, 0 ) ) )
+ if ( ( base = access_view->tqfindItem( baseclass, 0 ) ) )
{
TQListViewItemIterator it( base );
while ( it.current() )
@@ -1192,7 +1171,7 @@ void CppNewClassDialog::setAccessForBase( TQString baseclass, TQString newAccess
void CppNewClassDialog::access_view_mouseButtonPressed( int button, TQListViewItem * item, const TQPoint &p, int /*c*/ )
{
- if ( item && ( ( button == LeftButton ) || ( button == RightButton ) ) && ( item->depth() > 1 ) )
+ if ( item && ( ( button == Qt::LeftButton ) || ( button == Qt::RightButton ) ) && ( item->depth() > 1 ) )
{
accessMenu->setItemEnabled( 1, true );
accessMenu->setItemEnabled( 2, true );
@@ -1217,7 +1196,7 @@ void CppNewClassDialog::access_view_mouseButtonPressed( int button, TQListViewIt
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() ) )
+ if ( item && ( button == Qt::RightButton ) && ( item->depth() > 1 ) && ( ! item->text( 1 ).isEmpty() ) )
{
overMenu->exec( p );
}
@@ -1232,7 +1211,7 @@ void CppNewClassDialog::extendFunctionality()
void CppNewClassDialog::replaceFunctionality()
{
if ( methods_view->selectedItem() )
- methods_view->selectedItem() ->setText( 1, i18n( "replace" ) );
+ methods_view->selectedItem() ->setText( 1, i18n( "tqreplace" ) );
}
void CppNewClassDialog::selectall_button_clicked()
@@ -1249,7 +1228,7 @@ void CppNewClassDialog::selectall_button_clicked()
void CppNewClassDialog::to_constructors_list_clicked()
{
- TQString templateAdd = templateStrFormatted().isEmpty() ? TQString::null : templateStrFormatted() + "\n";
+ TQString templateAdd = templateStrFormatted().isEmpty() ? TQString() : templateStrFormatted() + "\n";
TQString constructor_h = classNameFormatted();
TQString constructor_cpp = templateAdd + classNameFormatted() + templateParamsFormatted() + "::" + classNameFormatted();
constructor_h += "(";
@@ -1265,13 +1244,13 @@ void CppNewClassDialog::to_constructors_list_clicked()
PCheckListItem<FunctionDom> *curr;
if ( ( curr = dynamic_cast<PCheckListItem<FunctionDom>* >( it.current() ) ) )
{
- if ( curr->isOn() && curr->parent() )
+ if ( curr->isOn() && curr->tqparent() )
{
//fill the base classes list
base += base.isEmpty() ? ": " : ", ";
- base += curr->parent() ->text( 0 );
+ base += curr->tqparent() ->text( 0 );
PCheckListItem<ClassDom> *p;
- if ( ( p = dynamic_cast<PCheckListItem<ClassDom>* >( curr->parent() ) ) )
+ if ( ( p = dynamic_cast<PCheckListItem<ClassDom>* >( curr->tqparent() ) ) )
{
base += p->templateAddition;
}
@@ -1289,8 +1268,8 @@ void CppNewClassDialog::to_constructors_list_clicked()
cparams += ( *argIt ) ->type() + " ";
if ( ( *argIt ) ->name().isEmpty() )
{
- cparams += TQString( "arg%1" ).arg( unnamed );
- bparams += TQString( "arg%1" ).arg( unnamed++ );
+ cparams += TQString( "arg%1" ).tqarg( unnamed );
+ bparams += TQString( "arg%1" ).tqarg( unnamed++ );
}
else
{
@@ -1334,13 +1313,13 @@ bool CppNewClassDialog::ClassGenerator::validateInput()
{
className = dlg.classname_edit->text().simplifyWhiteSpace();
TQString temp = className;
- className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" );
- templateStr = temp.replace( TQRegExp( QRegExp_escape( className ) ), "" );
- templateStr.replace( TQRegExp( " *class *$" ), "" );
+ className.tqreplace( TQRegExp( "template *<.*> *(class *)?" ), "" );
+ templateStr = temp.tqreplace( TQRegExp( TQRegExp_escape( className ) ), "" );
+ templateStr.tqreplace( TQRegExp( " *class *$" ), "" );
templateParams = templateStr;
- templateParams.replace( TQRegExp( "^ *template *" ), "" );
- templateParams.replace( TQRegExp( " *class *" ), "" );
+ templateParams.tqreplace( TQRegExp( "^ *template *" ), "" );
+ templateParams.tqreplace( TQRegExp( " *class *" ), "" );
templateParams.simplifyWhiteSpace();
if ( className.isEmpty() )
@@ -1363,7 +1342,7 @@ bool CppNewClassDialog::ClassGenerator::validateInput()
}
/// \FIXME
- if ( ( header.find( '/' ) != -1 || implementation.find( '/' ) != -1 ) && !( dlg.m_part->project() ->options() & KDevProject::UsesQMakeBuildSystem) )
+ if ( ( header.tqfind( '/' ) != -1 || implementation.tqfind( '/' ) != -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 "
@@ -1397,7 +1376,7 @@ bool CppNewClassDialog::ClassGenerator::generate()
return false;
}
- if( ( dlg.m_part->project() ->options() & KDevProject::UsesQMakeBuildSystem) )
+ if( ( dlg.m_part->project() ->options() & KDevProject::UsesTQMakeBuildSystem) )
{
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;
@@ -1458,7 +1437,7 @@ void CppNewClassDialog::ClassGenerator::common_text()
headeronly = dlg.headeronly_box->isChecked();
if ( ( dlg.baseclasses_view->childCount() == 0 ) && childClass )
- new TQListViewItem( dlg.baseclasses_view, "TQWidget", "public" );
+ new TQListViewItem( dlg.baseclasses_view, TQWIDGET_OBJECT_NAME_STRING, "public" );
if ( objc && ( dlg.baseclasses_view->childCount() == 0 ) )
new TQListViewItem( dlg.baseclasses_view, "NSObject", "public" );
@@ -1476,7 +1455,7 @@ void CppNewClassDialog::ClassGenerator::common_text()
TQString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" );
TQString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" );
if( !email.isEmpty() )
- author += TQString( " <%1>" ).arg( email );
+ author += TQString( " <%1>" ).tqarg( email );
if ( dlg.gen_config->author_box->isChecked() )
doc.append( "\t@author " + author + "\n" );
@@ -1498,29 +1477,29 @@ void CppNewClassDialog::ClassGenerator::common_text()
//advanced constructor creation
- advConstructorsHeader = TQString::null;
- advConstructorsSource = TQString::null;
+ advConstructorsHeader = TQString();
+ advConstructorsSource = TQString();
if ( !dlg.constructors_h_edit->text().isEmpty() )
{
advConstructorsHeader = " " + dlg.constructors_h_edit->text();
- advConstructorsHeader.replace( TQRegExp( "\n" ), "\n " );
+ advConstructorsHeader.tqreplace( TQRegExp( "\n" ), "\n " );
}
if ( !dlg.constructors_cpp_edit->text().isEmpty() )
{
advConstructorsSource = dlg.constructors_cpp_edit->text();
}
- advConstructorsHeader.replace( TQRegExp( "[\\n ]*$" ), TQString::null );
- advConstructorsSource.replace( TQRegExp( "[\\n ]*$" ), TQString::null );
+ advConstructorsHeader.tqreplace( TQRegExp( "[\\n ]*$" ), TQString() );
+ advConstructorsSource.tqreplace( TQRegExp( "[\\n ]*$" ), TQString() );
//advanced method overriding
- 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;
+ advH_public = TQString();
+ advH_public_slots = TQString();
+ advH_protected = TQString();
+ advH_protected_slots = TQString();
+ advH_private = TQString();
+ advH_private_slots = TQString();
+ advCpp = TQString();
TQListViewItemIterator it( dlg.methods_view );
while ( it.current() )
@@ -1528,7 +1507,7 @@ void CppNewClassDialog::ClassGenerator::common_text()
PCheckListItem<FunctionDom> *curr;
if ( ( curr = dynamic_cast<PCheckListItem<FunctionDom>* >( it.current() ) ) )
{
- if ( curr->isOn() && ( curr->parent() ) && ( curr->parent() ->parent() ) )
+ if ( curr->isOn() && ( curr->tqparent() ) && ( curr->tqparent() ->tqparent() ) )
{
TQString * adv_h = 0;
if ( curr->item() ->access() == CodeModelItem::Private )
@@ -1540,9 +1519,9 @@ void CppNewClassDialog::ClassGenerator::common_text()
// if (advCpp.isEmpty()) advCpp += "\n\n";
- TQString bcName = curr->parent() ->parent() ->text( 0 );
+ TQString bcName = curr->tqparent() ->tqparent() ->text( 0 );
PListViewItem<ClassDom> *bc;
- if ( ( bc = dynamic_cast<PListViewItem<ClassDom>* >( curr->parent() ->parent() ) ) )
+ if ( ( bc = dynamic_cast<PListViewItem<ClassDom>* >( curr->tqparent() ->tqparent() ) ) )
{
bcName += bc->templateAddition;
}
@@ -1561,7 +1540,7 @@ void CppNewClassDialog::ClassGenerator::common_text()
PListViewItem<FunctionDom> *curr_m;
if ( ( curr = dynamic_cast<PListViewItem<VariableDom>* >( ita.current() ) ) )
{
- if ( ( !curr->text( 2 ).isEmpty() ) && ( curr->parent() ) && ( curr->parent() ->parent() ) )
+ if ( ( !curr->text( 2 ).isEmpty() ) && ( curr->tqparent() ) && ( curr->tqparent() ->tqparent() ) )
{
TQString * adv_h = 0;
if ( curr->text( 2 ) == "private" )
@@ -1574,12 +1553,12 @@ void CppNewClassDialog::ClassGenerator::common_text()
/* if ((*adv_h).isEmpty())
*adv_h += "\n\n";*/
if ( adv_h )
- *adv_h += TQString( " using " ) + curr->parent() ->parent() ->text( 0 ) + "::" + curr->item() ->name() + ";\n";
+ *adv_h += TQString( " using " ) + curr->tqparent() ->tqparent() ->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() ) )
+ if ( ( !curr_m->text( 2 ).isEmpty() ) && ( curr_m->tqparent() ) && ( curr_m->tqparent() ->tqparent() ) )
{
TQString * adv_h = 0;
if ( curr_m->text( 2 ) == "private" )
@@ -1593,22 +1572,22 @@ void CppNewClassDialog::ClassGenerator::common_text()
*adv_h += "\n\n";*/
TQString methodName = curr_m->item() ->name();
- if ( !methodName.contains( TQRegExp( "^[a-zA-z_]" ) ) )
+ if ( !methodName.tqcontains( TQRegExp( "^[a-zA-z_]" ) ) )
methodName = "operator" + methodName;
- *adv_h += " using " + curr_m->parent() ->parent() ->text( 0 ) + "::" + methodName + ";\n";
+ *adv_h += " using " + curr_m->tqparent() ->tqparent() ->text( 0 ) + "::" + methodName + ";\n";
}
}
++ita;
}
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 );
+ 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() );
}
void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method,
@@ -1617,7 +1596,7 @@ void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method
/* if ((*adv_h).isEmpty())
*adv_h += "\n\n";*/
TQString methodName = method->name();
- if ( !methodName.contains( TQRegExp( "^[a-zA-z_]" ) ) )
+ if ( !methodName.tqcontains( TQRegExp( "^[a-zA-z_]" ) ) )
methodName = "operator" + methodName;
*adv_h += " " + ( method->isVirtual() ? TQString( "virtual " ) : TQString( "" ) )
+ ( method->isStatic() ? TQString( "static " ) : TQString( "" ) )
@@ -1639,8 +1618,8 @@ void CppNewClassDialog::ClassGenerator::genMethodDeclaration( FunctionDom method
cparams += ( *argIt ) ->type() + " ";
if ( ( *argIt ) ->name().isEmpty() )
{
- cparams += TQString( "arg%1" ).arg( unnamed );
- bparams += TQString( "arg%1" ).arg( unnamed++ );
+ cparams += TQString( "arg%1" ).tqarg( unnamed );
+ bparams += TQString( "arg%1" ).tqarg( unnamed++ );
}
else
{
@@ -1678,8 +1657,8 @@ void CppNewClassDialog::ClassGenerator::gen_implementation()
classImpl = FileTemplate::read( dlg.m_part, fi.extension( true ) );
}
- classImpl.replace( TQRegExp( "\\$MODULE\\$" ), module );
- classImpl.replace( TQRegExp( "\\$FILENAME\\$" ), basefilename );
+ classImpl.tqreplace( TQRegExp( "\\$MODULE\\$" ), module );
+ classImpl.tqreplace( TQRegExp( "\\$FILENAME\\$" ), basefilename );
if ( objc )
{
@@ -1710,7 +1689,7 @@ void CppNewClassDialog::ClassGenerator::gen_implementation()
}
TQString relPath;
- for ( int i = implementation.findRev( '/' ); i != -1; i = implementation.findRev( '/', --i ) )
+ for ( int i = implementation.tqfindRev( '/' ); i != -1; i = implementation.tqfindRev( '/', --i ) )
relPath += "../";
TQString constructors = ( advConstructorsSource.isEmpty() ? TQString( "$TEMPLATESTR$\n$CLASSNAME$$TEMPLATEPARAMS$::$CLASSNAME$($ARGS$)\n"
@@ -1728,26 +1707,26 @@ void CppNewClassDialog::ClassGenerator::gen_implementation()
{
if( dlg.m_part->qtBuildConfig()->version() == 3 )
{
- argsH = "TQWidget *parent = 0, const char *name = 0";
- argsCpp = "TQWidget *parent, const char *name";
+ argsH = "TQWidget *tqparent = 0, const char *name = 0";
+ argsCpp = "TQWidget *tqparent, const char *name";
}
else
{
- argsH = "TQWidget *parent = 0";
- argsCpp = "TQWidget *parent";
+ argsH = "TQWidget *tqparent = 0";
+ argsCpp = "TQWidget *tqparent";
}
}
else if ( qobject )
{
if( dlg.m_part->qtBuildConfig()->version() == 3 )
{
- argsH = "TQObject *parent = 0, const char *name = 0";
- argsCpp = "TQObject *parent, const char *name";
+ argsH = "TQObject *tqparent = 0, const char *name = 0";
+ argsCpp = "TQObject *tqparent, const char *name";
}
else
{
- argsH = "TQObject *parent = 0";
- argsCpp = "TQObject *parent";
+ argsH = "TQObject *tqparent = 0";
+ argsCpp = "TQObject *tqparent";
}
}
else
@@ -1760,16 +1739,16 @@ void CppNewClassDialog::ClassGenerator::gen_implementation()
if ( childClass && ( dlg.baseclasses_view->childCount() == 0 ) )
{
if( dlg.m_part->qtBuildConfig()->version() == 3 )
- baseInitializer = " : TQWidget(parent, name)";
+ baseInitializer = " : TQWidget(tqparent, name)";
else
- baseInitializer = " : TQWidget(parent)";
+ baseInitializer = " : TQWidget(tqparent)";
}
else if ( qobject && ( dlg.baseclasses_view->childCount() == 0 ) )
{
if( dlg.m_part->qtBuildConfig()->version() == 3 )
- baseInitializer = " : TQObject(parent, name)";
+ baseInitializer = " : TQObject(tqparent, name)";
else
- baseInitializer = " : TQObject(parent)";
+ baseInitializer = " : TQObject(tqparent)";
}
else if ( dlg.baseclasses_view->childCount() != 0 )
{
@@ -1787,16 +1766,16 @@ void CppNewClassDialog::ClassGenerator::gen_implementation()
if ( childClass && ( baseInitializer == " : " ) )
{
if( dlg.m_part->qtBuildConfig()->version() == 3 )
- baseInitializer += it.current()->text( 0 ) + "(parent, name)";
+ baseInitializer += it.current()->text( 0 ) + "(tqparent, name)";
else
- baseInitializer += it.current()->text( 0 ) + "(parent)";
+ baseInitializer += it.current()->text( 0 ) + "(tqparent)";
}
else if ( qobject && ( baseInitializer == " : " ) )
{
if( dlg.m_part->qtBuildConfig()->version() == 3 )
- baseInitializer += it.current()->text( 0 ) + "(parent, name)";
+ baseInitializer += it.current()->text( 0 ) + "(tqparent, name)";
else
- baseInitializer += it.current()->text( 0 ) + "(parent)";
+ baseInitializer += it.current()->text( 0 ) + "(tqparent)";
}
else
{
@@ -1808,22 +1787,22 @@ void CppNewClassDialog::ClassGenerator::gen_implementation()
baseInitializer += "\n";
}
- constructors.replace( TQRegExp( "\\$BASEINITIALIZER\\$" ), baseInitializer );
- constructors.replace( TQRegExp( "\\$CLASSNAME\\$" ), className );
+ constructors.tqreplace( TQRegExp( "\\$BASEINITIALIZER\\$" ), baseInitializer );
+ constructors.tqreplace( TQRegExp( "\\$CLASSNAME\\$" ), className );
// qWarning("NEW CLASS: constructors = %s", constructors.latin1());
if ( templateStr.isEmpty() )
{
- constructors.replace( TQRegExp( "\\$TEMPLATESTR\\$\\n" ), "" );
- constructors.replace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), "" );
+ constructors.tqreplace( TQRegExp( "\\$TEMPLATESTR\\$\\n" ), "" );
+ constructors.tqreplace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), "" );
}
else
{
- constructors.replace( TQRegExp( "\\$TEMPLATESTR\\$" ), templateStr );
- constructors.replace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), templateParams );
- classImpl.replace( TQRegExp( "#include \"\\$HEADER\\$\"\\n" ), "" );
+ constructors.tqreplace( TQRegExp( "\\$TEMPLATESTR\\$" ), templateStr );
+ constructors.tqreplace( TQRegExp( "\\$TEMPLATEPARAMS\\$" ), templateParams );
+ classImpl.tqreplace( TQRegExp( "#include \"\\$HEADER\\$\"\\n" ), "" );
}
// qWarning("NEW CLASS: constructors = %s", constructors.latin1());
- constructors.replace( TQRegExp( "\\$ARGS\\$" ), argsCpp );
+ constructors.tqreplace( TQRegExp( "\\$ARGS\\$" ), argsCpp );
// qWarning("NEW CLASS: constructors = %s", constructors.latin1());
@@ -1831,19 +1810,19 @@ void CppNewClassDialog::ClassGenerator::gen_implementation()
TQString hp = relPath + header;
beautifySource( classImpl, hp, className, namespaceBeg, constructors, advCpp, namespaceEnd, 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 );
+ 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 );
if ( ( dlg.m_part->project() ) && ( childClass || qobject ) && ( dlg.m_part->project() ->options() & KDevProject::UsesAutotoolsBuildSystem ) )
{
- TQString moc = header;
- moc.replace( TQRegExp( "\\..*" ), ".moc" );
- classImpl += "#include \"" + moc + "\"\n";
+ TQString tqmoc = header;
+ tqmoc.tqreplace( TQRegExp( "\\..*" ), ".tqmoc" );
+ classImpl += "#include \"" + tqmoc + "\"\n";
}
if ( dlg.gen_config->reformat_box->isChecked() )
@@ -1889,8 +1868,8 @@ void CppNewClassDialog::ClassGenerator::gen_interface()
classIntf = FileTemplate::read( dlg.m_part, fi.extension( true ) );
}
- classIntf.replace( TQRegExp( "\\$MODULE\\$" ), module );
- classIntf.replace( TQRegExp( "\\$FILENAME\\$" ), basefilename );
+ classIntf.tqreplace( TQRegExp( "\\$MODULE\\$" ), module );
+ classIntf.tqreplace( TQRegExp( "\\$FILENAME\\$" ), basefilename );
if ( objc )
{
@@ -1912,16 +1891,16 @@ void CppNewClassDialog::ClassGenerator::gen_interface()
+ namespaceBeg
+ TQString("class $CLASSNAME$$INHERITANCE$\n"
"{\n"
- "$QOBJECT$"
+ "$TQOBJECT$"
"public:\n")
+ ( advConstructorsHeader.isEmpty() ? TQString(" $CLASSNAME$($ARGS$);\n") : advConstructorsHeader )
+ TQString("\n ~$CLASSNAME$();\n")
+ advH_public
- + (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))
+ + (advH_public_slots.isEmpty() ? TQString::tqfromLatin1("") : ("\n\npublic slots:" + advH_public_slots))
+ + (advH_protected.isEmpty() ? TQString::tqfromLatin1("") : ("\n\nprotected:" + advH_protected))
+ + (advH_protected_slots.isEmpty() ? TQString::tqfromLatin1("") : ("\n\nprotected slots:" + advH_protected_slots))
+ + (advH_private.isEmpty() ? TQString::tqfromLatin1("") : ("\n\nprivate:" + advH_private))
+ + (advH_private_slots.isEmpty() ? TQString::tqfromLatin1("") : ("\n\nprivate slots:" + advH_private_slots))
+ TQString("};\n"
"\n")
+ namespaceEnd
@@ -1932,21 +1911,21 @@ void CppNewClassDialog::ClassGenerator::gen_interface()
switch ( dlg.gen_config->defCase() )
{
case ClassGeneratorConfig::UpperCase:
- headerGuard = namespaceStr.upper() + header.mid( header.findRev( "/" )+1 ).upper();
+ headerGuard = namespaceStr.upper() + header.mid( header.tqfindRev( "/" )+1 ).upper();
break;
case ClassGeneratorConfig::LowerCase:
- headerGuard = namespaceStr.lower() + header.mid( header.findRev( "/" )+1 ).lower();
+ headerGuard = namespaceStr.lower() + header.mid( header.tqfindRev( "/" )+1 ).lower();
break;
case ClassGeneratorConfig::SameAsFileCase:
- headerGuard = dlg.header_edit->text().mid( dlg.header_edit->text().findRev( "/" )+1 );
+ headerGuard = dlg.header_edit->text().mid( dlg.header_edit->text().tqfindRev( "/" )+1 );
break;
case ClassGeneratorConfig::SameAsClassCase:
- headerGuard = namespaceStr + header.mid( header.findRev( "/" )+1 );
+ headerGuard = namespaceStr + header.mid( header.tqfindRev( "/" )+1 );
break;
}
- headerGuard.replace( TQRegExp( "\\." ), "_" );
- headerGuard.replace( TQRegExp( "::" ), "_" );
+ headerGuard.tqreplace( TQRegExp( "\\." ), "_" );
+ headerGuard.tqreplace( TQRegExp( "::" ), "_" );
TQString includeBaseHeader;
if( dlg.m_part->qtBuildConfig()->isUsed() )
{
@@ -1983,8 +1962,8 @@ void CppNewClassDialog::ClassGenerator::gen_interface()
{
if ( !it.current() ->text( 0 ).isEmpty() )
if ( !it.current() ->text( 3 ).isEmpty() )
- // if ((!childClass) || (it.current()->text(0) != "TQWidget"))
- includeBaseHeader += ( includeBaseHeader.isEmpty() ? TQString( "" ) : TQString( "\n" ) ) + TQString::fromLatin1( "#include " ) +
+ // if ((!childClass) || (it.current()->text(0) != TQWIDGET_OBJECT_NAME_STRING))
+ includeBaseHeader += ( includeBaseHeader.isEmpty() ? TQString( "" ) : TQString( "\n" ) ) + TQString::tqfromLatin1( "#include " ) +
( it.current() ->text( 2 ).toInt() == 0 ? TQString( "<" ) : TQString( "\"" ) )
+ it.current() ->text( 3 )
+ ( it.current() ->text( 2 ).toInt() == 0 ? TQString( ">" ) : TQString( "\"" ) );
@@ -1995,7 +1974,7 @@ void CppNewClassDialog::ClassGenerator::gen_interface()
TQString author = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/author" );
TQString email = DomUtil::readEntry( *dlg.m_part->projectDom(), "/general/email" );
if( !email.isEmpty() )
- author += TQString( " <%1>" ).arg( email );
+ author += TQString( " <%1>" ).tqarg( email );
TQString inheritance;
if ( dlg.baseclasses_view->childCount() > 0 )
@@ -2009,13 +1988,13 @@ void CppNewClassDialog::ClassGenerator::gen_interface()
{
if ( inheritance != " : " )
inheritance += ", ";
- if ( it.current() ->text( 1 ).contains( "virtual" ) )
+ if ( it.current() ->text( 1 ).tqcontains( "virtual" ) )
inheritance += "virtual ";
- if ( it.current() ->text( 1 ).contains( "public" ) )
+ if ( it.current() ->text( 1 ).tqcontains( "public" ) )
inheritance += "public ";
- if ( it.current() ->text( 1 ).contains( "protected" ) )
+ if ( it.current() ->text( 1 ).tqcontains( "protected" ) )
inheritance += "protected ";
- if ( it.current() ->text( 1 ).contains( "private" ) )
+ if ( it.current() ->text( 1 ).tqcontains( "private" ) )
inheritance += "private ";
inheritance += it.current() ->text( 0 );
}
@@ -2029,12 +2008,12 @@ void CppNewClassDialog::ClassGenerator::gen_interface()
TQString( " $CLASSNAME$($ARGS$);" ) : advConstructorsHeader )
+ TQString( "\n\n ~$CLASSNAME$();" );
- constructors.replace( TQRegExp( "\\$CLASSNAME\\$" ), className );
- constructors.replace( TQRegExp( "\\$ARGS\\$" ), argsH );
+ constructors.tqreplace( TQRegExp( "\\$CLASSNAME\\$" ), className );
+ constructors.tqreplace( TQRegExp( "\\$ARGS\\$" ), argsH );
TQString qobjectStr;
if ( childClass || qobject )
- qobjectStr = "Q_OBJECT";
+ qobjectStr = "TQ_OBJECT";
TQString baseclass;
@@ -2047,30 +2026,30 @@ void CppNewClassDialog::ClassGenerator::gen_interface()
advH_protected, advH_protected_slots, advH_private, advH_private_slots, namespaceEnd );
- 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 );
+ 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 );
if ( dlg.baseclasses_view->childCount() > 0 )
- 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 );
+ 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 );
if ( !templateStr.isEmpty() && (!headeronly) )
- classIntf.replace( TQRegExp( "#endif" ), "#include \"" + dlg.implementation_edit->text() + "\"\n\n#endif" );
+ classIntf.tqreplace( TQRegExp( "#endif" ), "#include \"" + dlg.implementation_edit->text() + "\"\n\n#endif" );
if ( dlg.gen_config->reformat_box->isChecked() )
{
@@ -2102,45 +2081,45 @@ void CppNewClassDialog::ClassGenerator::beautifyHeader( TQString &templ, TQStrin
TQString &namespaceEnd )
{
if ( headerGuard.isEmpty() )
- templ.replace( TQRegExp( "\\$HEADERGUARD\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$HEADERGUARD\\$[\\n ]*" ), TQString() );
if ( includeBaseHeader.isEmpty() )
- templ.replace( TQRegExp( "\\$INCLUDEBASEHEADER\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$INCLUDEBASEHEADER\\$[\\n ]*" ), TQString() );
if ( author.isEmpty() )
- templ.replace( TQRegExp( "\\$AUTHOR\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$AUTHOR\\$[\\n ]*" ), TQString() );
if ( doc.isEmpty() )
- templ.replace( TQRegExp( "\\$DOC\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$DOC\\$[\\n ]*" ), TQString() );
if ( className.isEmpty() )
- templ.replace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString() );
if ( templateStr.isEmpty() )
- templ.replace( TQRegExp( "\\$TEMPLATE\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$TEMPLATE\\$[\\n ]*" ), TQString() );
if ( baseclass.isEmpty() )
- templ.replace( TQRegExp( "\\$BASECLASS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$BASECLASS\\$[\\n ]*" ), TQString() );
if ( inheritance.isEmpty() )
- templ.replace( TQRegExp( "\\$INHERITANCE\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$INHERITANCE\\$[\\n ]*" ), TQString() );
if ( qobjectStr.isEmpty() )
- templ.replace( TQRegExp( "\\$QOBJECT\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$TQOBJECT\\$[\\n ]*" ), TQString() );
if ( args.isEmpty() )
- templ.replace( TQRegExp( "\\$ARGS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$ARGS\\$[\\n ]*" ), TQString() );
if ( header.isEmpty() )
- templ.replace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString() );
if ( namespaceBeg.isEmpty() )
- templ.replace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString() );
if ( constructors.isEmpty() )
- templ.replace( TQRegExp( "\\$CONSTRUCTORDECLARATIONS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$CONSTRUCTORDECLARATIONS\\$[\\n ]*" ), TQString() );
if ( advH_public.isEmpty() )
- templ.replace( TQRegExp( "\\$PUBLICDECLARATIONS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$PUBLICDECLARATIONS\\$[\\n ]*" ), TQString() );
if ( advH_public_slots.isEmpty() )
- templ.replace( TQRegExp( "\\$PUBLICSLOTS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$PUBLICSLOTS\\$[\\n ]*" ), TQString() );
if ( advH_protected.isEmpty() )
- templ.replace( TQRegExp( "\\$PROTECTEDDECLARATIONS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$PROTECTEDDECLARATIONS\\$[\\n ]*" ), TQString() );
if ( advH_protected_slots.isEmpty() )
- templ.replace( TQRegExp( "\\$PROTECTEDSLOTS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$PROTECTEDSLOTS\\$[\\n ]*" ), TQString() );
if ( advH_private.isEmpty() )
- templ.replace( TQRegExp( "\\$PRIVATEDECLARATIONS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$PRIVATEDECLARATIONS\\$[\\n ]*" ), TQString() );
if ( advH_private_slots.isEmpty() )
- templ.replace( TQRegExp( "\\$PRIVATESLOTS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$PRIVATESLOTS\\$[\\n ]*" ), TQString() );
if ( namespaceEnd.isEmpty() )
- templ.replace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString() );
}
@@ -2148,19 +2127,19 @@ void CppNewClassDialog::ClassGenerator::beautifySource( TQString &templ, TQStrin
TQString &constructors, TQString &advCpp, TQString &namespaceEnd, TQString &implementation )
{
if ( header.isEmpty() )
- templ.replace( TQRegExp( "\\$HEADER\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$HEADER\\$[\\n ]*" ), TQString() );
if ( className.isEmpty() )
- templ.replace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$CLASSNAME\\$[\\n ]*" ), TQString() );
if ( namespaceBeg.isEmpty() )
- templ.replace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$NAMESPACEBEG\\$[\\n ]*" ), TQString() );
if ( constructors.isEmpty() )
- templ.replace( TQRegExp( "\\$CONSTRUCTORDEFINITIONS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$CONSTRUCTORDEFINITIONS\\$[\\n ]*" ), TQString() );
if ( advCpp.isEmpty() )
- templ.replace( TQRegExp( "\\$DEFINITIONS\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$DEFINITIONS\\$[\\n ]*" ), TQString() );
if ( namespaceEnd.isEmpty() )
- templ.replace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$NAMESPACEEND\\$[\\n ]*" ), TQString() );
if ( implementation.isEmpty() )
- templ.replace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString::null );
+ templ.tqreplace( TQRegExp( "\\$FILENAME\\$[\\n ]*" ), TQString() );
}
TQString CppNewClassDialog::classNameFormatted( )
@@ -2171,7 +2150,7 @@ TQString CppNewClassDialog::classNameFormatted( )
TQString CppNewClassDialog::classNameFormatted( const TQString &name )
{
TQString temp = name.simplifyWhiteSpace();
- return temp.replace( TQRegExp( "template *<.*> *(class *)?" ), "" );
+ return temp.tqreplace( TQRegExp( "template *<.*> *(class *)?" ), "" );
}
@@ -2184,9 +2163,9 @@ TQString CppNewClassDialog::templateStrFormatted( const TQString &name )
{
TQString className = name.simplifyWhiteSpace();
TQString temp = className;
- className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" );
- TQString templateStr = temp.replace( TQRegExp( QRegExp_escape( className ) ), "" );
- templateStr.replace( TQRegExp( " *class *$" ), "" );
+ className.tqreplace( TQRegExp( "template *<.*> *(class *)?" ), "" );
+ TQString templateStr = temp.tqreplace( TQRegExp( TQRegExp_escape( className ) ), "" );
+ templateStr.tqreplace( TQRegExp( " *class *$" ), "" );
return templateStr;
}
@@ -2199,13 +2178,13 @@ TQString CppNewClassDialog::templateParamsFormatted( const TQString &name )
{
TQString className = name.simplifyWhiteSpace();
TQString temp = className;
- className.replace( TQRegExp( "template *<.*> *(class *)?" ), "" );
- TQString templateStr = temp.replace( TQRegExp( QRegExp_escape( className ) ), "" );
- templateStr.replace( TQRegExp( " *class *$" ), "" );
+ className.tqreplace( TQRegExp( "template *<.*> *(class *)?" ), "" );
+ TQString templateStr = temp.tqreplace( TQRegExp( TQRegExp_escape( className ) ), "" );
+ templateStr.tqreplace( TQRegExp( " *class *$" ), "" );
TQString templateParams = templateStr;
- templateParams.replace( TQRegExp( "^ *template *" ), "" );
- templateParams.replace( TQRegExp( " *class *" ), "" );
+ templateParams.tqreplace( TQRegExp( "^ *template *" ), "" );
+ templateParams.tqreplace( TQRegExp( " *class *" ), "" );
templateParams.simplifyWhiteSpace();
return templateParams;
@@ -2215,19 +2194,19 @@ TQString CppNewClassDialog::templateActualParamsFormatted( const TQString & name
{
TQString className = name.simplifyWhiteSpace();
TQString temp = className;
- className.replace( TQRegExp( "<.*> *" ), "" );
- TQString templateStr = temp.replace( TQRegExp( QRegExp_escape( className ) ), "" );
+ className.tqreplace( TQRegExp( "<.*> *" ), "" );
+ TQString templateStr = temp.tqreplace( TQRegExp( TQRegExp_escape( className ) ), "" );
return templateStr;
}
void CppNewClassDialog::removeTemplateParams( TQString & name )
{
- name.replace( TQRegExp( "<.*> *" ), "" );
+ name.tqreplace( TQRegExp( "<.*> *" ), "" );
}
bool CppNewClassDialog::isDestructor( TQString className, const FunctionDom &method )
{
- if ( m_part->formatModelItem( method.data() ).contains( TQRegExp( " *~ *" + className ) ) )
+ if ( m_part->formatModelItem( method.data() ).tqcontains( TQRegExp( " *~ *" + className ) ) )
return true;
return false;
}
@@ -2239,4 +2218,4 @@ void CppNewClassDialog::headeronly_box_stateChanged(int val)
#include "cppnewclassdlg.moc"
-//kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on
+//kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on