Update all QSettings instances to use UTF-8
This commit is contained in:
parent
3e490252be
commit
87fe5c214d
@ -32,6 +32,7 @@ AreaData::AreaData(QString p_name, int p_index) :
|
|||||||
name_split.removeFirst();
|
name_split.removeFirst();
|
||||||
name = name_split.join(":");
|
name = name_split.join(":");
|
||||||
QSettings areas_ini("config/areas.ini", QSettings::IniFormat);
|
QSettings areas_ini("config/areas.ini", QSettings::IniFormat);
|
||||||
|
areas_ini.setIniCodec("UTF-8");
|
||||||
areas_ini.beginGroup(p_name);
|
areas_ini.beginGroup(p_name);
|
||||||
background = areas_ini.value("background", "gs4").toString();
|
background = areas_ini.value("background", "gs4").toString();
|
||||||
is_protected = areas_ini.value("protected_area", "false").toBool();
|
is_protected = areas_ini.value("protected_area", "false").toBool();
|
||||||
@ -44,6 +45,7 @@ AreaData::AreaData(QString p_name, int p_index) :
|
|||||||
showname_allowed = areas_ini.value("shownames_allowed", "true").toBool();
|
showname_allowed = areas_ini.value("shownames_allowed", "true").toBool();
|
||||||
areas_ini.endGroup();
|
areas_ini.endGroup();
|
||||||
QSettings config_ini("config/config.ini", QSettings::IniFormat);
|
QSettings config_ini("config/config.ini", QSettings::IniFormat);
|
||||||
|
config_ini.setIniCodec("UTF-8");
|
||||||
config_ini.beginGroup("Options");
|
config_ini.beginGroup("Options");
|
||||||
int log_size = config_ini.value("logbuffer", 50).toInt();
|
int log_size = config_ini.value("logbuffer", 50).toInt();
|
||||||
log_type = config_ini.value("logger","modcall").toString();
|
log_type = config_ini.value("logger","modcall").toString();
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
bool ConfigManager::initConfig()
|
bool ConfigManager::initConfig()
|
||||||
{
|
{
|
||||||
QSettings config("config/config.ini", QSettings::IniFormat);
|
QSettings config("config/config.ini", QSettings::IniFormat);
|
||||||
|
config.setIniCodec("UTF-8");
|
||||||
QFileInfo config_dir_info("config/");
|
QFileInfo config_dir_info("config/");
|
||||||
if (!config_dir_info.exists() || !config_dir_info.isDir()) {
|
if (!config_dir_info.exists() || !config_dir_info.isDir()) {
|
||||||
qCritical() << "Config directory doesn't exist!";
|
qCritical() << "Config directory doesn't exist!";
|
||||||
@ -39,6 +40,7 @@ bool ConfigManager::initConfig()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QSettings areas_ini("config/areas.ini", QSettings::IniFormat);
|
QSettings areas_ini("config/areas.ini", QSettings::IniFormat);
|
||||||
|
areas_ini.setIniCodec("UTF-8");
|
||||||
if (areas_ini.childGroups().length() < 1) {
|
if (areas_ini.childGroups().length() < 1) {
|
||||||
qCritical() << "areas.ini is invalid!";
|
qCritical() << "areas.ini is invalid!";
|
||||||
return false;
|
return false;
|
||||||
@ -105,6 +107,7 @@ bool ConfigManager::initConfig()
|
|||||||
bool ConfigManager::updateConfig(int current_version)
|
bool ConfigManager::updateConfig(int current_version)
|
||||||
{
|
{
|
||||||
QSettings config("config/config.ini", QSettings::IniFormat);
|
QSettings config("config/config.ini", QSettings::IniFormat);
|
||||||
|
config.setIniCodec("UTF-8");
|
||||||
if (current_version > CONFIG_VERSION) {
|
if (current_version > CONFIG_VERSION) {
|
||||||
// Config version is newer than the latest version, and the config is
|
// Config version is newer than the latest version, and the config is
|
||||||
// invalid This could also mean the server is out of date, and the user
|
// invalid This could also mean the server is out of date, and the user
|
||||||
@ -137,6 +140,7 @@ bool ConfigManager::updateConfig(int current_version)
|
|||||||
bool ConfigManager::loadServerSettings(server_settings* settings)
|
bool ConfigManager::loadServerSettings(server_settings* settings)
|
||||||
{
|
{
|
||||||
QSettings config("config/config.ini", QSettings::IniFormat);
|
QSettings config("config/config.ini", QSettings::IniFormat);
|
||||||
|
config.setIniCodec("UTF-8");
|
||||||
bool port_conversion_success;
|
bool port_conversion_success;
|
||||||
bool ws_port_conversion_success;
|
bool ws_port_conversion_success;
|
||||||
bool local_port_conversion_success;
|
bool local_port_conversion_success;
|
||||||
|
Loading…
Reference in New Issue
Block a user