diff options
author | Richard Linden <none@none> | 2010-06-22 18:26:29 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2010-06-22 18:26:29 -0700 |
commit | 6e961cd9f244bc979f653c8ee468617c280d0e9e (patch) | |
tree | 4966af8a139289d4db632f4f3549d740758accb8 /indra/llui/llui.cpp | |
parent | 7a54ce3cf686d872425c3230b305156b83a36b26 (diff) |
EXT-7729 WIP LLWARNS: Tons of "Making dummy class..." warnings on startup
improved filename output for XUI parser errors
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 |