summaryrefslogtreecommitdiff
path: root/tools/bootstrp
diff options
context:
space:
mode:
authorNils Fuhrmann <nf@openoffice.org>2001-02-13 14:37:48 +0000
committerNils Fuhrmann <nf@openoffice.org>2001-02-13 14:37:48 +0000
commit85a573a598aaa5116c521e6dd693d524328a79e0 (patch)
tree236e8fb6b30d4d012127319d56d985fc50ccc076 /tools/bootstrp
parentfc3a4018d401c463b09e9c3e8b1d9c0bd4ac6ea8 (diff)
New funtionality: method Star::NeedsUpdate() return TRUE if one of the configuration files has changed. This includes single and multiple solar lists per workspace
Diffstat (limited to 'tools/bootstrp')
-rw-r--r--tools/bootstrp/prj.cxx30
1 files changed, 26 insertions, 4 deletions
diff --git a/tools/bootstrp/prj.cxx b/tools/bootstrp/prj.cxx
index f7291ee8b4f5..d3eb9bb681e9 100644
--- a/tools/bootstrp/prj.cxx
+++ b/tools/bootstrp/prj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: prj.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: nf $ $Date: 2001-02-13 12:28:24 $
+ * last change: $Author: nf $ $Date: 2001-02-13 15:37:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -610,6 +610,20 @@ Star::~Star()
}
/*****************************************************************************/
+BOOL Star::NeedsUpdate()
+/*****************************************************************************/
+{
+ for ( ULONG i = 0; i < aLoadedFilesList.Count(); i++ ) {
+ DirEntry aEntry( *aLoadedFilesList.GetObject( i ));
+ FileStat aStat( aEntry );
+
+ if (( aStat.DateModified() > aDate ) || ( aStat.TimeModified() > aTime ))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*****************************************************************************/
void Star::Read( String &rFileName )
/*****************************************************************************/
{
@@ -623,7 +637,8 @@ void Star::Read( String &rFileName )
while( aFileList.Count()) {
SimpleConfig aSolarConfig( *aFileList.GetObject(( ULONG ) 0 ));
- delete aFileList.Remove(( ULONG ) 0 );
+ aLoadedFilesList.Insert( aFileList.GetObject(( ULONG ) 0 ), LIST_APPEND );
+ aFileList.Remove(( ULONG ) 0 );
while (( aString = aSolarConfig.GetNext()) != "" )
InsertToken (( char * ) aString.GetBuffer());
@@ -642,6 +657,9 @@ void Star::Read( SolarFileList *pSolarFiles )
SimpleConfig aSolarConfig( *pSolarFiles->GetObject(( ULONG ) 0 ));
while (( aString = aSolarConfig.GetNext()) != "" )
InsertToken (( char * ) aString.GetBuffer());
+
+ aLoadedFilesList.Insert( new String( *pSolarFiles->GetObject(( ULONG ) 0 )),
+ LIST_APPEND );
}
Expand_Impl();
@@ -1018,7 +1036,8 @@ USHORT StarWriter::Read( String aFileName, BOOL bReadComments, USHORT nMode )
while( aFileList.Count()) {
SimpleConfig aSolarConfig( *aFileList.GetObject(( ULONG ) 0 ));
- delete aFileList.Remove(( ULONG ) 0 );
+ aLoadedFilesList.Insert( aFileList.GetObject(( ULONG ) 0 ), LIST_APPEND );
+ aFileList.Remove(( ULONG ) 0 );
while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" )
InsertTokenLine ( aString );
@@ -1044,6 +1063,9 @@ USHORT StarWriter::Read( SolarFileList *pSolarFiles, BOOL bReadComments )
SimpleConfig aSolarConfig( *pSolarFiles->GetObject(( ULONG ) 0 ));
while (( aString = aSolarConfig.GetCleanedNextLine( bReadComments )) != "" )
InsertTokenLine ( aString );
+
+ aLoadedFilesList.Insert( new String( *pSolarFiles->GetObject(( ULONG ) 0 )),
+ LIST_APPEND );
}
Expand_Impl();