mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: include file tracking: missed out adding files to list of files to check
This commit is contained in:
@ -24,10 +24,10 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "includeEntry.H"
|
||||
#include "dictionary.H"
|
||||
#include "IFstream.H"
|
||||
#include "addToMemberFunctionSelectionTable.H"
|
||||
#include "stringOps.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -127,6 +127,9 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
(
|
||||
includeFileName(is.name().path(), rawFName, parentDict)
|
||||
);
|
||||
|
||||
|
||||
// Read contents of file into parentDict
|
||||
IFstream ifs(fName);
|
||||
|
||||
if (ifs)
|
||||
@ -135,6 +138,21 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
{
|
||||
Info<< fName << endl;
|
||||
}
|
||||
|
||||
// Add watch on included file
|
||||
const dictionary& top = parentDict.topDict();
|
||||
if (isA<regIOobject>(top))
|
||||
{
|
||||
regIOobject& rio = const_cast<regIOobject&>
|
||||
(
|
||||
dynamic_cast<const regIOobject&>(top)
|
||||
);
|
||||
//Info<< rio.name() << " : adding depenency on included file "
|
||||
// << fName << endl;
|
||||
|
||||
rio.addWatch(fName);
|
||||
}
|
||||
|
||||
parentDict.read(ifs);
|
||||
return true;
|
||||
}
|
||||
@ -165,6 +183,9 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
(
|
||||
includeFileName(is.name().path(), rawFName, parentDict)
|
||||
);
|
||||
|
||||
|
||||
// Read contents of file into parentDict
|
||||
IFstream ifs(fName);
|
||||
|
||||
if (ifs)
|
||||
@ -173,6 +194,21 @@ bool Foam::functionEntries::includeEntry::execute
|
||||
{
|
||||
Info<< fName << endl;
|
||||
}
|
||||
|
||||
// Add watch on included file
|
||||
const dictionary& top = parentDict.topDict();
|
||||
if (isA<regIOobject>(top))
|
||||
{
|
||||
regIOobject& rio = const_cast<regIOobject&>
|
||||
(
|
||||
dynamic_cast<const regIOobject&>(top)
|
||||
);
|
||||
//Info<< rio.name() << " : adding depenency on included file "
|
||||
// << fName << endl;
|
||||
|
||||
rio.addWatch(fName);
|
||||
}
|
||||
|
||||
entry.read(parentDict, ifs);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user