Removed dummy int parameter from TQVariant(bool, int).

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/8/head
Michele Calgaro 5 years ago
parent e9567cacad
commit cfc76de73c
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -167,8 +167,7 @@ public:
TQVariant( uint ); TQVariant( uint );
TQVariant( TQ_LLONG ); TQVariant( TQ_LLONG );
TQVariant( TQ_ULLONG ); TQVariant( TQ_ULLONG );
// ### Problems on some compilers ? TQVariant( bool );
TQVariant( bool, int );
TQVariant( double ); TQVariant( double );
TQVariant( TQSizePolicy ); TQVariant( TQSizePolicy );

@ -85,7 +85,7 @@ bool TQUType_TQVariant::convertFrom( TQUObject *o, TQUType *t )
else if ( isEqual( o->type, &static_QUType_int ) ) else if ( isEqual( o->type, &static_QUType_int ) )
var = new TQVariant( static_QUType_int.get( o ) ); var = new TQVariant( static_QUType_int.get( o ) );
else if ( isEqual( o->type, &static_QUType_bool ) ) else if ( isEqual( o->type, &static_QUType_bool ) )
var = new TQVariant( static_QUType_bool.get( o ), 42 ); var = new TQVariant( static_QUType_bool.get( o ) );
else if ( isEqual( o->type, &static_QUType_double ) ) else if ( isEqual( o->type, &static_QUType_double ) )
var = new TQVariant( static_QUType_double.get( o ) ); var = new TQVariant( static_QUType_double.get( o ) );
else if ( isEqual( o->type, &static_QUType_charstar ) ) else if ( isEqual( o->type, &static_QUType_charstar ) )

@ -877,12 +877,10 @@ TQVariant::TQVariant( TQ_ULLONG val )
} }
/*! /*!
Constructs a new variant with a boolean value, \a val. The integer Constructs a new variant with a boolean value, \a val.
argument is a dummy, necessary for compatibility with some
compilers.
*/ */
TQVariant::TQVariant( bool val, int ) TQVariant::TQVariant( bool val )
{ // this is the comment that does NOT name said compiler. {
d = new Private; d = new Private;
d->typ = Bool; d->typ = Bool;
d->value.b = val; d->value.b = val;

@ -3441,16 +3441,14 @@ void generateClass() // generate C++ source code for a class
} }
if ( it.current()->getfunc ) { if ( it.current()->getfunc ) {
if ( it.current()->gspec == Property::Pointer ) if ( it.current()->gspec == Property::Pointer )
fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s()%s ); break;\n", fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s() ); break;\n",
it.current()->getfunc->name.data(), it.current()->getfunc->name.data(),
!isVariantType( it.current()->type ) ? "(int)" : "", !isVariantType( it.current()->type ) ? "(int)" : "",
it.current()->getfunc->name.data(), it.current()->getfunc->name.data());
it.current()->type == "bool" ? ", 0" : "" );
else else
fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s()%s ); break;\n", fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s() ); break;\n",
!isVariantType( it.current()->type ) ? "(int)" : "", !isVariantType( it.current()->type ) ? "(int)" : "",
it.current()->getfunc->name.data(), it.current()->getfunc->name.data());
it.current()->type == "bool" ? ", 0" : "" );
} else if ( it.current()->override ) { } else if ( it.current()->override ) {
flag_propagate |= 1<< (1+1); flag_propagate |= 1<< (1+1);
} }

@ -6316,16 +6316,14 @@ void generateClass() // generate C++ source code for a class
} }
if ( it.current()->getfunc ) { if ( it.current()->getfunc ) {
if ( it.current()->gspec == Property::Pointer ) if ( it.current()->gspec == Property::Pointer )
fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s()%s ); break;\n", fprintf( out, "\tcase 1: if ( this->%s() ) *v = TQVariant( %s*%s() ); break;\n",
it.current()->getfunc->name.data(), it.current()->getfunc->name.data(),
!isVariantType( it.current()->type ) ? "(int)" : "", !isVariantType( it.current()->type ) ? "(int)" : "",
it.current()->getfunc->name.data(), it.current()->getfunc->name.data());
it.current()->type == "bool" ? ", 0" : "" );
else else
fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s()%s ); break;\n", fprintf( out, "\tcase 1: *v = TQVariant( %sthis->%s() ); break;\n",
!isVariantType( it.current()->type ) ? "(int)" : "", !isVariantType( it.current()->type ) ? "(int)" : "",
it.current()->getfunc->name.data(), it.current()->getfunc->name.data());
it.current()->type == "bool" ? ", 0" : "" );
} else if ( it.current()->override ) { } else if ( it.current()->override ) {
flag_propagate |= 1<< (1+1); flag_propagate |= 1<< (1+1);
} }

