1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 05:59:16 +00:00

Fix locale related oversights

This commit is contained in:
fgenesis 2012-07-11 04:50:19 +02:00
parent 459a41e1f6
commit 345ff6063b
3 changed files with 61 additions and 64 deletions

View file

@ -49,14 +49,12 @@ void UserSettings::save()
}
xml_system.InsertEndChild(xml_debugLog);
if (!system.isSystemLocale) {
TiXmlElement xml_locale("Locale");
{
xml_locale.SetAttribute("name", system.locale);
}
xml_system.InsertEndChild(xml_locale);
}
}
doc.InsertEndChild(xml_system);
TiXmlElement xml_audio("Audio");

View file

@ -77,9 +77,8 @@ class UserSettings
public:
struct System
{
System() { debugLogOn = 0; isSystemLocale = false; }
System() { debugLogOn = 0; }
int debugLogOn;
bool isSystemLocale;
std::string locale;
} system;

View file

@ -20,7 +20,7 @@
static std::string _CFToStdString(CFStringRef cs)
{
char buf[1024];
CFStringGetCString(cs, &buf[0], 2048, kCFStringEncodingUTF8);
CFStringGetCString(cs, &buf[0], 1024, kCFStringEncodingUTF8);
return &buf[0];
}
#endif
@ -93,8 +93,8 @@ std::string getSystemLocale()
if ((buf = (CFStringRef)CFLocaleGetValue(locale, kCFLocaleCountryCode)) != NULL)
{
system.locale += "_";
system.locale += _CFToStdString(buf);
localeStr += "_";
localeStr += _CFToStdString(buf);
CFRelease(buf);
}
}
@ -108,7 +108,7 @@ std::string getSystemLocale()
{
localeStr = lang;
size_t found = system.locale.find('.');
size_t found = localeStr.find('.');
if (found != string::npos)
localeStr.resize(found);