summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/project.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-04-08 12:59:07 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-04-10 17:35:38 +0900
commitd2d30bfbef26707f9158cbc31d5763a9a1d4ab2d (patch)
tree6d2d4502d6fbe4d6810bfb7bcf297cbf995d3db8 /kdevdesigner/designer/project.cpp
parentb9618de13e8f38c3558e9ed393a75c1f13af665c (diff)
downloadtdevelop-r14.1.4.tar.gz
tdevelop-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 5198c9d3ac02aa9c7949f49e3cf374f683facb18)
Diffstat (limited to 'kdevdesigner/designer/project.cpp')
-rw-r--r--kdevdesigner/designer/project.cpp130
1 files changed, 65 insertions, 65 deletions
diff --git a/kdevdesigner/designer/project.cpp b/kdevdesigner/designer/project.cpp
index 8dcf8b28..974259bf 100644
--- a/kdevdesigner/designer/project.cpp
+++ b/kdevdesigner/designer/project.cpp
@@ -71,9 +71,9 @@ bool DatabaseConnection::refreshCatalog()
{
#ifndef TQT_NO_SQL
if ( loaded )
- return TRUE;
+ return true;
if ( !open() )
- return FALSE;
+ return false;
tbls = conn->tables( TQSql::TableType( TQSql::Tables | TQSql::Views ) );
flds.clear();
for ( TQStringList::Iterator it = tbls.begin(); it != tbls.end(); ++it ) {
@@ -83,11 +83,11 @@ bool DatabaseConnection::refreshCatalog()
lst << fil.field( j )->name();
flds.insert( *it, lst );
}
- loaded = TRUE;
+ loaded = true;
conn->close();
return loaded;
#else
- return FALSE;
+ return false;
#endif
}
@@ -124,16 +124,16 @@ bool DatabaseConnection::open( bool suppressDialog )
conn->setHostName( hname );
conn->setPort( prt );
bool success = conn->open();
- for( ; suppressDialog == FALSE ; ) {
- bool done = FALSE;
+ for( ; !suppressDialog ; ) {
+ bool done = false;
if ( !success ) {
- DatabaseConnectionEditor dia( this, 0 , 0 , TRUE );
+ DatabaseConnectionEditor dia( this, 0 , 0 , true );
switch( dia.exec() ) {
case TQDialog::Accepted:
- done = FALSE;
+ done = false;
break;
case TQDialog::Rejected:
- done = TRUE;
+ done = true;
break;
}
}
@@ -156,7 +156,7 @@ bool DatabaseConnection::open( bool suppressDialog )
case 0: // OK or Enter
continue;
case 1: // Cancel or Escape
- done = TRUE;
+ done = true;
break;
}
} else
@@ -170,7 +170,7 @@ bool DatabaseConnection::open( bool suppressDialog )
}
return success;
#else
- return FALSE;
+ return false;
#endif
}
@@ -206,7 +206,7 @@ Project::Project( const TQString &fn, const TQString &pName,
const TQString &l )
: proName( pName ), projectSettingsPluginManager( pm ), isDummyProject( isDummy )
{
- modified = TRUE;
+ modified = true;
pixCollection = new PixmapCollection( this );
iface = 0;
lang = l;
@@ -216,10 +216,10 @@ Project::Project( const TQString &fn, const TQString &pName,
setFileName( fn );
if ( !pName.isEmpty() )
proName = pName;
- sourcefiles.setAutoDelete( TRUE );
- modified = FALSE;
- objs.setAutoDelete( FALSE );
- fakeFormFiles.setAutoDelete( FALSE );
+ sourcefiles.setAutoDelete( true );
+ modified = false;
+ objs.setAutoDelete( false );
+ fakeFormFiles.setAutoDelete( false );
}
Project::~Project()
@@ -315,13 +315,13 @@ TQString Project::projectName() const
static TQString parse_part( const TQString &part )
{
TQString res;
- bool inName = FALSE;
+ bool inName = false;
TQString currName;
for ( int i = 0; i < (int)part.length(); ++i ) {
TQChar c = part[ i ];
if ( !inName ) {
if ( c != ' ' && c != '\t' && c != '\n' && c != '=' && c != '\\' && c != '+' )
- inName = TRUE;
+ inName = true;
else
continue;
}
@@ -373,15 +373,15 @@ TQStringList parse_multiline_part( const TQString &contents, const TQString &key
if ( start )
*start = i - lastWord.length() - extraWhiteSpaceCount + 1;
TQStringList lst;
- bool inName = FALSE;
+ bool inName = false;
TQString currName;
- bool hadEqual = FALSE;
+ bool hadEqual = false;
for ( ; i < (int)contents.length(); ++i ) {
c = contents[ i ];
if ( !hadEqual && c != '=' )
continue;
if ( !hadEqual ) {
- hadEqual = TRUE;
+ hadEqual = true;
continue;
}
if ( ( c.isLetter() || c.isDigit() || c == '.' || c == '/' || c == '_' || c == '\\' ||
@@ -392,11 +392,11 @@ TQStringList parse_multiline_part( const TQString &contents, const TQString &key
currName = TQString();
if ( c != '\\' || contents[i+1] != '\n' ) {
currName += c;
- inName = TRUE;
+ inName = true;
}
} else {
if ( inName ) {
- inName = FALSE;
+ inName = false;
if ( currName.simplifyWhiteSpace() != "\\" )
lst.append( currName );
}
@@ -427,7 +427,7 @@ void Project::parse()
int i = contents.find( "LANGUAGE" );
if ( i != -1 ) {
lang = "";
- is_cpp = FALSE;
+ is_cpp = false;
TQString part = contents.mid( i + TQString( "LANGUAGE" ).length() );
lang = parse_part( part );
is_cpp = lang == "C++";
@@ -445,7 +445,7 @@ void Project::parse()
for ( it = uifiles.begin(); it != uifiles.end(); ++it ) {
if ( (*it).startsWith( "__APPOBJ" ) )
continue;
- (void) new FormFile( *it, FALSE, this );
+ (void) new FormFile( *it, false, this );
}
@@ -470,7 +470,7 @@ void Project::parse()
for ( TQStringList::Iterator it = sourceKeys.begin(); it != sourceKeys.end(); ++it ) {
TQStringList lst = parse_multiline_part( contents, *it );
for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it )
- (void) new SourceFile( *it, FALSE, this );
+ (void) new SourceFile( *it, false, this );
}
}
@@ -491,11 +491,11 @@ void Project::parse()
TQStringList images = parse_multiline_part( contents, "IMAGES" );
// ### remove that for the final - this is beta-compatibility
- if ( images.isEmpty() && TQDir( TQFileInfo( filename ).dirPath( TRUE ) + "/images" ).exists() ) {
- images = TQDir( TQFileInfo( filename ).dirPath( TRUE ) + "/images" ).entryList();
+ if ( images.isEmpty() && TQDir( TQFileInfo( filename ).dirPath( true ) + "/images" ).exists() ) {
+ images = TQDir( TQFileInfo( filename ).dirPath( true ) + "/images" ).entryList();
for ( int i = 0; i < (int)images.count(); ++i )
images[ i ].prepend( "images/" );
- modified = TRUE;
+ modified = true;
}
for ( TQStringList::ConstIterator pit = images.begin(); pit != images.end(); ++pit )
@@ -512,13 +512,13 @@ void Project::clear()
bool Project::removeSourceFile( SourceFile *sf )
{
if ( !sourcefiles.containsRef( sf ) )
- return FALSE;
+ return false;
if ( !sf->close() )
- return FALSE;
+ return false;
sourcefiles.removeRef( sf );
- modified = TRUE;
+ modified = true;
emit sourceFileRemoved( sf );
- return TRUE;
+ return true;
}
void Project::setDatabaseDescription( const TQString &db )
@@ -541,16 +541,16 @@ bool Project::isValid() const
{
// #### do more checking here?
if ( filename.isEmpty() || proName.isEmpty() )
- return FALSE;
+ return false;
- return TRUE;
+ return true;
}
TQString Project::makeAbsolute( const TQString &f )
{
if ( isDummy() )
return f;
- TQString encodedUrl = TQFileInfo( filename ).dirPath( TRUE );
+ TQString encodedUrl = TQFileInfo( filename ).dirPath( true );
TQUrl::encode( encodedUrl );
TQUrl u( encodedUrl, f );
return u.path();
@@ -560,7 +560,7 @@ TQString Project::makeRelative( const TQString &f )
{
if ( isDummy() )
return f;
- TQString p = TQFileInfo( filename ).dirPath( TRUE );
+ TQString p = TQFileInfo( filename ).dirPath( true );
TQString f2 = f;
if ( f2.left( p.length() ) == p )
f2.remove( 0, p.length() + 1 );
@@ -585,7 +585,7 @@ static void remove_multiline_contents( TQString &contents, const TQString &s, in
if ( strt )
*strt = i;
int start = i;
- bool lastWasBackspash = FALSE;
+ bool lastWasBackspash = false;
if ( i != -1 && ( i == 0 || contents[ i - 1 ] != '{' || contents[ i - 1 ] != ':' ) ) {
for ( ; i < (int)contents.length(); ++i ) {
if ( contents[ i ] == '\n' && !lastWasBackspash )
@@ -599,7 +599,7 @@ static void remove_multiline_contents( TQString &contents, const TQString &s, in
void Project::save( bool onlyProjectFile )
{
- bool anythingModified = FALSE;
+ bool anythingModified = false;
// save sources and forms
if ( !onlyProjectFile ) {
@@ -635,12 +635,12 @@ void Project::save( bool onlyProjectFile )
TQString original = "";
// read the existing file
- bool hasPreviousContents = FALSE;
+ bool hasPreviousContents = false;
if ( f.open( IO_ReadOnly ) ) {
TQTextStream ts( &f );
original = ts.read();
f.close();
- hasPreviousContents = TRUE;
+ hasPreviousContents = true;
remove_contents( original, "{SOURCES+=" ); // ### compatibility with early 3.0 betas
remove_contents( original, "DBFILE" );
remove_contents( original, "LANGUAGE" );
@@ -769,12 +769,12 @@ void Project::save( bool onlyProjectFile )
f.close();
- setModified( FALSE );
+ setModified( false );
if ( singleProjectMode() ) {
LanguageInterface *iface = MetaDataBase::languageInterface( language() );
if ( iface && iface->supports( LanguageInterface::CompressProject ) )
- iface->compressProject( makeAbsolute( filename ), singleProFileName, TRUE );
+ iface->compressProject( makeAbsolute( filename ), singleProFileName, true );
}
}
@@ -796,7 +796,7 @@ void Project::setDatabaseConnections( const TQPtrList<DatabaseConnection> &lst )
void Project::addDatabaseConnection( DatabaseConnection *conn )
{
dbConnections.append( conn );
- modified = TRUE;
+ modified = true;
}
#endif
@@ -879,7 +879,7 @@ void Project::saveConnections()
if ( f.exists() )
f.remove();
setDatabaseDescription( "" );
- modified = TRUE;
+ modified = true;
return;
}
@@ -1026,13 +1026,13 @@ bool Project::openDatabase( const TQString &connection, bool suppressDialog )
if ( connection.isEmpty() && !conn )
conn = databaseConnection( "(default)" );
if ( !conn )
- return FALSE;
+ return false;
bool b = conn->open( suppressDialog );
return b;
#else
Q_UNUSED( connection );
Q_UNUSED( suppressDialog );
- return FALSE;
+ return false;
#endif
}
@@ -1088,7 +1088,7 @@ void Project::setLanguage( const TQString &l )
lang = l;
is_cpp = lang == "C++";
updateCustomSettings();
- modified = TRUE;
+ modified = true;
}
TQString Project::language() const
@@ -1100,7 +1100,7 @@ void Project::setCustomSetting( const TQString &key, const TQString &value )
{
customSettings.remove( key );
customSettings.insert( key, value );
- modified = TRUE;
+ modified = true;
}
TQString Project::customSetting( const TQString &key ) const
@@ -1139,7 +1139,7 @@ void Project::setActive( bool b )
void Project::addSourceFile( SourceFile *sf )
{
sourcefiles.append( sf );
- modified = TRUE;
+ modified = true;
emit sourceFileAdded( sf );
}
@@ -1171,7 +1171,7 @@ void Project::setIncludePath( const TQString &platform, const TQString &path )
if ( inclPath[platform] == path )
return;
inclPath.replace( platform, path );
- modified = TRUE;
+ modified = true;
}
void Project::setLibs( const TQString &platform, const TQString &path )
@@ -1275,27 +1275,27 @@ void Project::writePlatformSettings( TQString &contents, const TQString &setting
void Project::addFormFile( FormFile *ff )
{
formfiles.append( ff );
- modified = TRUE;
+ modified = true;
emit formFileAdded( ff );
}
bool Project::removeFormFile( FormFile *ff )
{
if ( !formfiles.containsRef( ff ) )
- return FALSE;
+ return false;
if ( !ff->close() )
- return FALSE;
+ return false;
formfiles.removeRef( ff );
- modified = TRUE;
+ modified = true;
emit formFileRemoved( ff );
- return TRUE;
+ return true;
}
void Project::addObject( TQObject *o )
{
bool wasModified = modified;
objs.append( o );
- FormFile *ff = new FormFile( "", FALSE, this, "qt_fakewindow" );
+ FormFile *ff = new FormFile( "", false, this, "qt_fakewindow" );
ff->setFileName( "__APPOBJ" + TQString( o->name() ) + ".ui" );
fakeFormFiles.insert( (void*)o, ff );
MetaDataBase::addEntry( o );
@@ -1305,7 +1305,7 @@ void Project::addObject( TQObject *o )
fw->setProject( this );
if ( TQFile::exists( ff->absFileName() ) )
Resource::loadExtraSource( ff, ff->absFileName(),
- MetaDataBase::languageInterface( language() ), FALSE );
+ MetaDataBase::languageInterface( language() ), false );
if ( MainWindow::self )
fw->setMainWindow( MainWindow::self );
if ( MainWindow::self ) {
@@ -1323,7 +1323,7 @@ void Project::addObject( TQObject *o )
} else {
if ( TQFile::exists( ff->absFileName() ) )
Resource::loadExtraSource( ff, ff->absFileName(),
- MetaDataBase::languageInterface( language() ), FALSE );
+ MetaDataBase::languageInterface( language() ), false );
}
emit objectAdded( o );
modified = wasModified;
@@ -1415,11 +1415,11 @@ void Project::addAndEditFunction( const TQString &function, const TQString &func
if ( i != -1 )
func = func.left( i );
- bool found = FALSE;
+ bool found = false;
for ( TQValueList<LanguageInterface::Function>::Iterator it = funcs.begin();
it != funcs.end(); ++it ) {
if ( (*it).name.left( (*it).name.find( '(' ) ) == func ) {
- found = TRUE;
+ found = true;
break;
}
}
@@ -1433,7 +1433,7 @@ void Project::addAndEditFunction( const TQString &function, const TQString &func
"()\n" + functionBody + "\n";
f->setText( code );
if ( f->editor() )
- f->editor()->refresh( FALSE );
+ f->editor()->refresh( false );
}
if ( openDeveloper ) {
@@ -1452,9 +1452,9 @@ bool Project::hasParentObject( TQObject *o )
for ( TQObject *p = objs.first(); p; p = objs.next() ) {
TQObject *c = p->child( o->name(), o->className() );
if ( c )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
TQString Project::qualifiedName( TQObject *o )
@@ -1491,7 +1491,7 @@ void Project::designerCreated()
const TQString & ) ),
MainWindow::self, TQ_SLOT( updateUndoRedo( bool, bool,
const TQString &, const TQString & ) ) );
- fw->reparent( MainWindow::self->qWorkspace(), TQPoint( 0, 0 ), FALSE );
+ fw->reparent( MainWindow::self->qWorkspace(), TQPoint( 0, 0 ), false );
TQApplication::sendPostedEvents( MainWindow::self->qWorkspace(),
TQEvent::ChildInserted );
fw->parentWidget()->setFixedSize( 1, 1 );