summaryrefslogtreecommitdiffstats
path: root/tools/bootstrp/prj.cxx
diff options
context:
space:
mode:
authorJoseph Powers <jpowers27@cox.net>2011-01-15 20:50:47 -0800
committerJoseph Powers <jpowers27@cox.net>2011-01-15 20:50:47 -0800
commit7763ff4539119a27bc49e83846466d9de1d440c1 (patch)
tree236fc5bc2d56820fa2b22347bc75d6f11d6da535 /tools/bootstrp/prj.cxx
parentRemove DECLARE_LIST ( SolarFileList, String* ) (diff)
downloadcore-7763ff4539119a27bc49e83846466d9de1d440c1.tar.gz
core-7763ff4539119a27bc49e83846466d9de1d440c1.zip
Remove DECLARE_LIST( StarFileList, StarFile * )
Note: I messed up the SolarFileList before so I'm going to submit another patch to fix it. I'm not sure why the code is working now...
Diffstat (limited to 'tools/bootstrp/prj.cxx')
-rw-r--r--tools/bootstrp/prj.cxx62
1 files changed, 11 insertions, 51 deletions
diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx
index 3b2f2dd0f2d5..638df5c0d943 100644
--- a/tools/bootstrp/prj.cxx
+++ b/tools/bootstrp/prj.cxx
@@ -573,21 +573,6 @@ Star::~Star()
}
/*****************************************************************************/
-BOOL Star::NeedsUpdate()
-/*****************************************************************************/
-{
- aMutex.acquire();
- for ( ULONG i = 0; i < aLoadedFilesList.Count(); i++ )
- if ( aLoadedFilesList.GetObject( i )->NeedsUpdate()) {
- aMutex.release();
- return TRUE;
- }
-
- aMutex.release();
- return FALSE;
-}
-
-/*****************************************************************************/
void Star::Read( String &rFileName )
/*****************************************************************************/
{
@@ -599,6 +584,7 @@ void Star::Read( String &rFileName )
aEntry = aEntry.GetPath().GetPath().GetPath();
sSourceRoot = aEntry.GetFull();
+ // todo: change this to while( !aFileList.empty() )
for ( size_t i = 0, n = aFileList.size(); i < n; ++ i )
{
StarFile *pFile = new StarFile( *aFileList[ i ] );
@@ -607,10 +593,14 @@ void Star::Read( String &rFileName )
while (( aString = aSolarConfig.GetNext()) != "" )
InsertToken (( char * ) aString.GetBuffer());
}
- aMutex.acquire();
- aLoadedFilesList.Insert( pFile, LIST_APPEND );
- aMutex.release();
+ // todo: delete the pFile (it's not needed any more)
+ // todo: change the delete; to remove the 1st item in the list.
+ // what happens is new files may be added to the list by InsertToken()... thus, the list
+ // gets longer as things get processed. Thus, we need to remove things from the front as
+ // they get processed.
+ delete aFileList[ i ];
}
+ // todo: remove the clear(); if we left the loop above, then the list is empty
aFileList.clear();
// resolve all dependencies recursive
Expand_Impl();
@@ -630,11 +620,7 @@ void Star::Read( SolarFileList *pSolarFiles )
while (( aString = aSolarConfig.GetNext()) != "" )
InsertToken (( char * ) aString.GetBuffer());
}
-
- aMutex.acquire();
- aLoadedFilesList.Insert( pFile, LIST_APPEND );
- aMutex.release();
- delete (*pSolarFiles)[ i ]; // TODO: isn't this deleting the object inserted into aLoadedFilesList?
+ delete (*pSolarFiles)[ i ];
}
pSolarFiles->clear();
delete pSolarFiles;
@@ -1129,11 +1115,7 @@ USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode )
while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" )
InsertTokenLine ( aString );
}
-
- aMutex.acquire();
- aLoadedFilesList.Insert( pFile, LIST_APPEND );
- aMutex.release();
- delete aFileList[ i ]; // TODO: isn't this deleting the object inserted into aLoadedFilesList?
+ delete aFileList[ i ];
}
aFileList.clear();
// resolve all dependencies recursive
@@ -1160,11 +1142,7 @@ USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments )
while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" )
InsertTokenLine ( aString );
}
-
- aMutex.acquire();
- aLoadedFilesList.Insert( pFile, LIST_APPEND );
- aMutex.release();
- delete (*pSolarFiles)[ i ]; // TODO: isn't this deleting the object inserted into aLoadedFilesList?
+ delete (*pSolarFiles)[ i ];
}
pSolarFiles->clear();
delete pSolarFiles;
@@ -1591,22 +1569,4 @@ StarFile::StarFile( const String &rFile )
bExists = FALSE;
}
-/*****************************************************************************/
-BOOL StarFile::NeedsUpdate()
-/*****************************************************************************/
-{
- DirEntry aEntry( aFileName );
- if ( aEntry.Exists()) {
- if ( !bExists ) {
- bExists = TRUE;
- return TRUE;
- }
- FileStat aStat( aEntry );
- if (( aStat.DateModified() > aDate ) ||
- (( aStat.DateModified() == aDate ) && ( aStat.TimeModified() > aTime )))
- return TRUE;
- }
- return FALSE;
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */