forked from mirror/openmw-tes3mp
removed settings file mixup
This commit is contained in:
parent
c94c1adaf3
commit
e27da6a0d4
2 changed files with 3 additions and 25 deletions
|
@ -35,15 +35,11 @@ CSMSettings::UserSettings *CSMSettings::UserSettings::mUserSettingsInstance = 0;
|
||||||
CSMSettings::UserSettings::UserSettings (const Files::ConfigurationManager& configurationManager)
|
CSMSettings::UserSettings::UserSettings (const Files::ConfigurationManager& configurationManager)
|
||||||
: mCfgMgr (configurationManager)
|
: mCfgMgr (configurationManager)
|
||||||
, mSettingDefinitions(NULL)
|
, mSettingDefinitions(NULL)
|
||||||
, mSettingCfgDefinitions(NULL)
|
|
||||||
{
|
{
|
||||||
assert(!mUserSettingsInstance);
|
assert(!mUserSettingsInstance);
|
||||||
mUserSettingsInstance = this;
|
mUserSettingsInstance = this;
|
||||||
|
|
||||||
buildSettingModelDefaults();
|
buildSettingModelDefaults();
|
||||||
|
|
||||||
// for overriding opencs.ini settings with those from settings.cfg
|
|
||||||
mSettingCfgDefinitions = new QSettings(QSettings::IniFormat, QSettings::UserScope, "", QString(), this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSMSettings::UserSettings::buildSettingModelDefaults()
|
void CSMSettings::UserSettings::buildSettingModelDefaults()
|
||||||
|
@ -351,10 +347,6 @@ void CSMSettings::UserSettings::loadSettings (const QString &fileName)
|
||||||
|
|
||||||
mSettingDefinitions = new QSettings
|
mSettingDefinitions = new QSettings
|
||||||
(QSettings::IniFormat, QSettings::UserScope, "opencs", QString(), this);
|
(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
|
// 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;
|
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))
|
if (!mSettingDefinitions->contains (settingKey))
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
defs = mSettingDefinitions->value (settingKey).toStringList();
|
defs = mSettingDefinitions->value (settingKey).toStringList();
|
||||||
}
|
|
||||||
|
|
||||||
if (defs.isEmpty())
|
if (defs.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
|
@ -36,7 +36,6 @@ namespace CSMSettings {
|
||||||
const Files::ConfigurationManager& mCfgMgr;
|
const Files::ConfigurationManager& mCfgMgr;
|
||||||
|
|
||||||
QSettings *mSettingDefinitions;
|
QSettings *mSettingDefinitions;
|
||||||
QSettings *mSettingCfgDefinitions;
|
|
||||||
QList <Setting *> mSettings;
|
QList <Setting *> mSettings;
|
||||||
QString mSection;
|
QString mSection;
|
||||||
std::map<QString, QString> mSectionLabels;
|
std::map<QString, QString> mSectionLabels;
|
||||||
|
|
Loading…
Reference in a new issue