Fix crash on startup and restore missing settings

master
Mnikolenko Productengine 2019-10-29 13:27:21 +02:00
parent a97f13e161
commit 915587de45
2 changed files with 32 additions and 9 deletions

View File

@ -16299,6 +16299,28 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>CameraOpacity</key>
<map>
<key>Comment</key>
<string>Opacity of the Camera Controls floater</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>PresetCameraActive</key>
<map>
<key>Comment</key>
<string>Name of currently selected preference</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string />
</map>
<key>CefVerboseLog</key>
<map>
<key>Comment</key>

View File

@ -262,8 +262,6 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n
}
else if(PRESETS_CAMERA == subdirectory)
{
gSavedSettings.setString("PresetGraphicActive", name);
name_list.clear();
getControlNames(name_list);
name_list.push_back("PresetCameraActive");
@ -292,14 +290,17 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n
{
std::string ctrl_name = *it;
LLControlVariable* ctrl = gSavedSettings.getControl(ctrl_name).get();
std::string comment = ctrl->getComment();
std::string type = LLControlGroup::typeEnumToString(ctrl->type());
LLSD value = ctrl->getValue();
if (ctrl)
{
std::string comment = ctrl->getComment();
std::string type = LLControlGroup::typeEnumToString(ctrl->type());
LLSD value = ctrl->getValue();
paramsData[ctrl_name]["Comment"] = comment;
paramsData[ctrl_name]["Persist"] = 1;
paramsData[ctrl_name]["Type"] = type;
paramsData[ctrl_name]["Value"] = value;
paramsData[ctrl_name]["Comment"] = comment;
paramsData[ctrl_name]["Persist"] = 1;
paramsData[ctrl_name]["Type"] = type;
paramsData[ctrl_name]["Value"] = value;
}
}
}