Merge viewer-neko
commit
6d6a2dcd17
|
|
@ -51,6 +51,7 @@
|
|||
|
||||
// File constants
|
||||
static const int MAX_HDR_LEN = 20;
|
||||
static const S32 UNZIP_LLSD_MAX_DEPTH = 96;
|
||||
static const char LEGACY_NON_HEADER[] = "<llsd>";
|
||||
const std::string LLSD_BINARY_HEADER("LLSD/Binary");
|
||||
const std::string LLSD_XML_HEADER("LLSD/XML");
|
||||
|
|
@ -317,11 +318,11 @@ LLSDParser::LLSDParser()
|
|||
LLSDParser::~LLSDParser()
|
||||
{ }
|
||||
|
||||
S32 LLSDParser::parse(std::istream& istr, LLSD& data, S32 max_bytes)
|
||||
S32 LLSDParser::parse(std::istream& istr, LLSD& data, S32 max_bytes, S32 max_depth)
|
||||
{
|
||||
mCheckLimits = (LLSDSerialize::SIZE_UNLIMITED == max_bytes) ? false : true;
|
||||
mMaxBytesLeft = max_bytes;
|
||||
return doParse(istr, data);
|
||||
return doParse(istr, data, max_depth);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -403,7 +404,7 @@ LLSDNotationParser::~LLSDNotationParser()
|
|||
{ }
|
||||
|
||||
// virtual
|
||||
S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
|
||||
S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) const
|
||||
{
|
||||
// map: { string:object, string:object }
|
||||
// array: [ object, object, object ]
|
||||
|
|
@ -418,6 +419,10 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
|
|||
// binary: b##"ff3120ab1" | b(size)"raw data"
|
||||
char c;
|
||||
c = istr.peek();
|
||||
if (max_depth == 0)
|
||||
{
|
||||
return PARSE_FAILURE;
|
||||
}
|
||||
while(isspace(c))
|
||||
{
|
||||
// pop the whitespace.
|
||||
|
|
@ -434,7 +439,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
|
|||
{
|
||||
case '{':
|
||||
{
|
||||
S32 child_count = parseMap(istr, data);
|
||||
S32 child_count = parseMap(istr, data, max_depth - 1);
|
||||
if((child_count == PARSE_FAILURE) || data.isUndefined())
|
||||
{
|
||||
parse_count = PARSE_FAILURE;
|
||||
|
|
@ -453,7 +458,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
|
|||
|
||||
case '[':
|
||||
{
|
||||
S32 child_count = parseArray(istr, data);
|
||||
S32 child_count = parseArray(istr, data, max_depth - 1);
|
||||
if((child_count == PARSE_FAILURE) || data.isUndefined())
|
||||
{
|
||||
parse_count = PARSE_FAILURE;
|
||||
|
|
@ -658,7 +663,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data) const
|
|||
return parse_count;
|
||||
}
|
||||
|
||||
S32 LLSDNotationParser::parseMap(std::istream& istr, LLSD& map) const
|
||||
S32 LLSDNotationParser::parseMap(std::istream& istr, LLSD& map, S32 max_depth) const
|
||||
{
|
||||
// map: { string:object, string:object }
|
||||
map = LLSD::emptyMap();
|
||||
|
|
@ -693,7 +698,7 @@ S32 LLSDNotationParser::parseMap(std::istream& istr, LLSD& map) const
|
|||
}
|
||||
putback(istr, c);
|
||||
LLSD child;
|
||||
S32 count = doParse(istr, child);
|
||||
S32 count = doParse(istr, child, max_depth);
|
||||
if(count > 0)
|
||||
{
|
||||
// There must be a value for every key, thus
|
||||
|
|
@ -718,7 +723,7 @@ S32 LLSDNotationParser::parseMap(std::istream& istr, LLSD& map) const
|
|||
return parse_count;
|
||||
}
|
||||
|
||||
S32 LLSDNotationParser::parseArray(std::istream& istr, LLSD& array) const
|
||||
S32 LLSDNotationParser::parseArray(std::istream& istr, LLSD& array, S32 max_depth) const
|
||||
{
|
||||
// array: [ object, object, object ]
|
||||
array = LLSD::emptyArray();
|
||||
|
|
@ -737,7 +742,7 @@ S32 LLSDNotationParser::parseArray(std::istream& istr, LLSD& array) const
|
|||
continue;
|
||||
}
|
||||
putback(istr, c);
|
||||
S32 count = doParse(istr, child);
|
||||
S32 count = doParse(istr, child, max_depth);
|
||||
if(PARSE_FAILURE == count)
|
||||
{
|
||||
return PARSE_FAILURE;
|
||||
|
|
@ -869,7 +874,7 @@ LLSDBinaryParser::~LLSDBinaryParser()
|
|||
}
|
||||
|
||||
// virtual
|
||||
S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
|
||||
S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) const
|
||||
{
|
||||
/**
|
||||
* Undefined: '!'<br>
|
||||
|
|
@ -893,12 +898,16 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
if (max_depth == 0)
|
||||
{
|
||||
return PARSE_FAILURE;
|
||||
}
|
||||
S32 parse_count = 1;
|
||||
switch(c)
|
||||
{
|
||||
case '{':
|
||||
{
|
||||
S32 child_count = parseMap(istr, data);
|
||||
S32 child_count = parseMap(istr, data, max_depth - 1);
|
||||
if((child_count == PARSE_FAILURE) || data.isUndefined())
|
||||
{
|
||||
parse_count = PARSE_FAILURE;
|
||||
|
|
@ -917,7 +926,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
|
|||
|
||||
case '[':
|
||||
{
|
||||
S32 child_count = parseArray(istr, data);
|
||||
S32 child_count = parseArray(istr, data, max_depth - 1);
|
||||
if((child_count == PARSE_FAILURE) || data.isUndefined())
|
||||
{
|
||||
parse_count = PARSE_FAILURE;
|
||||
|
|
@ -1098,7 +1107,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
|
|||
return parse_count;
|
||||
}
|
||||
|
||||
S32 LLSDBinaryParser::parseMap(std::istream& istr, LLSD& map) const
|
||||
S32 LLSDBinaryParser::parseMap(std::istream& istr, LLSD& map, S32 max_depth) const
|
||||
{
|
||||
map = LLSD::emptyMap();
|
||||
U32 value_nbo = 0;
|
||||
|
|
@ -1128,7 +1137,7 @@ S32 LLSDBinaryParser::parseMap(std::istream& istr, LLSD& map) const
|
|||
}
|
||||
}
|
||||
LLSD child;
|
||||
S32 child_count = doParse(istr, child);
|
||||
S32 child_count = doParse(istr, child, max_depth);
|
||||
if(child_count > 0)
|
||||
{
|
||||
// There must be a value for every key, thus child_count
|
||||
|
|
@ -1152,7 +1161,7 @@ S32 LLSDBinaryParser::parseMap(std::istream& istr, LLSD& map) const
|
|||
return parse_count;
|
||||
}
|
||||
|
||||
S32 LLSDBinaryParser::parseArray(std::istream& istr, LLSD& array) const
|
||||
S32 LLSDBinaryParser::parseArray(std::istream& istr, LLSD& array, S32 max_depth) const
|
||||
{
|
||||
array = LLSD::emptyArray();
|
||||
U32 value_nbo = 0;
|
||||
|
|
@ -1168,7 +1177,7 @@ S32 LLSDBinaryParser::parseArray(std::istream& istr, LLSD& array) const
|
|||
while((c != ']') && (count < size) && istr.good())
|
||||
{
|
||||
LLSD child;
|
||||
S32 child_count = doParse(istr, child);
|
||||
S32 child_count = doParse(istr, child, max_depth);
|
||||
if(PARSE_FAILURE == child_count)
|
||||
{
|
||||
return PARSE_FAILURE;
|
||||
|
|
@ -2257,7 +2266,7 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is,
|
|||
return ZR_MEM_ERROR;
|
||||
}
|
||||
|
||||
if (!LLSDSerialize::fromBinary(data, istr, cur_size))
|
||||
if (!LLSDSerialize::fromBinary(data, istr, cur_size, UNZIP_LLSD_MAX_DEPTH))
|
||||
{
|
||||
// free(result);
|
||||
if( result )
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public:
|
|||
* @return Returns the number of LLSD objects parsed into
|
||||
* data. Returns PARSE_FAILURE (-1) on parse failure.
|
||||
*/
|
||||
S32 parse(std::istream& istr, LLSD& data, S32 max_bytes);
|
||||
S32 parse(std::istream& istr, LLSD& data, S32 max_bytes, S32 max_depth = -1);
|
||||
|
||||
/** Like parse(), but uses a different call (istream.getline()) to read by lines
|
||||
* This API is better suited for XML, where the parse cannot tell
|
||||
|
|
@ -103,10 +103,12 @@ protected:
|
|||
* caller.
|
||||
* @param istr The input stream.
|
||||
* @param data[out] The newly parse structured data.
|
||||
* @param max_depth Max depth parser will check before exiting
|
||||
* with parse error, -1 - unlimited.
|
||||
* @return Returns the number of LLSD objects parsed into
|
||||
* data. Returns PARSE_FAILURE (-1) on parse failure.
|
||||
*/
|
||||
virtual S32 doParse(std::istream& istr, LLSD& data) const = 0;
|
||||
virtual S32 doParse(std::istream& istr, LLSD& data, S32 max_depth = -1) const = 0;
|
||||
|
||||
/**
|
||||
* @brief Virtual default function for resetting the parser
|
||||
|
|
@ -241,10 +243,12 @@ protected:
|
|||
* caller.
|
||||
* @param istr The input stream.
|
||||
* @param data[out] The newly parse structured data. Undefined on failure.
|
||||
* @param max_depth Max depth parser will check before exiting
|
||||
* with parse error, -1 - unlimited.
|
||||
* @return Returns the number of LLSD objects parsed into
|
||||
* data. Returns PARSE_FAILURE (-1) on parse failure.
|
||||
*/
|
||||
virtual S32 doParse(std::istream& istr, LLSD& data) const;
|
||||
virtual S32 doParse(std::istream& istr, LLSD& data, S32 max_depth = -1) const;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
|
@ -252,18 +256,20 @@ private:
|
|||
*
|
||||
* @param istr The input stream.
|
||||
* @param map The map to add the parsed data.
|
||||
* @param max_depth Allowed parsing depth.
|
||||
* @return Returns The number of LLSD objects parsed into data.
|
||||
*/
|
||||
S32 parseMap(std::istream& istr, LLSD& map) const;
|
||||
S32 parseMap(std::istream& istr, LLSD& map, S32 max_depth) const;
|
||||
|
||||
/**
|
||||
* @brief Parse an array from the istream.
|
||||
*
|
||||
* @param istr The input stream.
|
||||
* @param array The array to append the parsed data.
|
||||
* @param max_depth Allowed parsing depth.
|
||||
* @return Returns The number of LLSD objects parsed into data.
|
||||
*/
|
||||
S32 parseArray(std::istream& istr, LLSD& array) const;
|
||||
S32 parseArray(std::istream& istr, LLSD& array, S32 max_depth) const;
|
||||
|
||||
/**
|
||||
* @brief Parse a string from the istream and assign it to data.
|
||||
|
|
@ -314,10 +320,12 @@ protected:
|
|||
* caller.
|
||||
* @param istr The input stream.
|
||||
* @param data[out] The newly parse structured data.
|
||||
* @param max_depth Max depth parser will check before exiting
|
||||
* with parse error, -1 - unlimited.
|
||||
* @return Returns the number of LLSD objects parsed into
|
||||
* data. Returns PARSE_FAILURE (-1) on parse failure.
|
||||
*/
|
||||
virtual S32 doParse(std::istream& istr, LLSD& data) const;
|
||||
virtual S32 doParse(std::istream& istr, LLSD& data, S32 max_depth = -1) const;
|
||||
|
||||
/**
|
||||
* @brief Virtual default function for resetting the parser
|
||||
|
|
@ -362,10 +370,12 @@ protected:
|
|||
* caller.
|
||||
* @param istr The input stream.
|
||||
* @param data[out] The newly parse structured data.
|
||||
* @param max_depth Max depth parser will check before exiting
|
||||
* with parse error, -1 - unlimited.
|
||||
* @return Returns the number of LLSD objects parsed into
|
||||
* data. Returns -1 on parse failure.
|
||||
*/
|
||||
virtual S32 doParse(std::istream& istr, LLSD& data) const;
|
||||
virtual S32 doParse(std::istream& istr, LLSD& data, S32 max_depth = -1) const;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
|
@ -373,18 +383,20 @@ private:
|
|||
*
|
||||
* @param istr The input stream.
|
||||
* @param map The map to add the parsed data.
|
||||
* @param max_depth Allowed parsing depth.
|
||||
* @return Returns The number of LLSD objects parsed into data.
|
||||
*/
|
||||
S32 parseMap(std::istream& istr, LLSD& map) const;
|
||||
S32 parseMap(std::istream& istr, LLSD& map, S32 max_depth) const;
|
||||
|
||||
/**
|
||||
* @brief Parse an array from the istream.
|
||||
*
|
||||
* @param istr The input stream.
|
||||
* @param array The array to append the parsed data.
|
||||
* @param max_depth Allowed parsing depth.
|
||||
* @return Returns The number of LLSD objects parsed into data.
|
||||
*/
|
||||
S32 parseArray(std::istream& istr, LLSD& array) const;
|
||||
S32 parseArray(std::istream& istr, LLSD& array, S32 max_depth) const;
|
||||
|
||||
/**
|
||||
* @brief Parse a string from the istream and assign it to data.
|
||||
|
|
@ -800,16 +812,16 @@ public:
|
|||
LLPointer<LLSDBinaryFormatter> f = new LLSDBinaryFormatter;
|
||||
return f->format(sd, str, LLSDFormatter::OPTIONS_NONE);
|
||||
}
|
||||
static S32 fromBinary(LLSD& sd, std::istream& str, S32 max_bytes)
|
||||
static S32 fromBinary(LLSD& sd, std::istream& str, S32 max_bytes, S32 max_depth = -1)
|
||||
{
|
||||
LLPointer<LLSDBinaryParser> p = new LLSDBinaryParser;
|
||||
return p->parse(str, sd, max_bytes);
|
||||
return p->parse(str, sd, max_bytes, max_depth);
|
||||
}
|
||||
static LLSD fromBinary(std::istream& str, S32 max_bytes)
|
||||
static LLSD fromBinary(std::istream& str, S32 max_bytes, S32 max_depth = -1)
|
||||
{
|
||||
LLPointer<LLSDBinaryParser> p = new LLSDBinaryParser;
|
||||
LLSD sd;
|
||||
(void)p->parse(str, sd, max_bytes);
|
||||
(void)p->parse(str, sd, max_bytes, max_depth);
|
||||
return sd;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -952,7 +952,7 @@ void LLSDXMLParser::parsePart(const char *buf, int len)
|
|||
}
|
||||
|
||||
// virtual
|
||||
S32 LLSDXMLParser::doParse(std::istream& input, LLSD& data) const
|
||||
S32 LLSDXMLParser::doParse(std::istream& input, LLSD& data, S32 max_depth) const
|
||||
{
|
||||
#ifdef XML_PARSER_PERFORMANCE_TESTS
|
||||
XML_Timer timer( &parseTime );
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include <map>
|
||||
|
||||
LLTrans::template_map_t LLTrans::sStringTemplates;
|
||||
LLTrans::template_map_t LLTrans::sDefaultStringTemplates;
|
||||
LLStringUtil::format_map_t LLTrans::sDefaultArgs;
|
||||
|
||||
struct StringDef : public LLInitParam::Block<StringDef>
|
||||
|
|
@ -76,7 +77,7 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set<std::string>& defa
|
|||
LL_ERRS() << "Problem reading strings: " << xml_filename << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool default_strings_init = false;
|
||||
sStringTemplates.clear();
|
||||
sDefaultArgs.clear();
|
||||
|
||||
|
|
@ -86,7 +87,10 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set<std::string>& defa
|
|||
{
|
||||
LLTransTemplate xml_template(it->name, it->value);
|
||||
sStringTemplates[xml_template.mName] = xml_template;
|
||||
|
||||
if (!default_strings_init)
|
||||
{
|
||||
sDefaultStringTemplates[xml_template.mName] = xml_template;
|
||||
}
|
||||
std::set<std::string>::const_iterator iter = default_args.find(xml_template.mName);
|
||||
if (iter != default_args.end())
|
||||
{
|
||||
|
|
@ -96,6 +100,7 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set<std::string>& defa
|
|||
sDefaultArgs[name] = xml_template.mText;
|
||||
}
|
||||
}
|
||||
default_strings_init = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -138,12 +143,17 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root)
|
|||
static LLTrace::BlockTimerStatHandle FTM_GET_TRANS("Translate string");
|
||||
|
||||
//static
|
||||
std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args)
|
||||
std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args, bool def_string)
|
||||
{
|
||||
// Don't care about time as much as call count. Make sure we're not
|
||||
// calling LLTrans::getString() in an inner loop. JC
|
||||
LL_RECORD_BLOCK_TIME(FTM_GET_TRANS);
|
||||
|
||||
if (def_string)
|
||||
{
|
||||
return getDefString(xml_desc, msg_args);
|
||||
}
|
||||
|
||||
template_map_t::iterator iter = sStringTemplates.find(xml_desc);
|
||||
if (iter != sStringTemplates.end())
|
||||
{
|
||||
|
|
@ -161,13 +171,38 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::
|
|||
}
|
||||
}
|
||||
|
||||
//static
|
||||
std::string LLTrans::getDefString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args)
|
||||
{
|
||||
template_map_t::iterator iter = sDefaultStringTemplates.find(xml_desc);
|
||||
if (iter != sDefaultStringTemplates.end())
|
||||
{
|
||||
std::string text = iter->second.mText;
|
||||
LLStringUtil::format_map_t args = sDefaultArgs;
|
||||
args.insert(msg_args.begin(), msg_args.end());
|
||||
LLStringUtil::format(text, args);
|
||||
|
||||
return text;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL;
|
||||
return "MissingString(" + xml_desc + ")";
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args)
|
||||
std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args, bool def_string)
|
||||
{
|
||||
// Don't care about time as much as call count. Make sure we're not
|
||||
// calling LLTrans::getString() in an inner loop. JC
|
||||
LL_RECORD_BLOCK_TIME(FTM_GET_TRANS);
|
||||
|
||||
if (def_string)
|
||||
{
|
||||
return getDefString(xml_desc, msg_args);
|
||||
}
|
||||
|
||||
template_map_t::iterator iter = sStringTemplates.find(xml_desc);
|
||||
if (iter != sStringTemplates.end())
|
||||
{
|
||||
|
|
@ -182,6 +217,23 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args
|
|||
}
|
||||
}
|
||||
|
||||
//static
|
||||
std::string LLTrans::getDefString(const std::string &xml_desc, const LLSD& msg_args)
|
||||
{
|
||||
template_map_t::iterator iter = sDefaultStringTemplates.find(xml_desc);
|
||||
if (iter != sDefaultStringTemplates.end())
|
||||
{
|
||||
std::string text = iter->second.mText;
|
||||
LLStringUtil::format(text, msg_args);
|
||||
return text;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL;
|
||||
return "MissingString(" + xml_desc + ")";
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -76,8 +76,10 @@ public:
|
|||
* @param args A list of substrings to replace in the string
|
||||
* @returns Translated string
|
||||
*/
|
||||
static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args);
|
||||
static std::string getString(const std::string &xml_desc, const LLSD& args);
|
||||
static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false);
|
||||
static std::string getDefString(const std::string &xml_desc, const LLStringUtil::format_map_t& args);
|
||||
static std::string getString(const std::string &xml_desc, const LLSD& args, bool def_string = false);
|
||||
static std::string getDefString(const std::string &xml_desc, const LLSD& args);
|
||||
static bool findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& args);
|
||||
static bool findString(std::string &result, const std::string &xml_desc, const LLSD& args);
|
||||
|
||||
|
|
@ -92,7 +94,7 @@ public:
|
|||
* @param xml_desc String's description
|
||||
* @returns Translated string
|
||||
*/
|
||||
static std::string getString(const std::string &xml_desc)
|
||||
static std::string getString(const std::string &xml_desc, bool def_string = false)
|
||||
{
|
||||
LLStringUtil::format_map_t empty;
|
||||
return getString(xml_desc, empty);
|
||||
|
|
@ -128,6 +130,7 @@ public:
|
|||
private:
|
||||
typedef std::map<std::string, LLTransTemplate > template_map_t;
|
||||
static template_map_t sStringTemplates;
|
||||
static template_map_t sDefaultStringTemplates;
|
||||
static LLStringUtil::format_map_t sDefaultArgs;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3914,7 +3914,7 @@ LLSD LLAppViewer::getViewerInfo() const
|
|||
return info;
|
||||
}
|
||||
|
||||
std::string LLAppViewer::getViewerInfoString() const
|
||||
std::string LLAppViewer::getViewerInfoString(bool default_string) const
|
||||
{
|
||||
std::ostringstream support;
|
||||
|
||||
|
|
@ -3924,7 +3924,7 @@ std::string LLAppViewer::getViewerInfoString() const
|
|||
LLStringUtil::format_map_t args;
|
||||
|
||||
// allow the "Release Notes" URL label to be localized
|
||||
args["ReleaseNotes"] = LLTrans::getString("ReleaseNotes");
|
||||
args["ReleaseNotes"] = LLTrans::getString("ReleaseNotes", default_string);
|
||||
|
||||
for (LLSD::map_const_iterator ii(info.beginMap()), iend(info.endMap());
|
||||
ii != iend; ++ii)
|
||||
|
|
@ -3934,7 +3934,7 @@ std::string LLAppViewer::getViewerInfoString() const
|
|||
// Scalar value
|
||||
if (ii->second.isUndefined())
|
||||
{
|
||||
args[ii->first] = LLTrans::getString("none_text");
|
||||
args[ii->first] = LLTrans::getString("none_text", default_string);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -3953,110 +3953,46 @@ std::string LLAppViewer::getViewerInfoString() const
|
|||
}
|
||||
|
||||
// Now build the various pieces
|
||||
support << LLTrans::getString("AboutHeader", args);
|
||||
support << LLTrans::getString("AboutHeader", args, default_string);
|
||||
//if (info.has("BUILD_CONFIG"))
|
||||
//{
|
||||
// support << "\n" << LLTrans::getString("BuildConfig", args);
|
||||
// support << "\n" << LLTrans::getString("BuildConfig", args, default_string);
|
||||
//}
|
||||
if (info.has("REGION"))
|
||||
{
|
||||
// [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10)
|
||||
support << "\n\n" << LLTrans::getString( (RlvActions::canShowLocation()) ? "AboutPosition" : "AboutPositionRLVShowLoc", args);
|
||||
support << "\n\n" << LLTrans::getString( (RlvActions::canShowLocation()) ? "AboutPosition" : "AboutPositionRLVShowLoc", args, default_string);
|
||||
// [/RLVa:KB]
|
||||
// support << "\n\n" << LLTrans::getString("AboutPosition", args);
|
||||
// support << "\n\n" << LLTrans::getString("AboutPosition", args, default_string);
|
||||
}
|
||||
support << "\n\n" << LLTrans::getString("AboutSystem", args);
|
||||
support << "\n\n" << LLTrans::getString("AboutSystem", args, default_string);
|
||||
support << "\n";
|
||||
if (info.has("GRAPHICS_DRIVER_VERSION"))
|
||||
{
|
||||
support << "\n" << LLTrans::getString("AboutDriver", args);
|
||||
support << "\n" << LLTrans::getString("AboutDriver", args, default_string);
|
||||
}
|
||||
support << "\n" << LLTrans::getString("AboutOGL", args);
|
||||
//support << "\n\n" << LLTrans::getString("AboutSettings", args); // <FS> Custom sysinfo
|
||||
support << "\n\n" << LLTrans::getString("AboutLibs", args);
|
||||
support << "\n" << LLTrans::getString("AboutOGL", args, default_string);
|
||||
//support << "\n\n" << LLTrans::getString("AboutSettings", args, default_string); // <FS> Custom sysinfo
|
||||
support << "\n\n" << LLTrans::getString("AboutLibs", args, default_string);
|
||||
// <FS> Custom sysinfo
|
||||
if (info.has("BANDWIDTH")) //For added info in help floater
|
||||
{
|
||||
support << "\n" << LLTrans::getString("AboutSettings", args);
|
||||
support << "\n" << LLTrans::getString("AboutSettings", args, default_string);
|
||||
}
|
||||
// </FS>
|
||||
if (info.has("COMPILER"))
|
||||
{
|
||||
support << "\n" << LLTrans::getString("AboutCompiler", args);
|
||||
support << "\n" << LLTrans::getString("AboutCompiler", args, default_string);
|
||||
}
|
||||
if (info.has("PACKETS_IN"))
|
||||
{
|
||||
support << '\n' << LLTrans::getString("AboutTraffic", args);
|
||||
support << '\n' << LLTrans::getString("AboutTraffic", args, default_string);
|
||||
}
|
||||
|
||||
// SLT timestamp
|
||||
LLSD substitution;
|
||||
substitution["datetime"] = (S32)time(NULL);//(S32)time_corrected();
|
||||
support << "\n" << LLTrans::getString("AboutTime", substitution);
|
||||
|
||||
return support.str();
|
||||
}
|
||||
|
||||
std::string LLAppViewer::getShortViewerInfoString() const
|
||||
{
|
||||
std::ostringstream support;
|
||||
LLSD info(getViewerInfo());
|
||||
|
||||
support << info["CHANNEL"].asString() << " ";
|
||||
support << info["VIEWER_VERSION_STR"].asString() << " (" << info["ADDRESS_SIZE"].asString() << "bit)";
|
||||
if (info.has("BUILD_CONFIG"))
|
||||
{
|
||||
support << "\n" << "Build Configuration " << info["BUILD_CONFIG"].asString();
|
||||
}
|
||||
if (info.has("REGION"))
|
||||
{
|
||||
support << "\n\n" << "You are at " << ll_vector3_from_sd(info["POSITION_LOCAL"]) << " in " << info["REGION"].asString();
|
||||
support << " located at " << info["HOSTNAME"].asString() << " (" << info["HOSTIP"].asString() << ")";
|
||||
support << "\n" << "SLURL: " << info["SLURL"].asString();
|
||||
support << "\n" << "(Global coordinates " << ll_vector3_from_sd(info["POSITION"]) << ")";
|
||||
support << "\n" << info["SERVER_VERSION"].asString();
|
||||
}
|
||||
|
||||
support << "\n\n" << "CPU: " << info["CPU"].asString();
|
||||
support << "\n" << "Memory: " << info["MEMORY_MB"].asString() << " MB";
|
||||
support << "\n" << "OS: " << info["OS_VERSION"].asString();
|
||||
support << "\n" << "Graphics Card: " << info["GRAPHICS_CARD"].asString() << " (" << info["GRAPHICS_CARD_VENDOR"].asString() << ")";
|
||||
|
||||
if (info.has("GRAPHICS_DRIVER_VERSION"))
|
||||
{
|
||||
support << "\n" << "Windows Graphics Driver Version: " << info["GRAPHICS_DRIVER_VERSION"].asString();
|
||||
}
|
||||
|
||||
support << "\n" << "OpenGL Version: " << info["OPENGL_VERSION"].asString();
|
||||
|
||||
support << "\n\n" << "Window size:" << info["WINDOW_WIDTH"].asString() << "x" << info["WINDOW_HEIGHT"].asString();
|
||||
support << "\n" << "Language: " << LLUI::getLanguage();
|
||||
support << "\n" << "Font Size Adjustment: " << info["FONT_SIZE_ADJUSTMENT"].asString() << "pt";
|
||||
support << "\n" << "UI Scaling: " << info["UI_SCALE"].asString();
|
||||
support << "\n" << "Draw distance: " << info["DRAW_DISTANCE"].asString();
|
||||
support << "\n" << "Bandwidth: " << info["NET_BANDWITH"].asString() << "kbit/s";
|
||||
support << "\n" << "LOD factor: " << info["LOD_FACTOR"].asString();
|
||||
support << "\n" << "Render quality: " << info["RENDER_QUALITY"].asString() << " / 7";
|
||||
support << "\n" << "ALM: " << info["GPU_SHADERS"].asString();
|
||||
support << "\n" << "Texture memory: " << info["TEXTURE_MEMORY"].asString() << "MB";
|
||||
support << "\n" << "VFS (cache) creation time: " << info["VFS_TIME"].asString();
|
||||
|
||||
support << "\n\n" << "J2C Decoder: " << info["J2C_VERSION"].asString();
|
||||
support << "\n" << "Audio Driver: " << info["AUDIO_DRIVER_VERSION"].asString();
|
||||
support << "\n" << "LLCEFLib/CEF: " << info["LLCEFLIB_VERSION"].asString();
|
||||
support << "\n" << "LibVLC: " << info["LIBVLC_VERSION"].asString();
|
||||
support << "\n" << "Voice Server: " << info["VOICE_VERSION"].asString();
|
||||
|
||||
if (info.has("PACKETS_IN"))
|
||||
{
|
||||
support << "\n" << "Packets Lost: " << info["PACKETS_LOST"].asInteger() << "/" << info["PACKETS_IN"].asInteger();
|
||||
F32 packets_pct = info["PACKETS_PCT"].asReal();
|
||||
support << " (" << ll_round(packets_pct, 0.001f) << "%)";
|
||||
}
|
||||
|
||||
LLSD substitution;
|
||||
substitution["datetime"] = (S32)time(NULL);
|
||||
support << "\n" << LLTrans::getString("AboutTime", substitution);
|
||||
support << "\n" << LLTrans::getString("AboutTime", substitution, default_string);
|
||||
|
||||
return support.str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,8 +99,7 @@ public:
|
|||
|
||||
void setServerReleaseNotesURL(const std::string& url) { mServerReleaseNotesURL = url; }
|
||||
LLSD getViewerInfo() const;
|
||||
std::string getViewerInfoString() const;
|
||||
std::string getShortViewerInfoString() const;
|
||||
std::string getViewerInfoString(bool default_string = false) const;
|
||||
|
||||
// Report true if under the control of a debugger. A null-op default.
|
||||
virtual bool beingDebugged() { return false; }
|
||||
|
|
|
|||
|
|
@ -10149,7 +10149,7 @@ void handle_report_bug(const LLSD& param)
|
|||
|
||||
LLStringUtil::format_map_t replace;
|
||||
// <FS:Ansariel> FIRE-14001: JIRA report is being cut off when using Help -> Report Bug
|
||||
//replace["[ENVIRONMENT]"] = LLURI::escape(LLAppViewer::instance()->getShortViewerInfoString());
|
||||
//replace["[ENVIRONMENT]"] = LLURI::escape(LLAppViewer::instance()->getViewerInfoString(true));
|
||||
LLSD sysinfo = FSData::getSystemInfo();
|
||||
replace["[ENVIRONMENT]"] = LLURI::escape(sysinfo["Part1"].asString().substr(1) + sysinfo["Part2"].asString().substr(1));
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
Loading…
Reference in New Issue