From a2fa7ca9838e204ec41c39fcb80ee82ec93d084f Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 27 May 2019 00:31:56 +0900 Subject: Adjusted to latest QVariant::QVariant(bool) function. Signed-off-by: Michele Calgaro --- src/moc/moc.y | 10 ++++------ src/moc/moc_yacc.cpp | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'src/moc') diff --git a/src/moc/moc.y b/src/moc/moc.y index 90f72ab..b117b68 100644 --- a/src/moc/moc.y +++ b/src/moc/moc.y @@ -3441,16 +3441,14 @@ void generateClass() // generate C++ source code for a class } if ( it.current()->getfunc ) { if ( it.current()->gspec == Property::Pointer ) - fprintf( out, "\tcase 1: if ( this->%s() ) *v = QVariant( %s*%s()%s ); break;\n", + fprintf( out, "\tcase 1: if ( this->%s() ) *v = QVariant( %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 = QVariant( %sthis->%s()%s ); break;\n", + fprintf( out, "\tcase 1: *v = QVariant( %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); } diff --git a/src/moc/moc_yacc.cpp b/src/moc/moc_yacc.cpp index 2ab0be7..8d48f86 100644 --- a/src/moc/moc_yacc.cpp +++ b/src/moc/moc_yacc.cpp @@ -6267,16 +6267,14 @@ void generateClass() // generate C++ source code for a class } if ( it.current()->getfunc ) { if ( it.current()->gspec == Property::Pointer ) - fprintf( out, "\tcase 1: if ( this->%s() ) *v = QVariant( %s*%s()%s ); break;\n", + fprintf( out, "\tcase 1: if ( this->%s() ) *v = QVariant( %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 = QVariant( %sthis->%s()%s ); break;\n", + fprintf( out, "\tcase 1: *v = QVariant( %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); } -- cgit v1.2.1