diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-04 13:24:31 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-04-04 21:11:58 +0900 |
commit | 2d2a66210c4827dd2469d4fde55bf2c9aab81b5a (patch) | |
tree | 8a1b99c230b11fb6e679434055553504620119c7 /pytquic3 | |
parent | f89d120a2d4982896f0b5c00cee347a010f609a9 (diff) | |
download | pytqt-r14.1.4.tar.gz pytqt-r14.1.4.zip |
Replace TRUE/FALSE with boolean values true/falser14.1.4
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 6cbdd25dc4c6b0987636b37b2046b1b9464e3d60)
Diffstat (limited to 'pytquic3')
-rw-r--r-- | pytquic3/domtool.cpp | 10 | ||||
-rw-r--r-- | pytquic3/embed.cpp | 2 | ||||
-rw-r--r-- | pytquic3/form.cpp | 44 | ||||
-rw-r--r-- | pytquic3/main.cpp | 20 | ||||
-rw-r--r-- | pytquic3/object.cpp | 12 | ||||
-rw-r--r-- | pytquic3/uic.cpp | 44 | ||||
-rw-r--r-- | pytquic3/uic.h | 2 | ||||
-rw-r--r-- | pytquic3/widgetdatabase.cpp | 34 |
8 files changed, 84 insertions, 84 deletions
diff --git a/pytquic3/domtool.cpp b/pytquic3/domtool.cpp index 740088e..f37866c 100644 --- a/pytquic3/domtool.cpp +++ b/pytquic3/domtool.cpp @@ -80,10 +80,10 @@ bool DomTool::hasProperty( const TQDomElement& e, const TQString& name ) if ( n.tagName() == "property" ) { if ( n.attribute( "name" ) != name ) continue; - return TRUE; + return true; } } - return FALSE; + return false; } TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type ) @@ -180,7 +180,7 @@ TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& def } else if ( e.tagName() == "cstring" ) { v = TQVariant( TQCString( e.firstChild().toText().data() ) ); } else if ( e.tagName() == "number" ) { - bool ok = TRUE; + bool ok = true; v = TQVariant( e.firstChild().toText().data().toInt( &ok ) ); if ( !ok ) v = TQVariant( e.firstChild().toText().data().toDouble() ); @@ -334,10 +334,10 @@ bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name ) if ( n.tagName() == "attribute" ) { if ( n.attribute( "name" ) != name ) continue; - return TRUE; + return true; } } - return FALSE; + return false; } static bool toBool( const TQString& s ) diff --git a/pytquic3/embed.cpp b/pytquic3/embed.cpp index f86a1d6..b07db52 100644 --- a/pytquic3/embed.cpp +++ b/pytquic3/embed.cpp @@ -144,7 +144,7 @@ void Uic::embed( TQTextStream& out, const char* project, const TQStringList& ima TQPtrList<EmbedImage> list_image; - list_image.setAutoDelete( TRUE ); + list_image.setAutoDelete( true ); int image_count = 0; for ( it = images.begin(); it != images.end(); ++it ) { TQImage img; diff --git a/pytquic3/form.cpp b/pytquic3/form.cpp index 323161e..148bdae 100644 --- a/pytquic3/form.cpp +++ b/pytquic3/form.cpp @@ -232,14 +232,14 @@ void Uic::createFormImpl( const TQDomElement &e ) sqlClasses += "TQSqlDatabase"; if ( dbCursors.count() ) sqlClasses += "TQSqlCursor"; - 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; } } @@ -377,7 +377,7 @@ void Uic::createFormImpl( const TQDomElement &e ) ++indent; out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; out << indent << "self.statusBar()" << endl; - isMainWindow = TRUE; + isMainWindow = true; } else { out << indent << "def __init__(self,parent = None,name = None):" << endl; ++indent; @@ -460,7 +460,7 @@ void Uic::createFormImpl( const TQDomElement &e ) TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); out << indent << "self.addPage(" << page << ",TQString(\"\"))" << endl; trout << trindent << "self.setTitle(" << page << ","<< trcall( label, comment ) << ")" << endl; - TQVariant def( FALSE ); + TQVariant def( false ); if ( DomTool::hasAttribute( n, "backEnabled" ) ) out << indent << "self.setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ")" << endl; if ( DomTool::hasAttribute( n, "nextEnabled" ) ) @@ -507,35 +507,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; createActionImpl( n.firstChild().toElement(), "self" ); - 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; 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; createMenuBarImpl( n, objClass, objName ); - needEndl = TRUE; + needEndl = true; } } if ( needEndl ) @@ -638,14 +638,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; } out << indent << "self." << (*buddy).key << ".setBuddy(self." << registeredName( (*buddy).buddy ) << ")" << endl; - firstBuddy = FALSE; + firstBuddy = false; } } @@ -666,26 +666,26 @@ void Uic::createFormImpl( const TQDomElement &e ) } // 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; @@ -800,7 +800,7 @@ void Uic::createFormImpl( const TQDomElement &e ) for ( cit = extraSlots.begin(); cit != extraSlots.end(); ++cit ) { pySlot(cit); - bool createWarning = TRUE; + bool createWarning = true; TQString fname = Parser::cleanArgs( *cit ); TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname ); if ( fit != functionImpls.end() ) { diff --git a/pytquic3/main.cpp b/pytquic3/main.cpp index 826b1ef..9c463e4 100644 --- a/pytquic3/main.cpp +++ b/pytquic3/main.cpp @@ -36,17 +36,17 @@ int main( int argc, char * argv[] ) { PyIndent indent; - bool testCode = FALSE, execCode = FALSE; - bool subcl = FALSE; - bool imagecollection = FALSE; + bool testCode = false, execCode = false; + bool subcl = false; + bool imagecollection = false; TQStringList images; const char *error = 0; const char* fileName = 0; TQCString outputFile; const char* projectName = 0; const char* trmacro = 0; - bool fix = FALSE; - TQApplication app(argc, argv, FALSE); + bool fix = false; + TQApplication app(argc, argv, false); TQString className, uicClass; for ( int n = 1; n < argc && error == 0; n++ ) { @@ -63,7 +63,7 @@ int main( int argc, char * argv[] ) } else outputFile = &opt[1]; } else if ( opt[0] == 'e' || opt == "embed" ) { - imagecollection = TRUE; + imagecollection = true; if ( opt == "embed" || opt[1] == '\0' ) { if ( !(n < argc-1) ) { error = "Missing name of project"; @@ -73,7 +73,7 @@ int main( int argc, char * argv[] ) } else projectName = &opt[1]; } else if ( opt == "subimpl" ) { - subcl = TRUE; + subcl = true; if ( !(n < argc-1) ) { error = "Missing class name"; break; @@ -97,7 +97,7 @@ int main( int argc, char * argv[] ) } else if ( opt == "help" ) { break; } else if ( opt == "fix" ) { - fix = TRUE; + fix = true; } else if ( opt[0] == 'p' ) { uint tabstop; bool ok; @@ -116,9 +116,9 @@ int main( int argc, char * argv[] ) else error = "Invalid Python indent"; } else if ( opt == "test" ) { - testCode = TRUE; + testCode = true; } else if ( opt == "x" ) { - execCode = TRUE; + execCode = true; } else { error = "Unrecognized option"; } diff --git a/pytquic3/object.cpp b/pytquic3/object.cpp index 6b26e8c..30a447a 100644 --- a/pytquic3/object.cpp +++ b/pytquic3/object.cpp @@ -36,7 +36,7 @@ Returns the name of the generated child object. */ -static bool createdCentralWidget = FALSE; +static bool createdCentralWidget = false; TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout ) { @@ -44,7 +44,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla if ( parent == "self" && isMainWindow ) { if ( !createdCentralWidget ) out << indent << "self.setCentralWidget(TQWidget(self,\"tqt_central_widget\"))" << endl; - createdCentralWidget = TRUE; + createdCentralWidget = true; parent = "self.centralWidget()"; } TQDomElement n; @@ -116,7 +116,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla lastItem = "None"; // set the properties and insert items - bool hadFrameShadow = FALSE; + bool hadFrameShadow = false; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { bool stdset = stdsetdef; @@ -131,7 +131,7 @@ TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentCla if ( prop == "name" ) continue; if ( isLine && prop == "frameShadow" ) - hadFrameShadow = TRUE; + hadFrameShadow = true; if ( prop == "buddy" && value.startsWith("\"") && value.endsWith("\"") ) { buddies << Buddy( objName, value.mid(1, value.length() - 2 ) ); continue; @@ -584,12 +584,12 @@ TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, TQString palette = "pal"; if ( !pal_used ) { out << indent << palette << " = TQPalette()" << endl; - pal_used = TRUE; + pal_used = true; } TQString cg = "cg"; if ( !cg_used ) { out << indent << cg << " = TQColorGroup()" << endl; - cg_used = TRUE; + cg_used = true; } n = e.firstChild().toElement(); while ( !n.isNull() && n.tagName() != "active" ) diff --git a/pytquic3/uic.cpp b/pytquic3/uic.cpp index e4a5ad0..067aacc 100644 --- a/pytquic3/uic.cpp +++ b/pytquic3/uic.cpp @@ -32,7 +32,7 @@ #include <stdio.h> #include <stdlib.h> -bool Uic::isMainWindow = FALSE; +bool Uic::isMainWindow = false; PyIndent Uic::indent; PyIndent Uic::trindent; @@ -113,21 +113,21 @@ TQString Uic::trcall( const TQString& sourceText, const TQString& comment ) return "TQString.null"; TQString t = trmacro; - bool encode = FALSE; + bool encode = false; if ( t.isNull() ) { t = "self.__tr"; for ( int i = 0; i < (int) sourceText.length(); i++ ) { if ( sourceText[i].unicode() >= 0x80 ) { t = "self.__trUtf8"; - encode = TRUE; + encode = true; break; } } if (encode) - pyNeedTrUtf8 = TRUE; + pyNeedTrUtf8 = true; else - pyNeedTr = TRUE; + pyNeedTr = true; } if ( comment.isEmpty() ) { @@ -156,13 +156,13 @@ Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream, const TQString& subClass, TQString &uicClass ) : out( outStream ), trout (&languageChangeBody ), outputFileName( outputFn ), trmacro( trm ), - pyNeedTr(FALSE), pyNeedTrUtf8(FALSE) + pyNeedTr(false), pyNeedTrUtf8(false) { fileName = fn; - writeFunctImpl = TRUE; + writeFunctImpl = true; defMargin = BOXLAYOUT_DEFAULT_MARGIN; defSpacing = BOXLAYOUT_DEFAULT_SPACING; - externPixmaps = FALSE; + externPixmaps = false; trindent.setIndent(2); @@ -194,7 +194,7 @@ Uic::Uic( const TQString &fn, const char *outputFn, TQTextStream &outStream, if ( e.tagName() == "widget" ) { widget = e; } else if ( e.tagName() == "pixmapinproject" ) { - externPixmaps = TRUE; + externPixmaps = true; } else if ( e.tagName() == "layoutdefaults" ) { defSpacing = e.attribute( "spacing", defSpacing.toString() ); defMargin = e.attribute( "margin", defMargin.toString() ); @@ -299,16 +299,16 @@ TQString Uic::getClassName( const TQDomElement& e ) return s; } -/*! Returns TRUE if database framework code is generated, else FALSE. +/*! Returns true if database framework code is generated, else false. */ bool Uic::isFrameworkCodeGenerated( const TQDomElement& e ) { TQDomElement n = getObjectProperty( e, "frameworkCode" ); if ( n.attribute("name") == "frameworkCode" && - !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( TRUE ) ).toBool() ) - return FALSE; - return TRUE; + !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( true ) ).toBool() ) + return false; + return true; } /*! Extracts an object name from \a e. It's stored in the 'name' @@ -392,8 +392,8 @@ void Uic::createActionImpl( const TQDomElement &n, const TQString &parent ) out << indent << "self." << objName << " = TQActionGroup(" << parent << ",b\"" << objName << "\")" << endl; else continue; - bool subActionsDone = FALSE; - bool hasMenuText = FALSE; + bool subActionsDone = false; + bool hasMenuText = false; TQString actionText; for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "property" ) { @@ -414,7 +414,7 @@ void Uic::createActionImpl( const TQDomElement &n, const TQString &parent ) call += "setProperty(\"" + prop + "\",TQVariant(" + value + "))"; if (prop == "menuText") - hasMenuText = TRUE; + hasMenuText = true; else if (prop == "text") actionText = value; @@ -425,7 +425,7 @@ void Uic::createActionImpl( const TQDomElement &n, const TQString &parent ) } } else if ( !subActionsDone && ( n2.tagName() == "actiongroup" || n2.tagName() == "action" ) ) { createActionImpl( n2, "self." + objName ); - subActionsDone = TRUE; + subActionsDone = true; } } // workaround for loading pre-3.3 files expecting bogus TQAction behavior @@ -636,7 +636,7 @@ TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &par item = registerObject( "item" ); } else { item = "item"; - item_used = TRUE; + item_used = true; } s = trindent + item + " = "; @@ -694,7 +694,7 @@ TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &p TQString txt; TQString com; TQString pix; - bool clickable = FALSE, resizable = FALSE; + bool clickable = false, resizable = false; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute("name"); @@ -997,7 +997,7 @@ TQColorGroup Uic::loadColorGroup( const TQDomElement &e ) return cg; } -/*! Returns TRUE if the widget properties specify that it belongs to +/*! Returns true if the widget properties specify that it belongs to the database \a connection and \a table. */ @@ -1006,8 +1006,8 @@ bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, co TQString conn = getDatabaseInfo( e, "connection" ); TQString tab = getDatabaseInfo( e, "table" ); if ( conn == connection && tab == table ) - return TRUE; - return FALSE; + return true; + return false; } /*! diff --git a/pytquic3/uic.h b/pytquic3/uic.h index 6bf9232..6e62b10 100644 --- a/pytquic3/uic.h +++ b/pytquic3/uic.h @@ -164,7 +164,7 @@ private: static TQString mkBool( bool b ); static TQString mkBool( const TQString& s ); bool toBool( const TQString& s ); - static TQString fixString( const TQString &str, bool encode = FALSE ); + static TQString fixString( const TQString &str, bool encode = false ); static bool onlyAscii; static TQString mkStdSet( const TQString& prop ); static TQString getComment( const TQDomNode& n ); diff --git a/pytquic3/widgetdatabase.cpp b/pytquic3/widgetdatabase.cpp index 3e075b0..002ba91 100644 --- a/pytquic3/widgetdatabase.cpp +++ b/pytquic3/widgetdatabase.cpp @@ -48,10 +48,10 @@ static int dbcount = 0; static int dbcustomcount = 200; static TQStrList *wGroups; static TQStrList *invisibleGroups; -static bool whatsThisLoaded = FALSE; +static bool whatsThisLoaded = false; static TQPluginManager<WidgetInterface> *widgetPluginManager = 0; -static bool plugins_set_up = FALSE; -static bool was_in_setup = FALSE; +static bool plugins_set_up = false; +static bool was_in_setup = false; TQCleanupHandler<TQPluginManager<WidgetInterface> > cleanup_manager; @@ -101,7 +101,7 @@ WidgetDatabase::WidgetDatabase() void WidgetDatabase::setupDataBase( int id ) { - was_in_setup = TRUE; + was_in_setup = true; #ifndef UIC Q_UNUSED( id ) if ( dbcount ) @@ -122,7 +122,7 @@ void WidgetDatabase::setupDataBase( int id ) invisibleGroups->append( "Forms" ); invisibleGroups->append( "Temp" ); className2Id = new TQDict<int>( dbdictsize ); - className2Id->setAutoDelete( TRUE ); + className2Id->setAutoDelete( true ); WidgetDatabaseRecord *r = 0; @@ -574,7 +574,7 @@ void WidgetDatabase::setupPlugins() { if ( plugins_set_up ) return; - plugins_set_up = TRUE; + plugins_set_up = true; TQStringList widgets = widgetManager()->featureList(); for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { if ( hasWidget( *it ) ) @@ -724,7 +724,7 @@ bool WidgetDatabase::isForm( int id ) setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return FALSE; + return false; return r->isForm; } @@ -736,7 +736,7 @@ bool WidgetDatabase::isContainer( int id ) setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return FALSE; + return false; return r->isContainer || r->isForm; } @@ -745,7 +745,7 @@ bool WidgetDatabase::isCommon( int id ) setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return FALSE; + return false; return r->isCommon; } @@ -837,9 +837,9 @@ bool WidgetDatabase::isGroupEmpty( const TQString &grp ) if ( !( r = db[ i ] ) ) continue; if ( r->group == grp ) - return FALSE; + return false; } - return TRUE; + return true; } TQString WidgetDatabase::widgetGroup( int i ) @@ -883,8 +883,8 @@ void WidgetDatabase::customWidgetClassNameChanged( const TQString &oldName, bool WidgetDatabase::isCustomWidget( int id ) { if ( id >= dbcustom && id < dbcustomcount ) - return TRUE; - return FALSE; + return true; + return false; } bool WidgetDatabase::isCustomPluginWidget( int id ) @@ -892,7 +892,7 @@ bool WidgetDatabase::isCustomPluginWidget( int id ) setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return FALSE; + return false; return r->isPlugin; } @@ -916,13 +916,13 @@ void WidgetDatabase::loadWhatsThis( const TQString &docPath ) if ( r ) r->whatsThis = l[ 0 ]; } - whatsThisLoaded = TRUE; + whatsThisLoaded = true; } // ### TQt 3.1: make these publically accessible via TQWidgetDatabase API #if defined(UIC) -bool dbnounload = FALSE; +bool dbnounload = false; TQStringList *dbpaths = 0; #else extern TQString *qwf_plugin_dir; @@ -941,7 +941,7 @@ TQPluginManager<WidgetInterface> *widgetManager() cleanup_manager.add( &widgetPluginManager ); #if defined(UIC) if ( dbnounload ) - widgetPluginManager->setAutoUnload( FALSE ); + widgetPluginManager->setAutoUnload( false ); if ( dbpaths ) { TQStringList::ConstIterator it = dbpaths->begin(); for ( ; it != dbpaths->end(); ++it ) |