BUG: Time : set up file monitoring only if runTimeModifiable

This commit is contained in:
mattijs
2010-10-19 09:55:33 +01:00
parent d98c5f9b24
commit 82eedb5b3c

View File

@ -245,13 +245,13 @@ Foam::Time::Time
readLibs_(controlDict_, "libs"),
functionObjects_(*this)
{
setControls();
// Time objects not registered so do like objectRegistry::checkIn ourselves.
if (runTimeModifiable_)
{
controlDict_.watchIndex() = addWatch(controlDict_.filePath());
}
setControls();
}
@ -307,14 +307,18 @@ Foam::Time::Time
readLibs_(controlDict_, "libs"),
functionObjects_(*this)
{
setControls();
// Time objects not registered so do like objectRegistry::checkIn ourselves.
if (runTimeModifiable_)
{
controlDict_.watchIndex() = addWatch(controlDict_.filePath());
// File might not exist yet.
fileName f(controlDict_.filePath());
if (f != fileName::null)
{
controlDict_.watchIndex() = addWatch(f);
}
}
setControls();
}