From e34a054f44293fae673dd575ef06d69d24cb64ab Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 20 Jul 2007 12:37:07 +0000 Subject: [PATCH] Start to use SALOMEDS::Study::Modified() method --- idl/SALOMEDS.idl | 6 ++++++ src/SALOMEDS/SALOMEDS_Study.cxx | 10 ++++++++++ src/SALOMEDS/SALOMEDS_Study.hxx | 1 + src/SALOMEDS/SALOMEDS_Study_i.cxx | 12 ++++++++++++ src/SALOMEDS/SALOMEDS_Study_i.hxx | 4 ++++ src/SALOMEDSClient/SALOMEDSClient_Study.hxx | 1 + 6 files changed, 34 insertions(+) diff --git a/idl/SALOMEDS.idl b/idl/SALOMEDS.idl index 73dd4b1e8..541740fd1 100644 --- a/idl/SALOMEDS.idl +++ b/idl/SALOMEDS.idl @@ -309,6 +309,12 @@ during each working session. Returns True if the %study has been modified and not saved. */ boolean IsModified(); + +/*! + Marks the %study as being modified and not saved. +*/ + void Modified(); + /*! Determines the file where the %study has been saved */ diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 207684032..3dca6b26d 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -505,6 +505,16 @@ bool SALOMEDS_Study::IsModified() else isModified = _corba_impl->IsModified(); return isModified; } + +void SALOMEDS_Study::Modified() +{ + if (_isLocal) { + SALOMEDS::Locker lock; + _local_impl->Modify(); + } + else _corba_impl->IsModified(); +} + std::string SALOMEDS_Study::URL() { diff --git a/src/SALOMEDS/SALOMEDS_Study.hxx b/src/SALOMEDS/SALOMEDS_Study.hxx index 8babf0b6e..41e40902a 100644 --- a/src/SALOMEDS/SALOMEDS_Study.hxx +++ b/src/SALOMEDS/SALOMEDS_Study.hxx @@ -75,6 +75,7 @@ public: virtual bool IsSaved(); virtual void IsSaved(bool save); virtual bool IsModified(); + virtual void Modified(); virtual std::string URL(); virtual void URL(const std::string& url); virtual int StudyId(); diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 1bac30de6..51c1be559 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -522,6 +522,18 @@ CORBA::Boolean SALOMEDS_Study_i::IsModified() return _impl->IsModified(); } +//============================================================================ +/*! Function : Modified + * Purpose : Set a Modified flag of a Study to True + */ +//============================================================================ +void SALOMEDS_Study_i::Modified() +{ + SALOMEDS::Locker lock; + _impl->Modify(); +} + + //============================================================================ /*! Function : URL * Purpose : get URL of the study (persistent reference of the study) diff --git a/src/SALOMEDS/SALOMEDS_Study_i.hxx b/src/SALOMEDS/SALOMEDS_Study_i.hxx index 137eca872..bcbae1dee 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.hxx @@ -223,6 +223,10 @@ public: */ virtual CORBA::Boolean IsModified(); + //! method to set a Modified flag of a Study to True + virtual void Modified(); + + //! method to get URL of the study (idem GetPersistentReference) /*! \return char* arguments, the study URL diff --git a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx index 136bafd35..33182f673 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx @@ -69,6 +69,7 @@ public: virtual bool IsSaved() = 0; virtual void IsSaved(bool save) = 0; virtual bool IsModified() = 0; + virtual void Modified() = 0; virtual std::string URL() = 0; virtual void URL(const std::string& url) = 0; virtual int StudyId() = 0; -- 2.39.2