diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-08-12 00:12:25 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-08-12 00:12:34 +0300 |
commit | c748c1369ba04d3b28cc69329b7cea065cdf3b2b (patch) | |
tree | 9b8f2aea1cc79aa01bbd79b3f73fad1ec084f310 /indra/newview/llkeyconflict.cpp | |
parent | ca0730b8362fc528d0141853748393e7820be839 (diff) |
SL-443 Keybindings: Fix some settings not being loaded for editing
Diffstat (limited to 'indra/newview/llkeyconflict.cpp')
-rw-r--r-- | indra/newview/llkeyconflict.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/newview/llkeyconflict.cpp b/indra/newview/llkeyconflict.cpp index 861e3eb42f..83fb1ac7b5 100644 --- a/indra/newview/llkeyconflict.cpp +++ b/indra/newview/llkeyconflict.cpp @@ -428,8 +428,16 @@ void LLKeyConflictHandler::loadFromSettings(ESourceMode load_mode) filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename_default); if (!gDirUtilp->fileExists(filename) || !loadFromSettings(load_mode, filename, &mControlsMap)) { - // mind placeholders - mControlsMap.insert(mDefaultsMap.begin(), mDefaultsMap.end()); + // Mind placeholders + // Do not use mControlsMap.insert(mDefaultsMap) since mControlsMap has + // placeholders that won't be added over(to) by insert. + // Or instead move generatePlaceholders call to be after copying + control_map_t::iterator iter = mDefaultsMap.begin(); + while (iter != mDefaultsMap.end()) + { + mControlsMap[iter->first].mKeyBind = iter->second.mKeyBind; + iter++; + } } } mLoadMode = load_mode; @@ -771,8 +779,16 @@ void LLKeyConflictHandler::resetToDefaultsAndResolve() else { mControlsMap.clear(); - generatePlaceholders(mLoadMode); + + // Set key combinations. + // Copy from mDefaultsMap before doing generatePlaceholders, otherwise + // insert() will fail to add some keys into pre-existing values from + // generatePlaceholders() mControlsMap.insert(mDefaultsMap.begin(), mDefaultsMap.end()); + + // Set conflict masks and mark functions (un)assignable + generatePlaceholders(mLoadMode); + } mHasUnsavedChanges = true; |