int actId = thePref->addPreference(QObject::tr("Create new part"), group, SUIT_PreferenceMgr::Bool,
ModuleBase_Preferences::GENERAL_SECTION, "create_init_part");
- if (!resourceMgr()->hasValue(ModuleBase_Preferences::GENERAL_SECTION, "create_init_part"))
- { // set default value: true
- resourceMgr()->setValue(ModuleBase_Preferences::GENERAL_SECTION, "create_init_part", true);
- }
// Group related to running a python script
group = thePref->addPreference(QObject::tr("Launching a python script"), generalTab,
QString aVal = aResMgr->stringValue(theSection, theParam);
Config_Prop* aProp = Config_PropManager::findProp(theSection.toStdString(),
theParam.toStdString());
+ if (!aProp)
+ return; // invalid case, the property default value must be registered in XML file
std::string aValue = aVal.toStdString();
if (aValue.empty()) {
aValue = aProp->defaultValue();
<parameter name="part_activation_study" value="0"/>
<parameter name="part_visualization_study" value="0"/>
<parameter name="part_visualization_script" value="1"/>
+ <parameter name="create_init_part" value="true"/>
</section>
<section name="Sketch">
<!-- Sketch preferences -->
<parameter name="part_activation_study" value="0"/>
<parameter name="part_visualization_study" value="0"/>
<parameter name="part_visualization_script" value="1"/>
+ <parameter name="create_init_part" value="true"/>
</section>
<section name="Sketch">
<!-- Sketch preferences -->