diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2019-11-15 14:16:12 +0200 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2019-11-15 14:16:12 +0200 |
commit | 3824624ab1df4eb8809ec31965f251cda74c8d23 (patch) | |
tree | ae74dafa0a8168393771cdffe93207539f4ab69e /indra | |
parent | f21da58f05d70c44d810323a533f8b11c8fafb5e (diff) |
SL-12186 Correctly populate list after creating default presets
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpresetsmanager.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llpresetsmanager.h | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 4f25e93ebd..88b24265e3 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -91,9 +91,14 @@ void LLPresetsManager::createMissingDefault(const std::string& subdirectory) void LLPresetsManager::createCameraDefaultPresets() { - createDefaultCameraPreset(PRESETS_REAR_VIEW); - createDefaultCameraPreset(PRESETS_FRONT_VIEW); - createDefaultCameraPreset(PRESETS_SIDE_VIEW); + bool is_default_created = createDefaultCameraPreset(PRESETS_REAR_VIEW); + is_default_created |= createDefaultCameraPreset(PRESETS_FRONT_VIEW); + is_default_created |= createDefaultCameraPreset(PRESETS_SIDE_VIEW); + + if (is_default_created) + { + triggerChangeCameraSignal(); + } } void LLPresetsManager::startWatching(const std::string& subdirectory) @@ -558,7 +563,7 @@ void LLPresetsManager::resetCameraPreset(std::string preset_name) } } -void LLPresetsManager::createDefaultCameraPreset(std::string preset_name, bool force_reset) +bool LLPresetsManager::createDefaultCameraPreset(std::string preset_name, bool force_reset) { std::string preset_file = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, PRESETS_CAMERA, LLURI::escape(preset_name) + ".xml"); @@ -567,8 +572,9 @@ void LLPresetsManager::createDefaultCameraPreset(std::string preset_name, bool f std::string template_name = preset_name.substr(0, preset_name.size() - PRESETS_VIEW_SUFFIX.size()); std::string default_template_file = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, PRESETS_CAMERA, template_name + ".xml"); - LLFile::copy(default_template_file, preset_file); + return LLFile::copy(default_template_file, preset_file); } + return false; } boost::signals2::connection LLPresetsManager::setPresetListChangeCameraCallback(const preset_list_signal_t::slot_type& cb) diff --git a/indra/newview/llpresetsmanager.h b/indra/newview/llpresetsmanager.h index 09010413a9..d9ca178dd7 100644 --- a/indra/newview/llpresetsmanager.h +++ b/indra/newview/llpresetsmanager.h @@ -80,7 +80,7 @@ public: bool isTemplateCameraPreset(std::string preset_name); bool isDefaultCameraPreset(std::string preset_name); void resetCameraPreset(std::string preset_name); - void createDefaultCameraPreset(std::string preset_name, bool force_reset = false); + bool createDefaultCameraPreset(std::string preset_name, bool force_reset = false); // Emitted when a preset gets loaded, deleted, or saved. boost::signals2::connection setPresetListChangeCameraCallback(const preset_list_signal_t::slot_type& cb); |