@ -288,7 +288,7 @@ TQVariant TQPSQLResult::data( int i )
switch ( type ) { switch ( type ) {
case TQVariant::Bool: case TQVariant::Bool:
{ {
TQVariant b ( (bool)(val == "t"), 0 ); TQVariant b ( (bool)(val == "t") );
return ( b ); return ( b );
} }
case TQVariant::String: case TQVariant::String:

@ -185,12 +185,12 @@ TQDialogButtons::setDefaultButton(Button button)
if(d->def != button) { if(d->def != button) {
#ifndef TQT_NO_PROPERTIES #ifndef TQT_NO_PROPERTIES
if(d->buttons.contains(d->def)) if(d->buttons.contains(d->def))
d->buttons[d->def]->setProperty("default", TQVariant(FALSE,0)); d->buttons[d->def]->setProperty("default", TQVariant(false));
#endif #endif
d->def = button; d->def = button;
#ifndef TQT_NO_PROPERTIES #ifndef TQT_NO_PROPERTIES
if(d->buttons.contains(d->def)) if(d->buttons.contains(d->def))
d->buttons[d->def]->setProperty("default", TQVariant(FALSE,0)); d->buttons[d->def]->setProperty("default", TQVariant(false));
#endif #endif
} }
} }
@ -413,7 +413,7 @@ TQDialogButtons::layoutButtons()
if(b == d->def) { if(b == d->def) {
w->setFocus(); w->setFocus();
#ifndef TQT_NO_PROPERTIES #ifndef TQT_NO_PROPERTIES
w->setProperty("default", TQVariant(TRUE,0)); w->setProperty("default", TQVariant(true));
#endif #endif
} }
w->setEnabled(d->enabled & b); w->setEnabled(d->enabled & b);

@ -1740,8 +1740,8 @@ void MainWindow::handleRMBProperties( int id, TQMap<TQString, int> &props, TQWid
if ( oldDoWrap != doWrap ) { if ( oldDoWrap != doWrap ) {
TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) ); TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor, SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
"wordwrap", TQVariant( oldDoWrap, 0 ), "wordwrap", TQVariant( oldDoWrap ),
TQVariant( doWrap, 0 ), TQString::null, TQString::null ); TQVariant( doWrap ), TQString::null, TQString::null );
cmd->execute(); cmd->execute();
formWindow()->commandHistory()->addCommand( cmd ); formWindow()->commandHistory()->addCommand( cmd );
MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE ); MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );
@ -2647,8 +2647,8 @@ bool MainWindow::openEditor( TQWidget *w, FormWindow *f )
if ( oldDoWrap != doWrap ) { if ( oldDoWrap != doWrap ) {
TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) ); TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor, SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
"wordwrap", TQVariant( oldDoWrap, 0 ), "wordwrap", TQVariant( oldDoWrap ),
TQVariant( doWrap, 0 ), TQString::null, TQString::null ); TQVariant( doWrap ), TQString::null, TQString::null );
cmd->execute(); cmd->execute();
formWindow()->commandHistory()->addCommand( cmd ); formWindow()->commandHistory()->addCommand( cmd );
MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE ); MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );

