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