Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaKernel] Set BaseData to non-persistant by default #1191

Merged
merged 2 commits into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions SofaKernel/framework/sofa/core/objectmodel/BaseData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ BaseData::BaseData(const char* h, DataFlags dataflags)
addLink(&outputs);
m_counters.assign(0);
m_isSets.assign(false);
setFlag(FLAG_PERSISTENT, false);
}

BaseData::BaseData( const char* h, bool isDisplayed, bool isReadOnly)
Expand All @@ -58,6 +59,7 @@ BaseData::BaseData( const char* h, bool isDisplayed, bool isReadOnly)
m_isSets.assign(false);
setFlag(FLAG_DISPLAYED,isDisplayed);
setFlag(FLAG_READONLY,isReadOnly);
setFlag(FLAG_PERSISTENT, false);
}

BaseData::BaseData( const BaseInitData& init)
Expand All @@ -70,6 +72,7 @@ BaseData::BaseData( const BaseInitData& init)
addLink(&outputs);
m_counters.assign(0);
m_isSets.assign(false);

if (init.data && init.data != this)
{
{
Expand All @@ -82,6 +85,7 @@ BaseData::BaseData( const BaseInitData& init)
exit( EXIT_FAILURE );
}
if (m_owner) m_owner->addData(this, m_name);
setFlag(FLAG_PERSISTENT, false);
}

BaseData::~BaseData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def createScene(rootNode):
ASSERT_NEQ(field, None)

### Check isPersistant/setPersistant
ASSERT_TRUE( field.isPersistant() )
field.setPersistant(False)
ASSERT_FALSE( field.isPersistant() )
field.setPersistant(True)
ASSERT_TRUE( field.isPersistant() )

### Check isSet/unset
ASSERT_TRUE( field.isSet() )
Expand Down