Manager: Use UTF-8 when reading/writing INI files
This commit is contained in:
@@ -33,6 +33,7 @@ VMManagerConfig::VMManagerConfig(const ConfigType type, const QString& section)
|
|||||||
config_type = type;
|
config_type = type;
|
||||||
|
|
||||||
settings = new QSettings(configFile, QSettings::IniFormat, this);
|
settings = new QSettings(configFile, QSettings::IniFormat, this);
|
||||||
|
settings->setIniCodec("UTF-8");
|
||||||
settings->setFallbacksEnabled(false);
|
settings->setFallbacksEnabled(false);
|
||||||
if(type == ConfigType::System && !section.isEmpty()) {
|
if(type == ConfigType::System && !section.isEmpty()) {
|
||||||
settings->beginGroup(section);
|
settings->beginGroup(section);
|
||||||
|
|||||||
@@ -234,6 +234,7 @@ VMManagerSystem::loadSettings()
|
|||||||
}
|
}
|
||||||
// qInfo() << "Loaded "<< config_file.filePath() << "status:" << settings.status();
|
// qInfo() << "Loaded "<< config_file.filePath() << "status:" << settings.status();
|
||||||
|
|
||||||
|
settings.setIniCodec("UTF-8");
|
||||||
// Clear out the config hash in case the config is reloaded
|
// Clear out the config hash in case the config is reloaded
|
||||||
for (const auto &outer_key : config_hash.keys()) {
|
for (const auto &outer_key : config_hash.keys()) {
|
||||||
config_hash[outer_key].clear();
|
config_hash[outer_key].clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user