summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/formfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/formfile.cpp')
-rw-r--r--kdevdesigner/designer/formfile.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/kdevdesigner/designer/formfile.cpp b/kdevdesigner/designer/formfile.cpp
index ef111031..d32a0611 100644
--- a/kdevdesigner/designer/formfile.cpp
+++ b/kdevdesigner/designer/formfile.cpp
@@ -66,8 +66,8 @@ static TQString make_func_pretty( const TQString &s )
FormFile::FormFile( const TQString &fn, bool temp, Project *p, const char *name )
: filename( fn ), fileNameTemp( temp ), pro( p ), fw( 0 ), ed( 0 ),
- timeStamp( 0, fn + codeExtension() ), codeEdited( FALSE ), pkg( FALSE ),
- cm( FALSE ), codeFileStat( None )
+ timeStamp( 0, fn + codeExtension() ), codeEdited( false ), pkg( false ),
+ cm( false ), codeFileStat( None )
{
MetaDataBase::addEntry( this );
fake = qstrcmp( name, "qt_fakewindow" ) == 0;
@@ -75,7 +75,7 @@ FormFile::FormFile( const TQString &fn, bool temp, Project *p, const char *name
pro->addFormFile( this );
loadCode();
if ( !temp )
- checkFileName( FALSE );
+ checkFileName( false );
connect(this, TQ_SIGNAL(somethingChanged(FormFile* )), this, TQ_SLOT(emitNewStatus(FormFile* )));
}
@@ -96,7 +96,7 @@ void FormFile::setFormWindow( FormWindow *f )
fw = f;
if ( fw )
fw->setFormFile( this );
- parseCode( cod, FALSE );
+ parseCode( cod, false );
TQTimer::singleShot( 0, this, TQ_SLOT( notifyFormWindowChange() ) );
}
@@ -110,12 +110,12 @@ void FormFile::setFileName( const TQString &fn )
if ( fn == filename )
return;
if ( fn.isEmpty() ) {
- fileNameTemp = TRUE;
+ fileNameTemp = true;
if ( filename.find( "unnamed" ) != 0 )
filename = createUnnamedFileName();
return;
} else {
- fileNameTemp = FALSE;
+ fileNameTemp = false;
}
filename = fn;
timeStamp.setFileName( filename + codeExtension() );
@@ -166,14 +166,14 @@ bool FormFile::save( bool withMsgBox, bool ignoreModified )
if ( fileNameTemp )
return saveAs();
if ( !ignoreModified && !isModified() )
- return TRUE;
+ return true;
if ( ed )
ed->save();
if ( formWindow() && isModified( WFormWindow ) ) {
if ( withMsgBox ) {
if ( !formWindow()->checkCustomWidgets() )
- return FALSE;
+ return false;
}
if ( TQFile::exists( pro->makeAbsolute( filename ) ) ) {
@@ -229,7 +229,7 @@ bool FormFile::save( bool withMsgBox, bool ignoreModified )
if ( MainWindow::self )
MainWindow::self->statusMessage( i18n( "Failed to save file '%1'.").arg( formCodeOnly ? codeFile(): filename ) );
if ( formCodeOnly )
- return FALSE;
+ return false;
return saveAs();
}
if ( MainWindow::self )
@@ -237,11 +237,11 @@ bool FormFile::save( bool withMsgBox, bool ignoreModified )
arg( formCodeOnly ? codeFile() : filename ));
} else {
if ( !Resource::saveFormCode(this, MetaDataBase::languageInterface(pro->language())) )
- return FALSE;
+ return false;
}
timeStamp.update();
- setModified( FALSE );
- return TRUE;
+ setModified( false );
+ return true;
}
bool FormFile::saveAs( bool ignoreModified )
@@ -252,7 +252,7 @@ bool FormFile::saveAs( bool ignoreModified )
f.replace( "::", "_" );
f = pro->makeAbsolute( f + ".ui" );
}
- bool saved = FALSE;
+ bool saved = false;
if ( ignoreModified ) {
TQString dir = TQStringList::split( ':', pro->iFace()->customSetting( "QTSCRIPT_PACKAGES" ) ).first();
f = TQFileInfo( f ).fileName();
@@ -266,11 +266,11 @@ bool FormFile::saveAs( bool ignoreModified )
i18n( "Save Form '%1' As").arg( formName() )/*,
MainWindow::self ? &MainWindow::self->lastSaveFilter : 0*/ );
if ( fn.isEmpty() )
- return FALSE;
+ return false;
TQFileInfo fi( fn );
if ( fi.extension() != "ui" )
fn += ".ui";
- fileNameTemp = FALSE;
+ fileNameTemp = false;
filename = pro->makeRelative( fn );
TQFileInfo relfi( filename );
if ( relfi.exists() ) {
@@ -278,27 +278,27 @@ bool FormFile::saveAs( bool ignoreModified )
i18n( "The file already exists. Do you wish to overwrite it?" ),
TQMessageBox::Yes,
TQMessageBox::No ) == TQMessageBox::Yes ) {
- saved = TRUE;
+ saved = true;
} else {
filename = f;
}
} else {
- saved = TRUE;
+ saved = true;
}
}
- if ( !checkFileName( TRUE ) ) {
+ if ( !checkFileName( true ) ) {
filename = f;
- return FALSE;
+ return false;
}
- pro->setModified( TRUE );
+ pro->setModified( true );
timeStamp.setFileName( pro->makeAbsolute( codeFile() ) );
if ( ed && formWindow() )
ed->setCaption( i18n( "Edit %1" ).arg( formWindow()->name() ) );
- setModified( TRUE );
+ setModified( true );
if ( pro->isDummy() )
fw->mainWindow()->addRecentlyOpenedFile( fn );
- return save( TRUE, ignoreModified );
+ return save( true, ignoreModified );
}
bool FormFile::close()
@@ -309,18 +309,18 @@ bool FormFile::close()
}
if ( formWindow() )
return formWindow()->close();
- return TRUE;
+ return true;
}
bool FormFile::closeEvent()
{
if ( !isModified() && fileNameTemp ) {
pro->removeFormFile( this );
- return TRUE;
+ return true;
}
if ( !isModified() )
- return TRUE;
+ return true;
if ( editor() )
editor()->save();
@@ -330,7 +330,7 @@ bool FormFile::closeEvent()
i18n( "&Yes" ), i18n( "&No" ), i18n( "&Cancel" ), 0, 2 ) ) {
case 0: // save
if ( !save() )
- return FALSE;
+ return false;
case 1: // don't save
loadCode();
if ( ed )
@@ -341,16 +341,16 @@ bool FormFile::closeEvent()
MainWindow::self->workspace()->update();
break;
case 2: // cancel
- return FALSE;
+ return false;
default:
break;
}
- setModified( FALSE );
+ setModified( false );
if ( MainWindow::self )
MainWindow::self->updateFunctionList();
- setCodeEdited( FALSE );
- return TRUE;
+ setCodeEdited( false );
+ return true;
}
void FormFile::setModified( bool m, int who )
@@ -373,7 +373,7 @@ bool FormFile::isModified( int who )
bool FormFile::isFormWindowModified() const
{
if ( !formWindow() || !formWindow()->commandHistory() )
- return FALSE;
+ return false;
return formWindow()->commandHistory()->isModified();
}
@@ -422,7 +422,7 @@ void FormFile::showFormWindow()
formWindow()->setFocus();
return;
}
- MainWindow::self->openFormWindow( pro->makeAbsolute( filename ), TRUE, this );
+ MainWindow::self->openFormWindow( pro->makeAbsolute( filename ), true, this );
}
bool FormFile::setupUihFile( bool askForUih )
@@ -430,10 +430,10 @@ bool FormFile::setupUihFile( bool askForUih )
if ( !pro->isCpp() || !askForUih ) {
if ( !hasFormCode() ) {
createFormCode();
- setModified( TRUE );
+ setModified( true );
}
codeFileStat = FormFile::Ok;
- return TRUE;
+ return true;
}
if ( codeFileStat != FormFile::Ok && !ed ) {
if ( hasFormCode() ) {
@@ -443,20 +443,20 @@ bool FormFile::setupUihFile( bool askForUih )
i18n( "Use Existing" ), i18n( "Create New" ),
i18n( "Cancel" ), 2, 2 );
if ( i == 2 )
- return FALSE;
+ return false;
if ( i == 1 )
createFormCode();
} else {
if ( TQMessageBox::Yes != TQMessageBox::information( MainWindow::self, i18n( "Creating ui.h file" ),
i18n( "Do you want to create an new \"ui.h\" file?" ),
TQMessageBox::Yes, TQMessageBox::No ) )
- return FALSE;
+ return false;
createFormCode();
}
- setModified( TRUE );
+ setModified( true );
}
codeFileStat = FormFile::Ok;
- return TRUE;
+ return true;
}
SourceEditor *FormFile::showEditor( bool askForUih )
@@ -535,7 +535,7 @@ void FormFile::createFormCode()
(*it).returnType, (*it).access ) +
"\n" + iface->createEmptyFunction();
}
- parseCode( cod, FALSE );
+ parseCode( cod, false );
}
void FormFile::load()
@@ -550,15 +550,15 @@ bool FormFile::loadCode()
if ( !f.open( IO_ReadOnly ) ) {
cod = "";
setCodeFileState( FormFile::None );
- return FALSE;
+ return false;
}
TQTextStream ts( &f );
cod = ts.read();
- parseCode( cod, FALSE );
+ parseCode( cod, false );
if ( hasFormCode() && codeFileStat != FormFile::Ok )
setCodeFileState( FormFile::Deleted );
timeStamp.update();
- return TRUE;
+ return true;
}
bool FormFile::isCodeEdited() const
@@ -585,13 +585,13 @@ void FormFile::parseCode( const TQString &txt, bool allowModify )
TQMap<TQString, TQString> funcs;
for ( TQValueList<LanguageInterface::Function>::Iterator it = functions.begin();
it != functions.end(); ++it ) {
- bool found = FALSE;
+ bool found = false;
for ( TQValueList<MetaDataBase::Function>::Iterator fit = oldFunctions.begin();
fit != oldFunctions.end(); ++fit ) {
TQString f( (*fit).function );
if ( MetaDataBase::normalizeFunction( f ) ==
MetaDataBase::normalizeFunction( (*it).name ) ) {
- found = TRUE;
+ found = true;
MetaDataBase::Function function;
function.function = make_func_pretty( (*it).name );
function.specifier = (*fit).specifier;
@@ -627,12 +627,12 @@ void FormFile::parseCode( const TQString &txt, bool allowModify )
newFunctions << function;
funcs.insert( (*it).name, (*it).body );
if ( allowModify )
- setFormWindowModified( TRUE );
+ setFormWindowModified( true );
}
}
if ( allowModify && oldFunctions.count() > 0 )
- setFormWindowModified( TRUE );
+ setFormWindowModified( true );
MetaDataBase::setFunctionList( formWindow(), newFunctions );
}
@@ -641,7 +641,7 @@ void FormFile::syncCode()
{
if ( !editor() )
return;
- parseCode( editor()->editorInterface()->text(), TRUE );
+ parseCode( editor()->editorInterface()->text(), true );
cod = editor()->editorInterface()->text();
}
@@ -672,14 +672,14 @@ void FormFile::checkTimeStamp()
bool FormFile::isUihFileUpToDate()
{
if ( timeStamp.isUpToDate() )
- return TRUE;
+ return true;
if ( !editor() ) {
MainWindow::self->editSource();
tqDebug( "parse Code" );
- parseCode( editor()->editorInterface()->text(), TRUE );
+ parseCode( editor()->editorInterface()->text(), true );
}
checkTimeStamp();
- return FALSE;
+ return false;
}
void FormFile::addFunctionCode( MetaDataBase::Function function )
@@ -692,11 +692,11 @@ void FormFile::addFunctionCode( MetaDataBase::Function function )
TQValueList<LanguageInterface::Function> funcs;
iface->functions( cod, &funcs );
- bool hasFunc = FALSE;
+ bool hasFunc = false;
for ( TQValueList<LanguageInterface::Function>::Iterator it = funcs.begin();
it != funcs.end(); ++it ) {
if ( MetaDataBase::normalizeFunction( (*it).name ) == MetaDataBase::normalizeFunction( function.function ) ) {
- hasFunc = TRUE;
+ hasFunc = true;
break;
}
}
@@ -718,7 +718,7 @@ void FormFile::addFunctionCode( MetaDataBase::Function function )
"\n" + iface->createEmptyFunction();
cod += body;
if ( codeEdited ) {
- setModified( TRUE );
+ setModified( true );
emit somethingChanged( this );
}
}
@@ -865,12 +865,12 @@ bool FormFile::checkFileName( bool allowBreak )
arg( formWindow()->name() )/*,
MainWindow::self ? &MainWindow::self->lastSaveFilter : 0 */);
if ( allowBreak && fn.isEmpty() )
- return FALSE;
+ return false;
}
filename = pro->makeRelative( fn );
ff = pro->findFormFile( filename, this );
}
- return TRUE;
+ return true;
}
void FormFile::addConnection( const TQString &sender, const TQString &signal,