summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-06-14 21:19:55 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-10-22 00:00:54 +0300
commit8d64a0da52ef8636194533f2cff09ecc9649ad45 (patch)
tree28c9a4aabc52d80517f39c402035ac8d56fd43e9 /indra/newview
parent1b5d151c156f0528e58c02b494d4b515ea9cb11c (diff)
SL-15383 Crash at SearchableControl's setHighlighted
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterpreference.cpp43
-rw-r--r--indra/newview/llfloaterpreference.h2
2 files changed, 38 insertions, 7 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 6bf2136f60..1c4fdc433b 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -263,7 +263,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mGotPersonalInfo(false),
mOriginalIMViaEmail(false),
mLanguageChanged(false),
- mAvatarDataInitialized(false)
+ mAvatarDataInitialized(false),
+ mSearchDataDirty(true)
{
LLConversationLog::instance().addObserver(this);
@@ -2150,6 +2151,11 @@ void LLFloaterPreference::updateClickActionViews()
getChild<LLComboBox>("double_click_action_combo")->setValue(dbl_click_to_teleport ? 2 : (int)dbl_click_to_walk);
}
+void LLFloaterPreference::updateSearchableItems()
+{
+ mSearchDataDirty = true;
+}
+
void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
{
LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
@@ -2906,10 +2912,19 @@ void LLPanelPreferenceControls::populateControlTable()
filename = "control_table_contents_columns_basic.xml";
break;
default:
- // Either unknown mode or MODE_SAVED_SETTINGS
- // It doesn't have UI or actual settings yet
- LL_INFOS() << "Unimplemented mode" << LL_ENDL;
- return;
+ {
+ // Either unknown mode or MODE_SAVED_SETTINGS
+ // It doesn't have UI or actual settings yet
+ LL_WARNS() << "Unimplemented mode" << LL_ENDL;
+
+ // Searchable columns were removed, mark searchables for an update
+ LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
+ if (instance)
+ {
+ instance->updateSearchableItems();
+ }
+ return;
+ }
}
addControlTableColumns(filename);
@@ -2940,8 +2955,15 @@ void LLPanelPreferenceControls::populateControlTable()
}
else
{
- LL_INFOS() << "Unimplemented mode" << LL_ENDL;
- return;
+ LL_WARNS() << "Unimplemented mode" << LL_ENDL;
+ }
+
+ // Searchable columns were removed and readded, mark searchables for an update
+ // Note: at the moment tables/lists lack proper llsearchableui support
+ LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
+ if (instance)
+ {
+ instance->updateSearchableItems();
}
}
@@ -3559,6 +3581,12 @@ void LLFloaterPreference::onUpdateFilterTerm(bool force)
if( !mSearchData || (mSearchData->mLastFilter == seachValue && !force))
return;
+ if (mSearchDataDirty)
+ {
+ // Data exists, but is obsolete, regenerate
+ collectSearchableItems();
+ }
+
mSearchData->mLastFilter = seachValue;
if( !mSearchData->mRootTab )
@@ -3656,4 +3684,5 @@ void LLFloaterPreference::collectSearchableItems()
collectChildren( this, ll::prefs::PanelDataPtr(), pRootTabcontainer );
}
+ mSearchDataDirty = false;
}
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 1268935712..e9e19e9acb 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -108,6 +108,7 @@ public:
void getControlNames(std::vector<std::string>& names);
// updates click/double-click action controls depending on values from settings.xml
void updateClickActionViews();
+ void updateSearchableItems();
protected:
void onBtnOK(const LLSD& userdata);
@@ -220,6 +221,7 @@ private:
LLSearchEditor *mFilterEdit;
std::unique_ptr< ll::prefs::SearchData > mSearchData;
+ bool mSearchDataDirty;
void onUpdateFilterTerm( bool force = false );
void collectSearchableItems();