diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2021-03-07 20:24:08 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2021-03-12 00:35:39 +0100 |
commit | 369d8455ac39aa9f5328b855bd5f456e3f384a63 (patch) | |
tree | ea0e74835bcc4c1ca9245316ffebf9a439828dd3 /kommander/editor/resource.cpp | |
parent | eea71ca9ecdfbd4682054a86cc9bbf954af94693 (diff) | |
download | tdewebdev-369d8455ac39aa9f5328b855bd5f456e3f384a63.tar.gz tdewebdev-369d8455ac39aa9f5328b855bd5f456e3f384a63.zip |
Added controlled conversions to char* instead of automatic ascii conversions.
The definition of -UTQT_NO_ASCII_CAST is no longer needed.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 70defe5e6d9498c5c6011eee50c4dc506abebd61)
Diffstat (limited to 'kommander/editor/resource.cpp')
-rw-r--r-- | kommander/editor/resource.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/kommander/editor/resource.cpp b/kommander/editor/resource.cpp index 6246498f..05f3b01b 100644 --- a/kommander/editor/resource.cpp +++ b/kommander/editor/resource.cpp @@ -363,7 +363,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev ) slot.returnType = n.attribute( "returnType", "void" ); if ( slot.returnType.isEmpty() ) slot.returnType = "void"; - slot.slot = n.firstChild().toText().data(); + slot.slot = n.firstChild().toText().data().utf8(); if ( !MetaDataBase::hasSlot( TQT_TQOBJECT(formwindow), slot.slot, true ) ) MetaDataBase::addSlot( TQT_TQOBJECT(formwindow), slot.slot, slot.specifier, slot.access, slot.language, slot.returnType ); @@ -1066,8 +1066,8 @@ 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->metaObject()->property( w->metaObject()->findProperty( name, true ), true ); - TQStrList l( p->valueToKeys( w->property( name ).toInt() ) ); + const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name.latin1(), true ), true ); + TQStrList l( p->valueToKeys( w->property( name.latin1() ).toInt() ) ); TQString v; for ( uint i = 0; i < l.count(); ++i ) { v += l.at( i ); @@ -1079,8 +1079,8 @@ 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->metaObject()->property( w->metaObject()->findProperty( name, true ), true ); - ts << makeIndent( indent ) << "<enum>" << p->valueToKey( w->property( name ).toInt() ) << "</enum>" << endl; + const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name.latin1(), true ), true ); + ts << makeIndent( indent ) << "<enum>" << p->valueToKey( w->property( name.latin1() ).toInt() ) << "</enum>" << endl; } void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant &value, TQVariant::Type t, TQTextStream &ts, int indent ) @@ -1644,7 +1644,7 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay */ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQDomElement &e ) { - const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true ); + const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop.latin1(), true ), true ); if ( !obj->inherits( "TQLayout" ) ) {// no layouts in metadatabase... (RS) if ( obj->inherits( "CustomWidget" ) ) { @@ -1720,13 +1720,13 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD v = TQPalette( p ); } else if ( e.tagName() == "enum" && p && p->isEnumType() ) { TQString key( v.toString() ); - v = TQVariant( p->keyToValue( key ) ); + v = TQVariant( p->keyToValue( key.utf8() ) ); } else if ( e.tagName() == "set" && p && p->isSetType() ) { TQString keys( v.toString() ); TQStringList lst = TQStringList::split( '|', keys ); TQStrList l; for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) - l.append( *it ); + l.append( (*it).utf8() ); v = TQVariant( p->keysToValue( l ) ); } @@ -1769,7 +1769,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD if ( pasting ) { TQString s = v.toString(); formwindow->unify( TQT_TQOBJECT(obj), s, true ); - obj->setName( s ); + obj->setName( s.utf8() ); return; } else if ( formwindow && TQT_BASE_OBJECT(obj) == formwindow->mainContainer() ) { formwindow->setName( v.toCString() ); @@ -1781,7 +1781,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD sp.setHeightForWidth( ( (TQWidget*)obj )->sizePolicy().hasHeightForWidth() ); } - obj->setProperty( prop, v ); + obj->setProperty( prop.latin1(), v ); } @@ -1876,7 +1876,7 @@ static TQImage loadImageData( TQDomElement &n2 ) ::uncompress( (uchar*) baunzip.data(), &len, (uchar*) ba, data.length()/2 ); img.loadFromData( (const uchar*)baunzip.data(), len, "XPM" ); } else { - img.loadFromData( (const uchar*)ba, data.length() / 2, format ); + img.loadFromData( (const uchar*)ba, data.length() / 2, format.utf8() ); } delete [] ba; @@ -1994,12 +1994,12 @@ void Resource::loadConnections( const TQDomElement &e ) if ( n2.tagName() == "sender" ) { conn.sender = 0; TQString name = n2.firstChild().toText().data(); - if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { + if ( name == "this" || toplevel->name() == name ) { conn.sender = TQT_TQOBJECT(toplevel); } else { if ( name == "this" ) name = toplevel->name(); - TQObjectList *l = toplevel->queryList( 0, name, false ); + TQObjectList *l = toplevel->queryList( 0, name.utf8(), false ); if ( l ) { if ( l->first() ) conn.sender = l->first(); @@ -2009,13 +2009,13 @@ void Resource::loadConnections( const TQDomElement &e ) conn.sender = formwindow->findAction( name ); } } else if ( n2.tagName() == "signal" ) { - conn.signal = n2.firstChild().toText().data(); + conn.signal = n2.firstChild().toText().data().utf8(); } else if ( n2.tagName() == "receiver" ) { TQString name = n2.firstChild().toText().data(); - if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { + if ( name == "this" || toplevel->name() == name ) { conn.receiver = TQT_TQOBJECT(toplevel); } else { - TQObjectList *l = toplevel->queryList( 0, name, false ); + TQObjectList *l = toplevel->queryList( 0, name.utf8(), false ); if ( l ) { if ( l->first() ) conn.receiver = l->first(); @@ -2023,7 +2023,7 @@ void Resource::loadConnections( const TQDomElement &e ) } } } else if ( n2.tagName() == "slot" ) { - conn.slot = n2.firstChild().toText().data(); + conn.slot = n2.firstChild().toText().data().utf8(); } n2 = n2.nextSibling().toElement(); } @@ -2060,7 +2060,7 @@ void Resource::loadConnections( const TQDomElement &e ) slot.returnType = n.attribute( "returnType", "void" ); if ( slot.returnType.isEmpty() ) slot.returnType = "void"; - slot.slot = n.firstChild().toText().data(); + slot.slot = n.firstChild().toText().data().utf8(); if ( !MetaDataBase::hasSlot( TQT_TQOBJECT(formwindow), slot.slot, true ) ) MetaDataBase::addSlot( TQT_TQOBJECT(formwindow), slot.slot, slot.specifier, slot.access, slot.language, slot.returnType ); @@ -2233,7 +2233,7 @@ void Resource::loadTabOrder( const TQDomElement &e ) TQString name = n.firstChild().toText().data(); if ( name.isEmpty() ) continue; - TQObjectList *l = toplevel->queryList( 0, name, false ); + TQObjectList *l = toplevel->queryList( 0, name.utf8(), false ); if ( l ) { if ( l->first() ) { TQWidget *w = (TQWidget*)l->first(); @@ -2611,7 +2611,7 @@ void Resource::loadMenuBar( const TQDomElement &e ) while ( !n.isNull() ) { if ( n.tagName() == "item" ) { QDesignerPopupMenu *popup = new QDesignerPopupMenu( mw ); - popup->setName( n.attribute( "name" ) ); + popup->setName( n.attribute( "name" ).utf8() ); TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "action" ) { |