Set object's Restore flag while restoring the Path property.
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include <App/DocumentObject.h>
|
||||
#include <App/PropertyContainer.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Writer.h>
|
||||
#include <Base/Reader.h>
|
||||
@@ -124,9 +126,23 @@ void PropertyPath::SaveDocFile (Base::Writer &) const
|
||||
|
||||
void PropertyPath::RestoreDocFile(Base::Reader &reader)
|
||||
{
|
||||
App::PropertyContainer *container = getContainer();
|
||||
App::DocumentObject *obj = 0;
|
||||
if (container->isDerivedFrom(App::DocumentObject::getClassTypeId())) {
|
||||
obj = static_cast<App::DocumentObject*>(container);
|
||||
}
|
||||
|
||||
if (obj) {
|
||||
obj->setStatus(App::ObjectStatus::Restore, true);
|
||||
}
|
||||
|
||||
aboutToSetValue();
|
||||
_Path.RestoreDocFile(reader);
|
||||
hasSetValue();
|
||||
|
||||
if (obj) {
|
||||
obj->setStatus(App::ObjectStatus::Restore, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -134,8 +134,8 @@ class ToolController:
|
||||
def onChanged(self, obj, prop):
|
||||
PathLog.track('prop: {} state: {}'.format(prop, obj.State))
|
||||
|
||||
|
||||
if 'Restore' not in obj.State:
|
||||
if 'Path' == prop and 'Restore' not in obj.State:
|
||||
PathLog.debug("--- dirty deeds")
|
||||
job = PathScripts.PathUtils.findParentJob(obj)
|
||||
if job is not None:
|
||||
for g in job.Group:
|
||||
|
||||
Reference in New Issue
Block a user