diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2021-03-11 15:11:51 +0000 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2021-03-11 15:11:51 +0000 |
commit | acb2e87d9425c8f671d9772409fd291d7fed9aa7 (patch) | |
tree | 363b7239d286e7912ce4337d4036507eec3c643a /indra/llui/lluiusage.cpp | |
parent | e3babd1f8d6d5347f9cf1ec5fee976718e0c6a44 (diff) |
SL-14862 - renamed widgets to the more descriptive controls
Diffstat (limited to 'indra/llui/lluiusage.cpp')
-rw-r--r-- | indra/llui/lluiusage.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/indra/llui/lluiusage.cpp b/indra/llui/lluiusage.cpp index 60c124b711..ccae6643b9 100644 --- a/indra/llui/lluiusage.cpp +++ b/indra/llui/lluiusage.cpp @@ -39,7 +39,7 @@ LLUIUsage::~LLUIUsage() // static std::string LLUIUsage::sanitized(const std::string& s) { - // ViewerStats db doesn't like "." in keys + // Remove characters that make the ViewerStats db unhappy std::string result(s); std::replace(result.begin(), result.end(), '.', '_'); std::replace(result.begin(), result.end(), ' ', '_'); @@ -59,10 +59,11 @@ void LLUIUsage::setLLSDPath(LLSD& sd, const std::string& path, S32 max_elts, con setLLSDNested(sd, last_fields, val); } -// setLLSDNested +// setLLSDNested() // Accomplish the equivalent of // sd[fields[0]][fields[1]]... = val; // for an arbitrary number of fields. +// This might be useful as an LLSD utility function; is not specific to LLUIUsage // // static void LLUIUsage::setLLSDNested(LLSD& sd, const std::vector<std::string>& fields, const LLSD& val) @@ -91,6 +92,13 @@ void LLUIUsage::logCommand(const std::string& command) LL_DEBUGS("UIUsage") << "command " << command << LL_ENDL; } +void LLUIUsage::logControl(const std::string& control) +{ + mControlCounts[sanitized(control)]++; + LL_DEBUGS("UIUsage") << "control " << control << LL_ENDL; +} + + void LLUIUsage::logFloater(const std::string& floater) { mFloaterCounts[sanitized(floater)]++; @@ -103,30 +111,24 @@ void LLUIUsage::logPanel(const std::string& p) LL_DEBUGS("UIUsage") << "panel " << p << LL_ENDL; } -void LLUIUsage::logWidget(const std::string& w) -{ - mWidgetCounts[sanitized(w)]++; - LL_DEBUGS("UIUsage") << "widget " << w << LL_ENDL; -} - LLSD LLUIUsage::asLLSD() const { LLSD result; - for (auto const& it : mFloaterCounts) - { - result["floaters"][it.first] = LLSD::Integer(it.second); - } for (auto const& it : mCommandCounts) { result["commands"][it.first] = LLSD::Integer(it.second); } - for (auto const& it : mPanelCounts) + for (auto const& it : mControlCounts) { - result["panels"][it.first] = LLSD::Integer(it.second); + setLLSDPath(result["controls"], it.first, 2, LLSD::Integer(it.second)); } - for (auto const& it : mWidgetCounts) + for (auto const& it : mFloaterCounts) { - setLLSDPath(result["widgets"], it.first, 2, LLSD::Integer(it.second)); + result["floaters"][it.first] = LLSD::Integer(it.second); + } + for (auto const& it : mPanelCounts) + { + result["panels"][it.first] = LLSD::Integer(it.second); } return result; } @@ -137,8 +139,8 @@ void LLUIUsage::clear() LL_DEBUGS("UIUsage") << "clear" << LL_ENDL; mCommandCounts.clear(); + mControlCounts.clear(); mFloaterCounts.clear(); mPanelCounts.clear(); - mWidgetCounts.clear(); } |