summaryrefslogtreecommitdiff
path: root/indra/llui/lluicolortable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lluicolortable.cpp')
-rwxr-xr-x[-rw-r--r--]indra/llui/lluicolortable.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 9891e38f7b..244f0c6f00 100644..100755
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -32,6 +32,7 @@
#include "llui.h"
#include "lluicolortable.h"
#include "lluictrlfactory.h"
+#include <boost/foreach.hpp>
LLUIColorTable::ColorParams::ColorParams()
: value("value"),
@@ -56,8 +57,8 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
typedef std::map<std::string, std::string> string_string_map_t;
string_string_map_t unresolved_refs;
- for(LLInitParam::ParamIterator<ColorEntryParams>::const_iterator it = p.color_entries().begin();
- it != p.color_entries().end();
+ for(LLInitParam::ParamIterator<ColorEntryParams>::const_iterator it = p.color_entries.begin();
+ it != p.color_entries.end();
++it)
{
ColorEntryParams color_entry = *it;
@@ -116,7 +117,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
unresolved_refs.erase(iter->second);
}
- llwarns << warning + ending_ref << llendl;
+ LL_WARNS() << warning + ending_ref << LL_ENDL;
break;
}
@@ -155,7 +156,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
iter != visited_refs.end();
++iter)
{
- llwarns << iter->first << " references a non-existent color" << llendl;
+ LL_WARNS() << iter->first << " references a non-existent color" << LL_ENDL;
unresolved_refs.erase(iter->second);
}
@@ -206,13 +207,12 @@ bool LLUIColorTable::loadFromSettings()
{
bool result = false;
- std::string default_filename = gDirUtilp->getExpandedFilename(LL_PATH_DEFAULT_SKIN, "colors.xml");
- result |= loadFromFilename(default_filename, mLoadedColors);
-
- std::string current_filename = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKIN, "colors.xml");
- if(current_filename != default_filename)
+ // pass constraint=LLDir::ALL_SKINS because we want colors.xml from every
+ // skin dir
+ BOOST_FOREACH(std::string colors_path,
+ gDirUtilp->findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS))
{
- result |= loadFromFilename(current_filename, mLoadedColors);
+ result |= loadFromFilename(colors_path, mLoadedColors);
}
std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml");
@@ -237,7 +237,8 @@ void LLUIColorTable::saveUserSettings() const
}
LLXMLNodePtr output_node = new LLXMLNode("colors", false);
- LLXUIParser::instance().writeXUI(output_node, params);
+ LLXUIParser parser;
+ parser.writeXUI(output_node, params);
if(!output_node->isNull())
{
@@ -292,18 +293,19 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_
if(!LLXMLNode::parseFile(filename, root, NULL))
{
- llwarns << "Unable to parse color file " << filename << llendl;
+ LL_WARNS() << "Unable to parse color file " << filename << LL_ENDL;
return false;
}
if(!root->hasName("colors"))
{
- llwarns << filename << " is not a valid color definition file" << llendl;
+ LL_WARNS() << filename << " is not a valid color definition file" << LL_ENDL;
return false;
}
Params params;
- LLXUIParser::instance().readXUI(root, params, filename);
+ LLXUIParser parser;
+ parser.readXUI(root, params, filename);
if(params.validateBlock())
{
@@ -311,7 +313,7 @@ bool LLUIColorTable::loadFromFilename(const std::string& filename, string_color_
}
else
{
- llwarns << filename << " failed to load" << llendl;
+ LL_WARNS() << filename << " failed to load" << LL_ENDL;
return false;
}