diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-05-30 14:27:29 +0900 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-06-25 16:43:08 +0900 |
| commit | 35ced32e331ee29fda1642616c803637952f5b22 (patch) | |
| tree | da44726777f814e19c7ef1e43854f6a1693dd6fb /tools/designer/uic/form.cpp | |
| parent | 7dd4848d61e4c52091d6c644356c84c67536bde2 (diff) | |
| download | tqt-35ced32e.tar.gz tqt-35ced32e.zip | |
Replace TRUE/FALSE with boolean values true/false - part 1
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit a7f1e6e2552d9cdbb3d76bff089db522248b9a24)
Diffstat (limited to 'tools/designer/uic/form.cpp')
| -rw-r--r-- | tools/designer/uic/form.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/tools/designer/uic/form.cpp b/tools/designer/uic/form.cpp index 42ee08cb1..5db986f6a 100644 --- a/tools/designer/uic/form.cpp +++ b/tools/designer/uic/form.cpp @@ -87,9 +87,9 @@ TQCString combinePath( const char *infile, const char *outfile ) int numCommonComponents = 0; TQStringList inSplitted = - TQStringList::split( '/', inFileInfo.dir().canonicalPath(), TRUE ); + TQStringList::split( '/', inFileInfo.dir().canonicalPath(), true ); TQStringList outSplitted = - TQStringList::split( '/', outFileInfo.dir().canonicalPath(), TRUE ); + TQStringList::split( '/', outFileInfo.dir().canonicalPath(), true ); while ( !inSplitted.isEmpty() && !outSplitted.isEmpty() && inSplitted.first() == outSplitted.first() ) { @@ -263,7 +263,7 @@ void Uic::createFormDecl( const TQDomElement &e ) out << "class TQPopupMenu;" << endl; } - bool dbForm = FALSE; + bool dbForm = false; registerDatabases( e ); dbConnections = unique( dbConnections ); if ( dbConnections.count() ) @@ -271,12 +271,12 @@ void Uic::createFormDecl( const TQDomElement &e ) if ( dbCursors.count() ) forwardDecl += "TQSqlCursor"; if ( dbForms[ "(default)" ].count() ) - dbForm = TRUE; - bool subDbForms = FALSE; + dbForm = true; + bool subDbForms = false; for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { if ( !(*it).isEmpty() && (*it) != "(default)" ) { if ( dbForms[ (*it) ].count() ) { - subDbForms = TRUE; + subDbForms = true; break; } } @@ -380,12 +380,12 @@ void Uic::createFormDecl( const TQDomElement &e ) // constructor if ( objClass == "TQDialog" || objClass == "TQWizard" ) { - out << " " << bareNameOfClass << "( TQWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );" << endl; + out << " " << bareNameOfClass << "( TQWidget* parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );" << endl; } else if ( objClass == "TQWidget" ) { out << " " << bareNameOfClass << "( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 );" << endl; } else if ( objClass == "TQMainWindow" ) { out << " " << bareNameOfClass << "( TQWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel );" << endl; - isMainWindow = TRUE; + isMainWindow = true; } else { out << " " << bareNameOfClass << "( TQWidget* parent = 0, const char* name = 0 );" << endl; } @@ -395,7 +395,7 @@ void Uic::createFormDecl( const TQDomElement &e ) out << endl; // children - bool needPolish = FALSE; + bool needPolish = false; nl = e.parentNode().toElement().elementsByTagName( "widget" ); for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget n = nl.item(i).toElement(); @@ -406,7 +406,7 @@ void Uic::createFormDecl( const TQDomElement &e ) TQString s = getClassName( n ); if ( s == "TQDataTable" || s == "TQDataBrowser" ) { if ( isFrameworkCodeGenerated( n ) ) - needPolish = TRUE; + needPolish = true; } } @@ -428,13 +428,13 @@ void Uic::createFormDecl( const TQDomElement &e ) // database connections dbConnections = unique( dbConnections ); - bool hadOutput = FALSE; + bool hadOutput = false; for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { if ( !(*it).isEmpty() ) { // only need pointers to non-default connections if ( (*it) != "(default)" && !(*it).isEmpty() ) { out << indent << "TQSqlDatabase* " << *it << "Connection;" << endl; - hadOutput = TRUE; + hadOutput = true; } } } @@ -756,14 +756,14 @@ void Uic::createFormImpl( const TQDomElement &e ) globalIncludes += "ntqsqldatabase.h"; if ( dbCursors.count() ) globalIncludes += "ntqsqlcursor.h"; - bool dbForm = FALSE; + bool dbForm = false; if ( dbForms[ "(default)" ].count() ) - dbForm = TRUE; - bool subDbForms = FALSE; + dbForm = true; + bool subDbForms = false; for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { if ( !(*it).isEmpty() && (*it) != "(default)" ) { if ( dbForms[ (*it) ].count() ) { - subDbForms = TRUE; + subDbForms = true; break; } } @@ -869,7 +869,7 @@ void Uic::createFormImpl( const TQDomElement &e ) if ( !outputFileName.isEmpty() ) uiDotH = combinePath( uiDotH, outputFileName ); out << "#include \"" << uiDotH << "\"" << endl; - writeFunctImpl = FALSE; + writeFunctImpl = false; } // register the object and unify its name @@ -900,7 +900,7 @@ void Uic::createFormImpl( const TQDomElement &e ) // resulting 'length' to catch corrupt UIC files? int a = 0; int column = 0; - bool inQuote = FALSE; + bool inQuote = false; out << "static const char* const " << img << "_data[] = { " << endl; while ( baunzip[a] != '\"' ) a++; @@ -948,7 +948,7 @@ void Uic::createFormImpl( const TQDomElement &e ) out << " * name 'name' and widget flags set to 'f'." << endl; out << " *" << endl; out << " * The " << objClass.mid(1).lower() << " will by default be modeless, unless you set 'modal' to" << endl; - out << " * TRUE to construct a modal " << objClass.mid(1).lower() << "." << endl; + out << " * true to construct a modal " << objClass.mid(1).lower() << "." << endl; out << " */" << endl; out << nameOfClass << "::" << bareNameOfClass << "( TQWidget* parent, const char* name, bool modal, WFlags fl )" << endl; out << " : " << objClass << "( parent, name, modal, fl )"; @@ -967,7 +967,7 @@ void Uic::createFormImpl( const TQDomElement &e ) out << " */" << endl; out << nameOfClass << "::" << bareNameOfClass << "( TQWidget* parent, const char* name, WFlags fl )" << endl; out << " : " << objClass << "( parent, name, fl )"; - isMainWindow = TRUE; + isMainWindow = true; } else { out << "/*" << endl; out << " * Constructs a " << nameOfClass << " which is a child of 'parent', with the" << endl; @@ -1099,35 +1099,35 @@ void Uic::createFormImpl( const TQDomElement &e ) } // actions, toolbars, menubar - bool needEndl = FALSE; + bool needEndl = false; for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "actions" ) { if ( !needEndl ) out << endl << indent << "// actions" << endl; createActionImpl( n.firstChild().toElement(), "this" ); - needEndl = TRUE; + needEndl = true; } } if ( needEndl ) out << endl; - needEndl = FALSE; + needEndl = false; for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "toolbars" ) { if ( !needEndl ) out << endl << indent << "// toolbars" << endl; createToolbarImpl( n, objClass, objName ); - needEndl = TRUE; + needEndl = true; } } if ( needEndl ) out << endl; - needEndl = FALSE; + needEndl = false; for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "menubar" ) { if ( !needEndl ) out << endl << indent << "// menubar" << endl; createMenuBarImpl( n, objClass, objName ); - needEndl = TRUE; + needEndl = true; } } if ( needEndl ) @@ -1201,14 +1201,14 @@ void Uic::createFormImpl( const TQDomElement &e ) } // buddies - bool firstBuddy = TRUE; + bool firstBuddy = true; for ( TQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { if ( isObjectRegistered( (*buddy).buddy ) ) { if ( firstBuddy ) { out << endl << indent << "// buddies" << endl; } out << indent << (*buddy).key << "->setBuddy( " << registeredName( (*buddy).buddy ) << " );" << endl; - firstBuddy = FALSE; + firstBuddy = false; } } @@ -1232,26 +1232,26 @@ void Uic::createFormImpl( const TQDomElement &e ) out << endl; // handle application events if required - bool needFontEventHandler = FALSE; - bool needSqlTableEventHandler = FALSE; - bool needSqlDataBrowserEventHandler = FALSE; + bool needFontEventHandler = false; + bool needSqlTableEventHandler = false; + bool needSqlDataBrowserEventHandler = false; nl = e.elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); i++ ) { if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() ) - needFontEventHandler = TRUE; + needFontEventHandler = true; TQString s = getClassName( nl.item(i).toElement() ); if ( s == "TQDataTable" || s == "TQDataBrowser" ) { if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) continue; if ( s == "TQDataTable" ) - needSqlTableEventHandler = TRUE; + needSqlTableEventHandler = true; if ( s == "TQDataBrowser" ) - needSqlDataBrowserEventHandler = TRUE; + needSqlDataBrowserEventHandler = true; } if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler ) break; } - if ( needFontEventHandler && FALSE ) { + if ( needFontEventHandler && false ) { // indent = "\t"; // increase indentation for if-clause below out << "/*" << endl; out << " * Main event handler. Reimplemented to handle" << endl; @@ -1301,10 +1301,10 @@ void Uic::createFormImpl( const TQDomElement &e ) if ( conn == "(default)" ) out << indent << indent << indent << "cursor = new TQSqlCursor( \"" << tab << "\" );" << endl; else - out << indent << indent << indent << "cursor = new TQSqlCursor( \"" << tab << "\", TRUE, " << conn << "Connection );" << endl; + out << indent << indent << indent << "cursor = new TQSqlCursor( \"" << tab << "\", true, " << conn << "Connection );" << endl; out << indent << indent << indent << "if ( " << c << "->isReadOnly() ) " << endl; out << indent << indent << indent << indent << "cursor->setMode( TQSqlCursor::ReadOnly );" << endl; - out << indent << indent << indent << c << "->setSqlCursor( cursor, FALSE, TRUE );" << endl; + out << indent << indent << indent << c << "->setSqlCursor( cursor, false, true );" << endl; out << indent << indent << "}" << endl; out << indent << indent << "if ( !cursor->isActive() )" << endl; out << indent << indent << indent << c << "->refresh( TQDataTable::RefreshAll );" << endl; @@ -1329,8 +1329,8 @@ void Uic::createFormImpl( const TQDomElement &e ) if ( conn == "(default)" ) out << indent << indent << indent << "TQSqlCursor* cursor = new TQSqlCursor( \"" << tab << "\" );" << endl; else - out << indent << indent << indent << "TQSqlCursor* cursor = new TQSqlCursor( \"" << tab << "\", TRUE, " << conn << "Connection );" << endl; - out << indent << indent << indent << obj << "->setSqlCursor( cursor, TRUE );" << endl; + out << indent << indent << indent << "TQSqlCursor* cursor = new TQSqlCursor( \"" << tab << "\", true, " << conn << "Connection );" << endl; + out << indent << indent << indent << obj << "->setSqlCursor( cursor, true );" << endl; out << indent << indent << indent << obj << "->refresh();" << endl; out << indent << indent << indent << obj << "->first();" << endl; out << indent << indent << "}" << endl; @@ -1380,7 +1380,7 @@ void Uic::createFormImpl( const TQDomElement &e ) 1. If the type is 'void', we return nothing. - 2. If the type is 'bool', we return 'FALSE'. + 2. If the type is 'bool', we return 'false'. 3. If the type is 'unsigned long' or 'TQ_UINT16' or 'double' or similar, we @@ -1400,7 +1400,7 @@ void Uic::createFormImpl( const TQDomElement &e ) ( toks.grep(numeric).count() == toks.count() ); if ( type == "bool" ) { - retVal = "FALSE"; + retVal = "false"; } else if ( isBasicNumericType || type.endsWith("*") ) { retVal = "0"; } else if ( type.endsWith("&") ) { |