@ -1103,7 +1103,7 @@ PropertyBoolItem::~PropertyBoolItem()
void PropertyBoolItem::toggle() void PropertyBoolItem::toggle()
{ {
bool b = value().toBool(); bool b = value().toBool();
setValue( TQVariant( !b, 0 ) ); setValue( TQVariant( !b ) );
setValue(); setValue();
} }
@ -1158,7 +1158,7 @@ void PropertyBoolItem::setValue()
return; return;
setText( 1, combo()->currentText() ); setText( 1, combo()->currentText() );
bool b = combo()->currentItem() == 0 ? (bool)FALSE : (bool)TRUE; bool b = combo()->currentItem() == 0 ? (bool)FALSE : (bool)TRUE;
PropertyItem::setValue( TQVariant( b, 0 ) ); PropertyItem::setValue( TQVariant( b ) );
notifyValueChange(); notifyValueChange();
} }
@ -1900,13 +1900,13 @@ void PropertyFontItem::initChildren()
} else if ( item->name() == tr( "Point Size" ) ) } else if ( item->name() == tr( "Point Size" ) )
item->setValue( val.toFont().pointSize() ); item->setValue( val.toFont().pointSize() );
else if ( item->name() == tr( "Bold" ) ) else if ( item->name() == tr( "Bold" ) )
item->setValue( TQVariant( val.toFont().bold(), 0 ) ); item->setValue( TQVariant( val.toFont().bold() ) );
else if ( item->name() == tr( "Italic" ) ) else if ( item->name() == tr( "Italic" ) )
item->setValue( TQVariant( val.toFont().italic(), 0 ) ); item->setValue( TQVariant( val.toFont().italic() ) );
else if ( item->name() == tr( "Underline" ) ) else if ( item->name() == tr( "Underline" ) )
item->setValue( TQVariant( val.toFont().underline(), 0 ) ); item->setValue( TQVariant( val.toFont().underline() ) );
else if ( item->name() == tr( "Strikeout" ) ) else if ( item->name() == tr( "Strikeout" ) )
item->setValue( TQVariant( val.toFont().strikeOut(), 0 ) ); item->setValue( TQVariant( val.toFont().strikeOut() ) );
} }
} }
@ -3702,9 +3702,9 @@ void PropertyList::setPropertyValue( PropertyItem *i )
} else if ( i->name() == "wordwrap" ) { } else if ( i->name() == "wordwrap" ) {
int align = editor->widget()->property( "alignment" ).toInt(); int align = editor->widget()->property( "alignment" ).toInt();
if ( align & WordBreak ) if ( align & WordBreak )
i->setValue( TQVariant( TRUE, 0 ) ); i->setValue( TQVariant( true ) );
else else
i->setValue( TQVariant( FALSE, 0 ) ); i->setValue( TQVariant( false ) );
} else if ( i->name() == "layoutSpacing" ) { } else if ( i->name() == "layoutSpacing" ) {
( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) ); ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) );
} else if ( i->name() == "layoutMargin" ) { } else if ( i->name() == "layoutMargin" ) {

@ -1486,13 +1486,13 @@ TQVariant WidgetFactory::defaultValue( TQObject *w, const TQString &propName )
{ {
if ( propName == "wordwrap" ) { if ( propName == "wordwrap" ) {
int v = defaultValue( w, "alignment" ).toInt(); int v = defaultValue( w, "alignment" ).toInt();
return TQVariant( ( v & WordBreak ) == WordBreak, 0 ); return TQVariant( ( v & WordBreak ) == WordBreak );
} else if ( propName == "toolTip" || propName == "whatsThis" ) { } else if ( propName == "toolTip" || propName == "whatsThis" ) {
return TQVariant( TQString::fromLatin1( "" ) ); return TQVariant( TQString::fromLatin1( "" ) );
} else if ( w->inherits( "CustomWidget" ) ) { } else if ( w->inherits( "CustomWidget" ) ) {
return TQVariant(); return TQVariant();
} else if ( propName == "frameworkCode" ) { } else if ( propName == "frameworkCode" ) {
return TQVariant( TRUE, 0 ); return TQVariant( true );
} else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) { } else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) {
return TQVariant( -1 ); return TQVariant( -1 );
} }

@ -718,7 +718,7 @@ void Dlg2Ui::emitWidgetBody( const TQDomElement& e, bool layouted )
if ( tagName == TQString("Style") ) { if ( tagName == TQString("Style") ) {
if ( getTextValue(n) == TQString("ReadWrite") ) if ( getTextValue(n) == TQString("ReadWrite") )
emitProperty( TQString("editable"), emitProperty( TQString("editable"),
TQVariant(TRUE, 0) ); TQVariant(true) );
} }
} else if ( parentTagName == TQString("DlgWidget") ) { } else if ( parentTagName == TQString("DlgWidget") ) {
if ( tagName == TQString("Name") ) { if ( tagName == TQString("Name") ) {
@ -891,7 +891,7 @@ TQVariant Dlg2Ui::getValue( const TQDomElement& e, const TQString& tagName,
if ( type == TQString("integer") ) { if ( type == TQString("integer") ) {
return getTextValue( e ).toInt(); return getTextValue( e ).toInt();
} else if ( type == TQString("boolean") ) { } else if ( type == TQString("boolean") ) {
return TQVariant( isTrue(getTextValue(e)), 0 ); return TQVariant( isTrue(getTextValue(e)) );
} else if ( type == TQString("double") ) { } else if ( type == TQString("double") ) {
return getTextValue( e ).toDouble(); return getTextValue( e ).toDouble();
} else if ( type == TQString("qcstring") ) { } else if ( type == TQString("qcstring") ) {

@ -839,7 +839,7 @@ void Glade2Ui::emitPushButton( const TQString& text, const TQString& name )
emitProperty( TQString("name"), name.latin1() ); emitProperty( TQString("name"), name.latin1() );
emitProperty( TQString("text"), text ); emitProperty( TQString("text"), text );
if ( name.contains(TQString("ok")) > 0 ) { if ( name.contains(TQString("ok")) > 0 ) {
emitProperty( TQString("default"), TQVariant(TRUE, 0) ); emitProperty( TQString("default"), TQVariant(true) );
} else if ( name.contains(TQString("help")) > 0 ) { } else if ( name.contains(TQString("help")) > 0 ) {
emitProperty( TQString("accel"), (int) TQt::Key_F1 ); emitProperty( TQString("accel"), (int) TQt::Key_F1 );
} }
@ -1215,7 +1215,7 @@ void Glade2Ui::emitTQListViewColumns( const TQDomElement& qlistview )
} else if ( tagName == TQString("class") ) { } else if ( tagName == TQString("class") ) {
TQString gtkClass = getTextValue( n ); TQString gtkClass = getTextValue( n );
if ( gtkClass.endsWith(TQString("Tree")) ) if ( gtkClass.endsWith(TQString("Tree")) )
emitProperty( TQString("rootIsDecorated"), TQVariant(TRUE, 0) ); emitProperty( TQString("rootIsDecorated"), TQVariant(true) );
} else if ( tagName == TQString("selection_mode") ) { } else if ( tagName == TQString("selection_mode") ) {
emitProperty( TQString("selectionMode"), emitProperty( TQString("selectionMode"),
gtk2qtSelectionMode(getTextValue(n)) ); gtk2qtSelectionMode(getTextValue(n)) );
@ -1815,16 +1815,16 @@ TQString Glade2Ui::emitWidget( const TQDomElement& widget, bool layouted,
if ( !layouted && (x != 0 || y != 0 || width != 0 || height != 0) ) if ( !layouted && (x != 0 || y != 0 || width != 0 || height != 0) )
emitProperty( TQString("geometry"), TQRect(x, y, width, height) ); emitProperty( TQString("geometry"), TQRect(x, y, width, height) );
if ( gtkClass == TQString("GtkToggleButton") ) { if ( gtkClass == TQString("GtkToggleButton") ) {
emitProperty( TQString("toggleButton"), TQVariant(TRUE, 0) ); emitProperty( TQString("toggleButton"), TQVariant(true) );
if ( active ) if ( active )
emitProperty( TQString("on"), TQVariant(TRUE, 0) ); emitProperty( TQString("on"), TQVariant(true) );
} else { } else {
if ( active ) if ( active )
emitProperty( TQString("checked"), TQVariant(TRUE, 0) ); emitProperty( TQString("checked"), TQVariant(true) );
} }
if ( !editable ) if ( !editable )
emitProperty( TQString("readOnly"), TQVariant(TRUE, 0) ); emitProperty( TQString("readOnly"), TQVariant(true) );
if ( !focusTarget.isEmpty() ) if ( !focusTarget.isEmpty() )
emitProperty( TQString("buddy"), emitProperty( TQString("buddy"),
fixedName(focusTarget).latin1() ); fixedName(focusTarget).latin1() );
@ -1889,7 +1889,7 @@ TQString Glade2Ui::emitWidget( const TQDomElement& widget, bool layouted,
} }
if ( !showText ) if ( !showText )
emitProperty( TQString("percentageVisible"), emitProperty( TQString("percentageVisible"),
TQVariant(FALSE, 0) ); TQVariant(false) );
if ( step != 1 ) if ( step != 1 )
emitProperty( TQString("lineStep"), step ); emitProperty( TQString("lineStep"), step );
if ( tabPos.endsWith(TQString("_BOTTOM")) || if ( tabPos.endsWith(TQString("_BOTTOM")) ||
@ -1905,12 +1905,12 @@ TQString Glade2Ui::emitWidget( const TQDomElement& widget, bool layouted,
if ( !tooltip.isEmpty() ) if ( !tooltip.isEmpty() )
emitProperty( TQString("toolTip"), tooltip ); emitProperty( TQString("toolTip"), tooltip );
if ( !valueInList ) if ( !valueInList )
emitProperty( TQString("editable"), TQVariant(TRUE, 0) ); emitProperty( TQString("editable"), TQVariant(true) );
if ( wrap && gtkClass == TQString("GtkSpinButton") ) if ( wrap && gtkClass == TQString("GtkSpinButton") )
emitProperty( TQString("wrapping"), TQVariant(TRUE, 0) ); emitProperty( TQString("wrapping"), TQVariant(true) );
if ( gtkClass.endsWith(TQString("Tree")) ) { if ( gtkClass.endsWith(TQString("Tree")) ) {
emitProperty( TQString("rootIsDecorated"), TQVariant(TRUE, 0) ); emitProperty( TQString("rootIsDecorated"), TQVariant(true) );
} else if ( gtkOrientedWidget.exactMatch(gtkClass) ) { } else if ( gtkOrientedWidget.exactMatch(gtkClass) ) {
TQString s = ( gtkOrientedWidget.cap(1) == TQChar('H') ) ? TQString s = ( gtkOrientedWidget.cap(1) == TQChar('H') ) ?
TQString( "Horizontal" ) : TQString( "Vertical" ); TQString( "Horizontal" ) : TQString( "Vertical" );

@ -199,7 +199,7 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def
v = TQVariant( e.firstChild().toText().data().toDouble() ); v = TQVariant( e.firstChild().toText().data().toDouble() );
} else if ( e.tagName() == "bool" ) { } else if ( e.tagName() == "bool" ) {
TQString t = e.firstChild().toText().data(); TQString t = e.firstChild().toText().data();
v = TQVariant( t == "true" || t == "1", 0 ); v = TQVariant( t == "true" || t == "1" );
} else if ( e.tagName() == "pixmap" ) { } else if ( e.tagName() == "pixmap" ) {
v = TQVariant( e.firstChild().toText().data() ); v = TQVariant( e.firstChild().toText().data() );
} else if ( e.tagName() == "iconset" ) { } else if ( e.tagName() == "iconset" ) {

@ -1052,7 +1052,7 @@ void Uic::createFormImpl( const TQDomElement &e )
TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); TQString label = DomTool::readAttribute( n, "title", "", comment ).toString();
out << indent << "addPage( " << page << ", TQString(\"\") );" << endl; out << indent << "addPage( " << page << ", TQString(\"\") );" << endl;
trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " );" << endl; trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " );" << endl;
TQVariant def( FALSE, 0 ); TQVariant def( false );
if ( DomTool::hasAttribute( n, "backEnabled" ) ) if ( DomTool::hasAttribute( n, "backEnabled" ) )
out << indent << "setBackEnabled( " << page << ", " << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << endl; out << indent << "setBackEnabled( " << page << ", " << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << endl;
if ( DomTool::hasAttribute( n, "nextEnabled" ) ) if ( DomTool::hasAttribute( n, "nextEnabled" ) )

@ -537,7 +537,7 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj,
if ( stdset ) if ( stdset )
v = "%1"; v = "%1";
else else
v = "TQVariant( %1, 0 )"; v = "TQVariant( %1 )";
v = v.arg( mkBool( e.firstChild().toText().data() ) ); v = v.arg( mkBool( e.firstChild().toText().data() ) );
} else if ( e.tagName() == "pixmap" ) { } else if ( e.tagName() == "pixmap" ) {
v = e.firstChild().toText().data(); v = e.firstChild().toText().data();

@ -263,7 +263,7 @@ bool Uic::isFrameworkCodeGenerated( const TQDomElement& e )
{ {
TQDomElement n = getObjectProperty( e, "frameworkCode" ); TQDomElement n = getObjectProperty( e, "frameworkCode" );
if ( n.attribute("name") == "frameworkCode" && if ( n.attribute("name") == "frameworkCode" &&
!DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( TRUE, 0 ) ).toBool() ) !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( true ) ).toBool() )
return FALSE; return FALSE;
return TRUE; return TRUE;
} }

@ -637,7 +637,7 @@ void TQWidgetFactory::unpackVariant( const UibStrTable& strings, TQDataStream& i
break; break;
case TQVariant::Bool: case TQVariant::Bool:
in >> bit; in >> bit;
value = TQVariant( bit != 0, 0 ); value = TQVariant( bit != 0 );
break; break;
case TQVariant::Double: case TQVariant::Double:
in >> value.asDouble(); in >> value.asDouble();

Loading…
Cancel
Save