From 9cc0510b4efe800bb5a2188001746d44979c494a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Aug 2020 16:06:29 +0100 Subject: SL-13834 - add preferences info to ViewerStats, only when exiting and different from default --- indra/llxml/llcontrol.cpp | 18 ++++++++++++++++++ indra/llxml/llcontrol.h | 2 ++ 2 files changed, 20 insertions(+) (limited to 'indra/llxml') diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 80a414d00f..00a6c08ba4 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -641,6 +641,24 @@ LLSD LLControlGroup::getLLSD(const std::string& name) return get(name); } +LLSD LLControlGroup::asLLSD(bool diffs_only) +{ + // Dump all stored values as LLSD + LLSD result = LLSD::emptyArray(); + for (ctrl_name_table_t::iterator iter = mNameTable.begin(); + iter != mNameTable.end(); iter++) + { + LLControlVariable *control = iter->second; + if (!control || (diffs_only && control->isDefault())) + { + continue; + } + const std::string& name = iter->first; + result[name] = getLLSD(name); + } + return result; +} + BOOL LLControlGroup::controlExists(const std::string& name) { ctrl_name_table_t::iterator iter = mNameTable.find(name); diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 99946607f4..19508becc3 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -242,6 +242,8 @@ public: LLColor4 getColor4(const std::string& name); LLColor3 getColor3(const std::string& name); + LLSD asLLSD(bool diffs_only); + // generic getter template T get(const std::string& name) { -- cgit v1.2.3 From d556a8a9741c367d8592cedbd2d8ef2255370a4c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 31 Aug 2020 20:51:40 +0100 Subject: SL-13834 - omit string-type controls from preference logs --- indra/llxml/llcontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llxml') diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 00a6c08ba4..ead8634df4 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -649,7 +649,7 @@ LLSD LLControlGroup::asLLSD(bool diffs_only) iter != mNameTable.end(); iter++) { LLControlVariable *control = iter->second; - if (!control || (diffs_only && control->isDefault())) + if (!control || control->isType(TYPE_STRING) || (diffs_only && control->isDefault())) { continue; } -- cgit v1.2.3