diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-06-24 19:37:35 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-06-24 19:37:35 -0400 |
commit | c77efc92e3ebcb9af9bb997e5b709484153844d4 (patch) | |
tree | 57f58946a62b16dc623d7469d59bef19f514d574 /indra/llui/llui.cpp | |
parent | 9f835b9bce6ac023a9f8b98cfb53015f5d416130 (diff) | |
parent | c6b80b47459711cc4c0b1971cb954ad6148517a0 (diff) |
automated merge
Diffstat (limited to 'indra/llui/llui.cpp')
-rw-r--r-- | indra/llui/llui.cpp | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index bf12384a28..dff1cb93e7 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1752,6 +1752,33 @@ std::string LLUI::getLanguage() return language; } +struct SubDir : public LLInitParam::Block<SubDir> +{ + Mandatory<std::string> value; + + SubDir() + : value("value") + {} +}; + +struct Directory : public LLInitParam::Block<Directory> +{ + Multiple<SubDir, AtLeast<1> > subdirs; + + Directory() + : subdirs("subdir") + {} +}; + +struct Paths : public LLInitParam::Block<Paths> +{ + Multiple<Directory, AtLeast<1> > directories; + + Paths() + : directories("directory") + {} +}; + //static void LLUI::setupPaths() { @@ -1759,21 +1786,36 @@ void LLUI::setupPaths() LLXMLNodePtr root; BOOL success = LLXMLNode::parseFile(filename, root, NULL); + Paths paths; + LLXUIParser::instance().readXUI(root, paths, filename); + sXUIPaths.clear(); - if (success) + if (success && paths.validateBlock()) { LLStringUtil::format_map_t path_args; path_args["[LANGUAGE]"] = LLUI::getLanguage(); - for (LLXMLNodePtr path = root->getFirstChild(); path.notNull(); path = path->getNextSibling()) + for (LLInitParam::ParamIterator<Directory>::const_iterator it = paths.directories().begin(), + end_it = paths.directories().end(); + it != end_it; + ++it) { - std::string path_val_ui(path->getValue()); + std::string path_val_ui; + for (LLInitParam::ParamIterator<SubDir>::const_iterator subdir_it = it->subdirs().begin(), + subdir_end_it = it->subdirs().end(); + subdir_it != subdir_end_it;) + { + path_val_ui += subdir_it->value(); + if (++subdir_it != subdir_end_it) + path_val_ui += gDirUtilp->getDirDelimiter(); + } LLStringUtil::format(path_val_ui, path_args); if (std::find(sXUIPaths.begin(), sXUIPaths.end(), path_val_ui) == sXUIPaths.end()) { sXUIPaths.push_back(path_val_ui); } + } } else // parsing failed |