Branch: master

cfc76de7 2019-05-23 13:57:29 Michele Calgaro
Removed dummy int parameter from TQVariant(bool, int).

Signed-off-by: Michele Calgaro <michele.calgaro@...>
M src/kernel/ntqvariant.h
M src/kernel/qucomextra.cpp
M src/kernel/qvariant.cpp
M src/moc/moc.y
M src/moc/moc_yacc.cpp
M src/sql/drivers/psql/qsql_psql.cpp
M src/widgets/qdialogbuttons.cpp
M tools/designer/designer/mainwindow.cpp
M tools/designer/designer/propertyeditor.cpp
M tools/designer/designer/widgetfactory.cpp
M tools/designer/plugins/dlg/dlg2ui.cpp
M tools/designer/plugins/glade/glade2ui.cpp
M tools/designer/shared/domtool.cpp
M tools/designer/uic/form.cpp
M tools/designer/uic/object.cpp
M tools/designer/uic/uic.cpp
M tools/designer/uilib/qwidgetfactory.cpp

src/kernel/ntqvariant.h

diff --git a/src/kernel/ntqvariant.h b/src/kernel/ntqvariant.h
index f794eeb..1d5206d 100644
--- a/src/kernel/ntqvariant.h
+++ b/src/kernel/ntqvariant.h
@@ -167,8 +167,7 @@
     TQVariant( uint );
     TQVariant( TQ_LLONG );
     TQVariant( TQ_ULLONG );
-    // ### Problems on some compilers ?
-    TQVariant( bool, int );
+    TQVariant( bool );
     TQVariant( double );
     TQVariant( TQSizePolicy );
 

src/kernel/qucomextra.cpp

diff --git a/src/kernel/qucomextra.cpp b/src/kernel/qucomextra.cpp
index 1bb064c..53af84d 100644
--- a/src/kernel/qucomextra.cpp
+++ b/src/kernel/qucomextra.cpp
@@ -85,7 +85,7 @@
     else if ( isEqual( o->type, &static_QUType_int ) )
 	var = new TQVariant( static_QUType_int.get( o ) );
     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 ) )
 	var = new TQVariant( static_QUType_double.get( o ) );
     else if ( isEqual( o->type, &static_QUType_charstar ) )

src/kernel/qvariant.cpp

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

src/moc/moc.y

diff --git a/src/moc/moc.y b/src/moc/moc.y
index 49fcc61..cfd8af0 100644
--- a/src/moc/moc.y
+++ b/src/moc/moc.y
@@ -3441,16 +3441,14 @@
 	    }
 	    if ( it.current()->getfunc ) {
 		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(),
 			     !isVariantType( it.current()->type ) ? "(int)" : "",
-			     it.current()->getfunc->name.data(),
-			     it.current()->type == "bool" ? ", 0" : "" );
+			     it.current()->getfunc->name.data());
 		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)" : "",
-			     it.current()->getfunc->name.data(),
-			     it.current()->type == "bool" ? ", 0" : "" );
+			     it.current()->getfunc->name.data());
 	    } else if ( it.current()->override ) {
 		flag_propagate |= 1<< (1+1);
 	    }

src/moc/moc_yacc.cpp

diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp
index f2a5c53..f5c59d8 100644
--- a/src/moc/moc_yacc.cpp
+++ b/src/moc/moc_yacc.cpp
@@ -6316,16 +6316,14 @@
 	    }
 	    if ( it.current()->getfunc ) {
 		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(),
 			     !isVariantType( it.current()->type ) ? "(int)" : "",
-			     it.current()->getfunc->name.data(),
-			     it.current()->type == "bool" ? ", 0" : "" );
+			     it.current()->getfunc->name.data());
 		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)" : "",
-			     it.current()->getfunc->name.data(),
-			     it.current()->type == "bool" ? ", 0" : "" );
+			     it.current()->getfunc->name.data());
 	    } else if ( it.current()->override ) {
 		flag_propagate |= 1<< (1+1);
 	    }

src/sql/drivers/psql/qsql_psql.cpp

diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 8e2c02a..b6466e8 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -288,7 +288,7 @@
     switch ( type ) {
     case TQVariant::Bool:
 	{
-	    TQVariant b ( (bool)(val == "t"), 0 );
+	    TQVariant b ( (bool)(val == "t") );
 	    return ( b );
 	}
     case TQVariant::String:

src/widgets/qdialogbuttons.cpp

diff --git a/src/widgets/qdialogbuttons.cpp b/src/widgets/qdialogbuttons.cpp
index c248d2e..fd3d5c4 100644
--- a/src/widgets/qdialogbuttons.cpp
+++ b/src/widgets/qdialogbuttons.cpp
@@ -185,12 +185,12 @@
     if(d->def != button) {
 #ifndef TQT_NO_PROPERTIES
 	if(d->buttons.contains(d->def))
-	    d->buttons[d->def]->setProperty("default", TQVariant(FALSE,0));
+	    d->buttons[d->def]->setProperty("default", TQVariant(false));
 #endif
 	d->def = button;
 #ifndef TQT_NO_PROPERTIES
 	if(d->buttons.contains(d->def))
-	    d->buttons[d->def]->setProperty("default", TQVariant(FALSE,0));
+	    d->buttons[d->def]->setProperty("default", TQVariant(false));
 #endif
     }
 }
@@ -413,7 +413,7 @@
 		    if(b == d->def) {
 			w->setFocus();
 #ifndef TQT_NO_PROPERTIES
-			w->setProperty("default", TQVariant(TRUE,0));
+			w->setProperty("default", TQVariant(true));
 #endif
 		    }
 		    w->setEnabled(d->enabled & b);

tools/designer/designer/mainwindow.cpp

