Skip to content
Snippets Groups Projects
Commit 5c5b82f2 authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: codeProperties was masking regIOobject::modified()

- file changes were not getting noticed, made modified 'sticky'
parent f2ff53f7
Branches
Tags
No related merge requests found
......@@ -24,12 +24,12 @@ License
\*---------------------------------------------------------------------------*/
#include "codeProperties.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(Foam::codeProperties, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::codeProperties::codeProperties(const IOobject& io)
......@@ -41,6 +41,20 @@ Foam::codeProperties::codeProperties(const IOobject& io)
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::codeProperties::modified() const
{
modified_ = modified_ || regIOobject::modified();
return modified_;
}
void Foam::codeProperties::setUnmodified() const
{
modified_ = false;
}
bool Foam::codeProperties::read()
{
if (regIOobject::read())
......
......@@ -25,7 +25,7 @@ Class
Foam::codeProperties
Description
IOdictionary + flag whether file has changed.
IOdictionary with an internal flag to explicitly track when a file changed.
SourceFiles
codeProperties.C
......@@ -35,7 +35,6 @@ SourceFiles
#ifndef codeProperties_H
#define codeProperties_H
#include "MeshObject.H"
#include "IOdictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -53,7 +52,7 @@ class codeProperties
{
// Private data
//- File change
//- Monitor file change
mutable bool modified_;
public:
......@@ -69,15 +68,12 @@ public:
// Member Functions
bool modified() const
{
return modified_;
}
//- A sticky version of regIOobject::modified()
// Must explicitly clear with setUnmodified()
virtual bool modified() const;
void setUnmodified() const
{
modified_ = false;
}
//- Make modification unsticky
void setUnmodified() const;
//- Read the dictionary
virtual bool read();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment