fixed: Config::Text() returned a reference to a local variable (std::string)
added: 'static' directory with *.css and images we have a default layout moved: locale from data to templates notification templates have its own locale object added: reload function reloades locale now too added: 'nice' form of item_info in templates git-svn-id: svn://ttmath.org/publicrep/winix/trunk@582 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -91,6 +91,7 @@ bool Config::ReadConfig(bool errors_to_stdout_)
|
||||
|
||||
|
||||
|
||||
|
||||
void Config::AssignValues()
|
||||
{
|
||||
data.log_file = Text("log_file");
|
||||
@@ -151,36 +152,34 @@ void Config::AssignValues()
|
||||
data.locale_dir = Text("locale_dir");
|
||||
data.locale_dir_default = Text("locale_dir_default");
|
||||
|
||||
Locale::Lang lang = Locale::StrToLang(data.locale_str);
|
||||
data.title_separator = Text("title_separator", " / ");
|
||||
|
||||
if( lang != Locale::lang_unknown )
|
||||
data.locale.SetLang(lang);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const std::string & Config::Text(const char * name)
|
||||
std::string Config::Text(const char * name)
|
||||
{
|
||||
return Text(std::string(name), default_str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const std::string & Config::Text(const char * name, const char * def)
|
||||
std::string Config::Text(const char * name, const char * def)
|
||||
{
|
||||
return Text(std::string(name), std::string(def));
|
||||
}
|
||||
|
||||
|
||||
const std::string & Config::Text(const std::string & name, const std::string & def)
|
||||
std::string Config::Text(const std::string & name, const std::string & def)
|
||||
{
|
||||
ConfParser::Table::iterator i = conf_parser.table.find(name);
|
||||
|
||||
if( i == conf_parser.table.end() )
|
||||
return def;
|
||||
|
||||
return i->second;
|
||||
|
||||
return i->second;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user