diff --git a/tools/designer/designer/mainwindow.cpp b/tools/designer/designer/mainwindow.cpp
index f80cf60..5e4a467 100644
--- a/tools/designer/designer/mainwindow.cpp
+++ b/tools/designer/designer/mainwindow.cpp
@@ -1740,8 +1740,8 @@
 	    if ( oldDoWrap != doWrap ) {
 		TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
 		SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
-								  "wordwrap", TQVariant( oldDoWrap, 0 ),
-								  TQVariant( doWrap, 0 ), TQString::null, TQString::null );
+								  "wordwrap", TQVariant( oldDoWrap ),
+								  TQVariant( doWrap ), TQString::null, TQString::null );
 		cmd->execute();
 		formWindow()->commandHistory()->addCommand( cmd );
 		MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );
@@ -2647,8 +2647,8 @@
 	    if ( oldDoWrap != doWrap ) {
 		TQString pn( tr( "Set 'wordwrap' of '%1'" ).arg( w->name() ) );
 		SetPropertyCommand *cmd = new SetPropertyCommand( pn, formWindow(), w, propertyEditor,
-								  "wordwrap", TQVariant( oldDoWrap, 0 ),
-								  TQVariant( doWrap, 0 ), TQString::null, TQString::null );
+								  "wordwrap", TQVariant( oldDoWrap ),
+								  TQVariant( doWrap ), TQString::null, TQString::null );
 		cmd->execute();
 		formWindow()->commandHistory()->addCommand( cmd );
 		MetaDataBase::setPropertyChanged( w, "wordwrap", TRUE );

tools/designer/designer/propertyeditor.cpp

diff --git a/tools/designer/designer/propertyeditor.cpp b/tools/designer/designer/propertyeditor.cpp
index b3448a8..31908b3 100644
--- a/tools/designer/designer/propertyeditor.cpp
+++ b/tools/designer/designer/propertyeditor.cpp
@@ -1103,7 +1103,7 @@
 void PropertyBoolItem::toggle()
 {
     bool b = value().toBool();
-    setValue( TQVariant( !b, 0 ) );
+    setValue( TQVariant( !b ) );
     setValue();
 }
 
@@ -1158,7 +1158,7 @@
 	return;
     setText( 1, combo()->currentText() );
     bool b = combo()->currentItem() == 0 ? (bool)FALSE : (bool)TRUE;
-    PropertyItem::setValue( TQVariant( b, 0 ) );
+    PropertyItem::setValue( TQVariant( b ) );
     notifyValueChange();
 }
 
@@ -1900,13 +1900,13 @@
 	} else if ( item->name() == tr( "Point Size" ) )
 	    item->setValue( val.toFont().pointSize() );
 	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" ) )
-	    item->setValue( TQVariant( val.toFont().italic(), 0 ) );
+	    item->setValue( TQVariant( val.toFont().italic() ) );
 	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" ) )
-	    item->setValue( TQVariant( val.toFont().strikeOut(), 0 ) );
+	    item->setValue( TQVariant( val.toFont().strikeOut() ) );
     }
 }
 
@@ -3702,9 +3702,9 @@
 	} else if ( i->name() == "wordwrap" ) {
 	    int align = editor->widget()->property( "alignment" ).toInt();
 	    if ( align & WordBreak )
-		i->setValue( TQVariant( TRUE, 0 ) );
+		i->setValue( TQVariant( true ) );
 	    else
-		i->setValue( TQVariant( FALSE, 0 ) );
+		i->setValue( TQVariant( false ) );
 	} else if ( i->name() == "layoutSpacing" ) {
 	    ( (PropertyLayoutItem*)i )->setValue( MetaDataBase::spacing( WidgetFactory::containerOfWidget( (TQWidget*)editor->widget() ) ) );
 	} else if ( i->name() == "layoutMargin" ) {

tools/designer/designer/widgetfactory.cpp

diff --git a/tools/designer/designer/widgetfactory.cpp b/tools/designer/designer/widgetfactory.cpp
index 53fa747..2bcf188 100644
--- a/tools/designer/designer/widgetfactory.cpp
+++ b/tools/designer/designer/widgetfactory.cpp
@@ -1486,13 +1486,13 @@
 {
     if ( propName == "wordwrap" ) {
 	int v = defaultValue( w, "alignment" ).toInt();
-	return TQVariant( ( v & WordBreak ) == WordBreak, 0 );
+	return TQVariant( ( v & WordBreak ) == WordBreak );
     } else if ( propName == "toolTip" || propName == "whatsThis" ) {
 	return TQVariant( TQString::fromLatin1( "" ) );
     } else if ( w->inherits( "CustomWidget" ) ) {
 	return TQVariant();
     } else if ( propName == "frameworkCode" ) {
-	return TQVariant( TRUE, 0 );
+	return TQVariant( true );
     } else if ( propName == "layoutMargin" || propName == "layoutSpacing" ) {
 	return TQVariant( -1 );
     }

tools/designer/plugins/dlg/dlg2ui.cpp

diff --git a/tools/designer/plugins/dlg/dlg2ui.cpp b/tools/designer/plugins/dlg/dlg2ui.cpp
index e44c285..23e1806 100644
--- a/tools/designer/plugins/dlg/dlg2ui.cpp
+++ b/tools/designer/plugins/dlg/dlg2ui.cpp
@@ -718,7 +718,7 @@
 			if ( tagName == TQString("Style") ) {
 			    if ( getTextValue(n) == TQString("ReadWrite") )
 				emitProperty( TQString("editable"),
-					      TQVariant(TRUE, 0) );
+					      TQVariant(true) );
 			}
 		    } else if ( parentTagName == TQString("DlgWidget") ) {
 			if ( tagName == TQString("Name") ) {
@@ -891,7 +891,7 @@
** Diff limit reached (max: 250 lines) **