summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/metadatabase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/metadatabase.cpp')
-rw-r--r--kdevdesigner/designer/metadatabase.cpp190
1 files changed, 95 insertions, 95 deletions
diff --git a/kdevdesigner/designer/metadatabase.cpp b/kdevdesigner/designer/metadatabase.cpp
index 39711a64..67c9338d 100644
--- a/kdevdesigner/designer/metadatabase.cpp
+++ b/kdevdesigner/designer/metadatabase.cpp
@@ -38,7 +38,7 @@
#include <kiconloader.h>
#include <tdeapplication.h>
-#include <kstandarddirs.h>
+#include <tdestandarddirs.h>
#include <tqapplication.h>
#include <tqobject.h>
@@ -50,7 +50,7 @@
#include <tqwidgetlist.h>
#include <tqmainwindow.h>
#include <tqregexp.h>
-#include <tqpluginmanager_p.h>
+#include <private/tqpluginmanager_p.h>
#include <tqdatetime.h>
#include <tqfile.h>
#include <tqfileinfo.h>
@@ -85,7 +85,7 @@ public:
static TQPtrDict<MetaDataBaseRecord> *db = 0;
static TQPtrList<MetaDataBase::CustomWidget> *cWidgets = 0;
-static bool doUpdate = TRUE;
+static bool doUpdate = true;
static TQStringList langList;
static TQStringList editorLangList;
static TQPluginManager<LanguageInterface> *languageInterfaceManager = 0;
@@ -107,9 +107,9 @@ inline void setupDataBase()
{
if ( !db || !cWidgets ) {
db = new TQPtrDict<MetaDataBaseRecord>( 1481 );
- db->setAutoDelete( TRUE );
+ db->setAutoDelete( true );
cWidgets = new TQPtrList<MetaDataBase::CustomWidget>;
- cWidgets->setAutoDelete( TRUE );
+ cWidgets->setAutoDelete( true );
}
}
@@ -166,20 +166,20 @@ void MetaDataBase::setPropertyChanged( TQObject *o, const TQString &property, bo
if ( doUpdate &&
( property == "hAlign" || property == "vAlign" || property == "wordwrap" ) ) {
- doUpdate = FALSE;
+ doUpdate = false;
setPropertyChanged( o, "alignment", changed ||
isPropertyChanged( o, "hAlign" ) ||
isPropertyChanged( o, "vAlign" ) ||
isPropertyChanged( o, "wordwrap" ) );
- doUpdate = TRUE;
+ doUpdate = true;
}
if ( doUpdate && property == "alignment" ) {
- doUpdate = FALSE;
+ doUpdate = false;
setPropertyChanged( o, "hAlign", changed );
setPropertyChanged( o, "vAlign", changed );
setPropertyChanged( o, "wordwrap", changed );
- doUpdate = TRUE;
+ doUpdate = true;
}
}
@@ -192,7 +192,7 @@ bool MetaDataBase::isPropertyChanged( TQObject *o, const TQString &property )
if ( !r ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
o, o->name(), o->className() );
- return FALSE;
+ return false;
}
return r->changedProperties.findIndex( property ) != -1;
@@ -321,8 +321,8 @@ int MetaDataBase::spacing( TQObject *o )
if ( !o )
return -1;
setupDataBase();
- if ( ::tqqt_cast<TQMainWindow*>(o) )
- o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget());
+ if ( ::tqt_cast<TQMainWindow*>(o) )
+ o = ( (TQMainWindow*)o )->centralWidget();
MetaDataBaseRecord *r = db->find( (void*)o );
if ( !r || !o->isWidgetType() ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
@@ -349,13 +349,13 @@ void MetaDataBase::setMargin( TQObject *o, int margin )
TQLayout * layout = 0;
WidgetFactory::layoutType( (TQWidget*)o, layout );
- bool isInnerLayout = TRUE;
+ bool isInnerLayout = true;
TQWidget *widget = (TQWidget*)o;
- if ( widget && !::tqqt_cast<TQLayoutWidget*>(widget) &&
- ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) ||
- widget && widget->parentWidget() && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) )
- isInnerLayout = FALSE;
+ if ( widget && !::tqt_cast<TQLayoutWidget*>(widget) &&
+ ( WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ) ) ||
+ widget && widget->parentWidget() && ::tqt_cast<FormWindow*>(widget->parentWidget()) ) )
+ isInnerLayout = false;
if ( layout ) {
@@ -378,8 +378,8 @@ int MetaDataBase::margin( TQObject *o )
if ( !o )
return -1;
setupDataBase();
- if ( ::tqqt_cast<TQMainWindow*>(o) )
- o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget());
+ if ( ::tqt_cast<TQMainWindow*>(o) )
+ o = ( (TQMainWindow*)o )->centralWidget();
MetaDataBaseRecord *r = db->find( (void*)o );
if ( !r || !o->isWidgetType() ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
@@ -409,8 +409,8 @@ TQString MetaDataBase::resizeMode( TQObject *o )
if ( !o )
return TQString();
setupDataBase();
- if ( ::tqqt_cast<TQMainWindow*>(o) )
- o = TQT_TQOBJECT(( (TQMainWindow*)o )->centralWidget());
+ if ( ::tqt_cast<TQMainWindow*>(o) )
+ o = ( (TQMainWindow*)o )->centralWidget();
MetaDataBaseRecord *r = db->find( (void*)o );
if ( !r || !o->isWidgetType() ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
@@ -440,15 +440,15 @@ void MetaDataBase::addConnection( TQObject *o, TQObject *sender, const TQCString
r->connections.append( conn );
if ( addCode ) {
TQString rec = receiver->name();
- if ( ::tqqt_cast<FormWindow*>(o) && TQT_BASE_OBJECT(receiver) ==( (FormWindow*)o )->mainContainer() )
+ if ( ::tqt_cast<FormWindow*>(o) && receiver ==( (FormWindow*)o )->mainContainer() )
rec = "this";
TQString sen = sender->name();
- if ( ::tqqt_cast<FormWindow*>(o) && TQT_BASE_OBJECT(sender) ==( (FormWindow*)o )->mainContainer() )
+ if ( ::tqt_cast<FormWindow*>(o) && sender ==( (FormWindow*)o )->mainContainer() )
sen = "this";
FormFile *ff = 0;
- if ( ::tqqt_cast<FormFile*>(o) )
+ if ( ::tqt_cast<FormFile*>(o) )
ff = (FormFile*)o;
- else if ( ::tqqt_cast<FormWindow*>(o) )
+ else if ( ::tqt_cast<FormWindow*>(o) )
ff = ( (FormWindow*)o )->formFile();
ff->addConnection( sen, signal, rec, slot );
}
@@ -468,17 +468,17 @@ void MetaDataBase::removeConnection( TQObject *o, TQObject *sender, const TQCStr
return;
for ( TQValueList<Connection>::Iterator it = r->connections.begin(); it != r->connections.end(); ++it ) {
Connection conn = *it;
- if ( TQT_BASE_OBJECT(conn.sender) ==sender &&
+ if ( conn.sender ==sender &&
conn.signal == signal &&
- TQT_BASE_OBJECT(conn.receiver) ==receiver &&
+ conn.receiver ==receiver &&
conn.slot == slot ) {
r->connections.remove( it );
break;
}
}
- if ( ::tqqt_cast<FormWindow*>(o) ) {
+ if ( ::tqt_cast<FormWindow*>(o) ) {
TQString rec = receiver->name();
- if ( TQT_BASE_OBJECT(receiver) ==( (FormWindow*)o )->mainContainer() )
+ if ( receiver ==( (FormWindow*)o )->mainContainer() )
rec = "this";
( (FormWindow*)o )->formFile()->removeConnection( sender->name(), signal, rec, slot );
}
@@ -494,7 +494,7 @@ void MetaDataBase::setupConnections( TQObject *o, const TQValueList<LanguageInte
return;
}
- if ( !::tqqt_cast<FormFile*>(o) )
+ if ( !::tqt_cast<FormFile*>(o) )
return;
FormFile *formfile = (FormFile*)o;
@@ -514,8 +514,8 @@ void MetaDataBase::setupConnections( TQObject *o, const TQValueList<LanguageInte
sender = formfile->project()->objectForFakeFormFile( formfile );
if ( !sender && senderName == "this" )
sender = formfile->formWindow() ?
- TQT_TQOBJECT(formfile->formWindow()->mainContainer()) :
- TQT_TQOBJECT(formfile->project()->objectForFakeFormFile( formfile ));
+ formfile->formWindow()->mainContainer() :
+ formfile->project()->objectForFakeFormFile( formfile );
if ( !sender )
continue;
MetaDataBase::addConnection( formfile->formWindow() ?
@@ -524,10 +524,10 @@ void MetaDataBase::setupConnections( TQObject *o, const TQValueList<LanguageInte
sender,
(*cit).signal.latin1(),
formfile->formWindow() ?
- TQT_TQOBJECT(formfile->formWindow()->mainContainer()) :
- TQT_TQOBJECT(formfile->project()->objectForFakeFormFile( formfile )),
+ formfile->formWindow()->mainContainer() :
+ formfile->project()->objectForFakeFormFile( formfile ),
(*cit).slot.latin1(),
- FALSE );
+ false );
}
}
@@ -539,18 +539,18 @@ bool MetaDataBase::hasConnection( TQObject *o, TQObject *sender, const TQCString
if ( !r ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
o, o->name(), o->className() );
- return FALSE;
+ return false;
}
for ( TQValueList<Connection>::Iterator it = r->connections.begin(); it != r->connections.end(); ++it ) {
Connection conn = *it;
- if ( TQT_BASE_OBJECT(conn.sender) ==sender &&
+ if ( conn.sender ==sender &&
conn.signal == signal &&
- TQT_BASE_OBJECT(conn.receiver) ==receiver &&
+ conn.receiver ==receiver &&
conn.slot == slot )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
@@ -581,8 +581,8 @@ TQValueList<MetaDataBase::Connection> MetaDataBase::connections( TQObject *o, TQ
TQValueList<Connection>::Iterator conn;
while ( ( conn = it ) != r->connections.end() ) {
++it;
- if ( TQT_BASE_OBJECT((*conn).sender) ==sender &&
- TQT_BASE_OBJECT((*conn).receiver) ==receiver )
+ if ( (*conn).sender ==sender &&
+ (*conn).receiver ==receiver )
ret << *conn;
}
@@ -603,8 +603,8 @@ TQValueList<MetaDataBase::Connection> MetaDataBase::connections( TQObject *o, TQ
TQValueList<Connection>::Iterator conn;
while ( ( conn = it ) != r->connections.end() ) {
++it;
- if ( TQT_BASE_OBJECT((*conn).sender) ==object ||
- TQT_BASE_OBJECT((*conn).receiver) ==object )
+ if ( (*conn).sender ==object ||
+ (*conn).receiver ==object )
ret << *conn;
}
return ret;
@@ -628,7 +628,7 @@ void MetaDataBase::doConnections( TQObject *o )
if ( qstrcmp( conn.sender->name(), o->name() ) == 0 ) {
sender = o;
} else {
- l = o->queryList( 0, conn.sender->name(), FALSE );
+ l = o->queryList( 0, conn.sender->name(), false );
if ( !l || !l->first() ) {
delete l;
continue;
@@ -639,7 +639,7 @@ void MetaDataBase::doConnections( TQObject *o )
if ( qstrcmp( conn.receiver->name(), o->name() ) == 0 ) {
receiver = o;
} else {
- l = o->queryList( 0, conn.receiver->name(), FALSE );
+ l = o->queryList( 0, conn.receiver->name(), false );
if ( !l || !l->first() ) {
delete l;
continue;
@@ -652,8 +652,8 @@ void MetaDataBase::doConnections( TQObject *o )
TQString s2 = "1""%1";
s2 = s2.arg( conn.slot.data() );
- TQStrList signalList = sender->metaObject()->signalNames( TRUE );
- TQStrList slotList = receiver->metaObject()->slotNames( TRUE );
+ TQStrList signalList = sender->metaObject()->signalNames( true );
+ TQStrList slotList = receiver->metaObject()->slotNames( true );
// avoid warnings
if ( signalList.find( conn.signal ) == -1 ||
@@ -671,22 +671,22 @@ bool MetaDataBase::hasSlot( TQObject *o, const TQCString &slot, bool onlyCustom
if ( !r ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
o, o->name(), o->className() );
- return FALSE;
+ return false;
}
if ( !onlyCustom ) {
- TQStrList slotList = o->metaObject()->slotNames( TRUE );
+ TQStrList slotList = o->metaObject()->slotNames( true );
if ( slotList.find( slot ) != -1 )
- return TRUE;
+ return true;
- if ( ::tqqt_cast<FormWindow*>(o) ) {
- o = TQT_TQOBJECT(( (FormWindow*)o )->mainContainer());
- slotList = o->metaObject()->slotNames( TRUE );
+ if ( ::tqt_cast<FormWindow*>(o) ) {
+ o = ( (FormWindow*)o )->mainContainer();
+ slotList = o->metaObject()->slotNames( true );
if ( slotList.find( slot ) != -1 )
- return TRUE;
+ return true;
}
- //if ( ::tqqt_cast<CustomWidget*>(o) ) {
+ //if ( ::tqt_cast<CustomWidget*>(o) ) {
if ( o->inherits( "CustomWidget" ) ) {
MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget();
for ( TQValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {
@@ -694,7 +694,7 @@ bool MetaDataBase::hasSlot( TQObject *o, const TQCString &slot, bool onlyCustom
if ( !s.data() )
continue;
if ( s == slot )
- return TRUE;
+ return true;
}
}
}
@@ -702,10 +702,10 @@ bool MetaDataBase::hasSlot( TQObject *o, const TQCString &slot, bool onlyCustom
for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
Function f = *it;
if ( normalizeFunction( f.function ) == normalizeFunction( slot ) && f.type == "slot" )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool MetaDataBase::isSlotUsed( TQObject *o, const TQCString &slot )
@@ -715,15 +715,15 @@ bool MetaDataBase::isSlotUsed( TQObject *o, const TQCString &slot )
if ( !r ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
o, o->name(), o->className() );
- return FALSE;
+ return false;
}
TQValueList<Connection> conns = connections( o );
for ( TQValueList<Connection>::Iterator it = conns.begin(); it != conns.end(); ++it ) {
if ( (*it).slot == slot )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
@@ -901,22 +901,22 @@ bool MetaDataBase::hasFunction( TQObject *o, const TQCString &function, bool onl
if ( !r ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
o, o->name(), o->className() );
- return FALSE;
+ return false;
}
if ( !onlyCustom ) {
- TQStrList functionList = o->metaObject()->slotNames( TRUE );
+ TQStrList functionList = o->metaObject()->slotNames( true );
if ( functionList.find( function ) != -1 )
- return TRUE;
+ return true;
- if ( ::tqqt_cast<FormWindow*>(o) ) {
- o = TQT_TQOBJECT(( (FormWindow*)o )->mainContainer());
- functionList = o->metaObject()->slotNames( TRUE );
+ if ( ::tqt_cast<FormWindow*>(o) ) {
+ o = ( (FormWindow*)o )->mainContainer();
+ functionList = o->metaObject()->slotNames( true );
if ( functionList.find( function ) != -1 )
- return TRUE;
+ return true;
}
- //if ( ::tqqt_cast<CustomWidget*>(o) ) {
+ //if ( ::tqt_cast<CustomWidget*>(o) ) {
if ( o->inherits( "CustomWidget" ) ) {
MetaDataBase::CustomWidget *w = ( (::CustomWidget*)o )->customWidget();
for ( TQValueList<Function>::Iterator it = w->lstSlots.begin(); it != w->lstSlots.end(); ++it ) {
@@ -924,7 +924,7 @@ bool MetaDataBase::hasFunction( TQObject *o, const TQCString &function, bool onl
if ( !s.data() )
continue;
if ( s == function )
- return TRUE;
+ return true;
}
}
}
@@ -932,10 +932,10 @@ bool MetaDataBase::hasFunction( TQObject *o, const TQCString &function, bool onl
for ( TQValueList<Function>::Iterator it = r->functionList.begin(); it != r->functionList.end(); ++it ) {
Function f = *it;
if ( normalizeFunction( f.function ) == normalizeFunction( function ) )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
TQString MetaDataBase::languageOfFunction( TQObject *o, const TQCString &function )
@@ -975,7 +975,7 @@ bool MetaDataBase::addCustomWidget( CustomWidget *wid )
w->lstProperties.append( *it3 );
}
delete wid;
- return FALSE;
+ return false;
}
}
@@ -988,7 +988,7 @@ bool MetaDataBase::addCustomWidget( CustomWidget *wid )
r->isContainer = wid->isContainer;
wid->id = WidgetDatabase::addCustomWidget( r );
cWidgets->append( wid );
- return TRUE;
+ return true;
}
void MetaDataBase::removeCustomWidget( CustomWidget *w )
@@ -1017,18 +1017,18 @@ bool MetaDataBase::isWidgetNameUsed( CustomWidget *wid )
if ( w == wid )
continue;
if ( wid->className == w->className )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool MetaDataBase::hasCustomWidget( const TQString &className )
{
for ( CustomWidget *w = cWidgets->first(); w; w = cWidgets->next() ) {
if ( w->className == className )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void MetaDataBase::setTabOrder( TQWidget *w, const TQWidgetList &order )
@@ -1175,15 +1175,15 @@ bool MetaDataBase::hasVariable( TQObject *o, const TQString &name )
if ( !r ) {
tqWarning( "No entry for %p (%s, %s) found in MetaDataBase",
o, o->name(), o->className() );
- return FALSE;
+ return false;
}
TQValueList<Variable>::Iterator it = r->variables.begin();
for ( ; it != r->variables.end(); ++it ) {
if ( extractVariableName( name ) == extractVariableName( (*it).varName ) )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
TQString MetaDataBase::extractVariableName( const TQString &name )
@@ -1280,7 +1280,7 @@ MetaDataBase::CustomWidget::CustomWidget()
pixmap = new TQPixmap( BarIcon( "designer_customwidget.png", KDevDesignerPartFactory::instance() ) );
id = -1;
sizePolicy = TQSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Preferred );
- isContainer = FALSE;
+ isContainer = false;
}
MetaDataBase::CustomWidget::CustomWidget( const CustomWidget &w )
@@ -1354,40 +1354,40 @@ MetaDataBase::CustomWidget &MetaDataBase::CustomWidget::operator=( const CustomW
bool MetaDataBase::CustomWidget::hasSignal( const TQCString &signal ) const
{
- TQStrList sigList = TQWidget::staticMetaObject()->signalNames( TRUE );
+ TQStrList sigList = TQWidget::staticMetaObject()->signalNames( true );
if ( sigList.find( signal ) != -1 )
- return TRUE;
+ return true;
for ( TQValueList<TQCString>::ConstIterator it = lstSignals.begin(); it != lstSignals.end(); ++it ) {
if ( normalizeFunction( *it ) == normalizeFunction( signal ) )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool MetaDataBase::CustomWidget::hasSlot( const TQCString &slot ) const
{
- TQStrList slotList = TQWidget::staticMetaObject()->slotNames( TRUE );
+ TQStrList slotList = TQWidget::staticMetaObject()->slotNames( true );
if ( slotList.find( normalizeFunction( slot ) ) != -1 )
- return TRUE;
+ return true;
for ( TQValueList<MetaDataBase::Function>::ConstIterator it = lstSlots.begin(); it != lstSlots.end(); ++it ) {
if ( normalizeFunction( (*it).function ) == normalizeFunction( slot ) )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool MetaDataBase::CustomWidget::hasProperty( const TQCString &prop ) const
{
- TQStrList propList = TQWidget::staticMetaObject()->propertyNames( TRUE );
+ TQStrList propList = TQWidget::staticMetaObject()->propertyNames( true );
if ( propList.find( prop ) != -1 )
- return TRUE;
+ return true;
for ( TQValueList<MetaDataBase::Property>::ConstIterator it = lstProperties.begin(); it != lstProperties.end(); ++it ) {
if ( (*it).property == prop )
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void MetaDataBase::setPixmapArgument( TQObject *o, int pixmap, const TQString &arg )