@ -435,7 +435,20 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject )
inc . implDecl = " in implementation " ;
inc . header = e . firstChild ( ) . toText ( ) . data ( ) ;
if ( inc . header . right ( 5 ) ! = " .ui.h " ) {
metaIncludes . append ( inc ) ;
bool found = false ;
TQValueList < MetaDataBase : : Include > : : Iterator it ;
for ( it = metaIncludes . begin ( ) ; it ! = metaIncludes . end ( ) ; + + it ) {
MetaDataBase : : Include currInc = * it ;
if ( currInc . location = = inc . location & & currInc . implDecl = = inc . implDecl & &
currInc . header = = inc . header ) {
found = true ;
break ;
}
}
if ( ! found )
{
metaIncludes . append ( inc ) ;
}
} else {
if ( formwindow - > formFile ( ) )
formwindow - > formFile ( ) - > setCodeFileState ( FormFile : : Ok ) ;
@ -515,7 +528,20 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject )
inc . implDecl = " in implementation " ;
inc . header = n . firstChild ( ) . toText ( ) . data ( ) ;
if ( inc . header . right ( 5 ) ! = " .ui.h " ) {
metaIncludes . append ( inc ) ;
bool found = false ;
TQValueList < MetaDataBase : : Include > : : Iterator it ;
for ( it = metaIncludes . begin ( ) ; it ! = metaIncludes . end ( ) ; + + it ) {
MetaDataBase : : Include currInc = * it ;
if ( currInc . location = = inc . location & & currInc . implDecl = = inc . implDecl & &
currInc . header = = inc . header ) {
found = true ;
break ;
}
}
if ( ! found )
{
metaIncludes . append ( inc ) ;
}
} else {
if ( formwindow - > formFile ( ) )
formwindow - > formFile ( ) - > setCodeFileState ( FormFile : : Ok ) ;
@ -724,7 +750,6 @@ bool Resource::save( TQIODevice* dev )
saveConnections ( ts , 0 ) ;
saveTabOrder ( ts , 0 ) ;
saveMetaInfoAfter ( ts , 0 ) ;
saveIncludeHints ( ts , 0 ) ;
ts < < " </UI> " < < endl ;
bool ok = saveFormCode ( formwindow - > formFile ( ) , langIface ) ;
images . clear ( ) ;
@ -849,7 +874,26 @@ void Resource::saveObject( TQObject *obj, TQDesignerGridLayout* grid, TQTextStre
if ( obj - > isWidgetType ( ) ) {
if ( obj - > isA ( " CustomWidget " ) | | isPlugin ) {
usedCustomWidgets < < TQString ( className ) ;
includeHints < < WidgetDatabase : : includeFile ( classID ) ;
MetaDataBase : : Include inc ;
inc . location = " global " ;
inc . implDecl = " in implementation " ;
inc . header = WidgetDatabase : : includeFile ( classID ) ;
bool found = false ;
TQValueList < MetaDataBase : : Include > includes = MetaDataBase : : includes ( formwindow ) ;
TQValueList < MetaDataBase : : Include > : : Iterator it ;
for ( it = includes . begin ( ) ; it ! = includes . end ( ) ; + + it ) {
MetaDataBase : : Include currInc = * it ;
if ( currInc . location = = inc . location & & currInc . implDecl = = inc . implDecl & &
currInc . header = = inc . header ) {
found = true ;
break ;
}
}
if ( ! found )
{
includes < < inc ;
}
MetaDataBase : : setIncludes ( formwindow , includes ) ;
}
if ( obj ! = formwindow & & ! formwindow - > widgets ( ) - > find ( ( TQWidget * ) obj ) )
@ -2942,18 +2986,6 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent )
}
}
void Resource : : saveIncludeHints ( TQTextStream & ts , int indent )
{
if ( includeHints . isEmpty ( ) )
return ;
ts < < makeIndent ( indent ) < < " <includehints> " < < endl ;
indent + + ;
for ( TQStringList : : Iterator it = includeHints . begin ( ) ; it ! = includeHints . end ( ) ; + + it )
ts < < makeIndent ( indent ) < < " <includehint> " < < * it < < " </includehint> " < < endl ;
indent - - ;
ts < < makeIndent ( indent ) < < " </includehints> " < < endl ;
}
TQColorGroup Resource : : loadColorGroup ( const TQDomElement & e )
{
TQColorGroup cg ;