removed settings file mixup

loadfix
Marc Zinnschlag 10 years ago
parent c94c1adaf3
commit e27da6a0d4

@ -35,15 +35,11 @@ CSMSettings::UserSettings *CSMSettings::UserSettings::mUserSettingsInstance = 0;
CSMSettings::UserSettings::UserSettings (const Files::ConfigurationManager& configurationManager)
: mCfgMgr (configurationManager)
, mSettingDefinitions(NULL)
, mSettingCfgDefinitions(NULL)
{
assert(!mUserSettingsInstance);
mUserSettingsInstance = this;
buildSettingModelDefaults();
// for overriding opencs.ini settings with those from settings.cfg
mSettingCfgDefinitions = new QSettings(QSettings::IniFormat, QSettings::UserScope, "", QString(), this);
}
void CSMSettings::UserSettings::buildSettingModelDefaults()
@ -351,10 +347,6 @@ void CSMSettings::UserSettings::loadSettings (const QString &fileName)
mSettingDefinitions = new QSettings
(QSettings::IniFormat, QSettings::UserScope, "opencs", QString(), this);
// check if override entry exists (default: disabled)
if(!mSettingDefinitions->childGroups().contains("Video", Qt::CaseInsensitive))
mSettingDefinitions->setValue("Video/use settings.cfg", "false");
}
// if the key is not found create one with a defaut value
@ -391,23 +383,10 @@ QString CSMSettings::UserSettings::settingValue (const QString &settingKey)
{
QStringList defs;
// check if video settings are overriden
if(settingKey.contains(QRegExp("^Video\\b", Qt::CaseInsensitive)) &&
mSettingDefinitions->value("Video/use settings.cfg") == "true" &&
settingKey.contains(QRegExp("^Video/\\brender|antialiasing|vsync|fullscreen\\b", Qt::CaseInsensitive)))
{
if (!mSettingCfgDefinitions->contains (settingKey))
return QString();
else
defs = mSettingCfgDefinitions->value (settingKey).toStringList();
}
else
{
if (!mSettingDefinitions->contains (settingKey))
return QString();
if (!mSettingDefinitions->contains (settingKey))
return QString();
defs = mSettingDefinitions->value (settingKey).toStringList();
}
defs = mSettingDefinitions->value (settingKey).toStringList();
if (defs.isEmpty())
return QString();

@ -36,7 +36,6 @@ namespace CSMSettings {
const Files::ConfigurationManager& mCfgMgr;
QSettings *mSettingDefinitions;
QSettings *mSettingCfgDefinitions;
QList <Setting *> mSettings;
QString mSection;
std::map<QString, QString> mSectionLabels;

Loading…
Cancel
Save