|
|
|
@ -27,16 +27,16 @@ namespace boost
|
|
|
|
|
#endif /* (BOOST_VERSION <= 104600) */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Launcher::GameSettings::GameSettings(Files::ConfigurationManager &cfg)
|
|
|
|
|
Config::GameSettings::GameSettings(Files::ConfigurationManager &cfg)
|
|
|
|
|
: mCfgMgr(cfg)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Launcher::GameSettings::~GameSettings()
|
|
|
|
|
Config::GameSettings::~GameSettings()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Launcher::GameSettings::validatePaths()
|
|
|
|
|
void Config::GameSettings::validatePaths()
|
|
|
|
|
{
|
|
|
|
|
if (mSettings.isEmpty() || !mDataDirs.isEmpty())
|
|
|
|
|
return; // Don't re-validate paths if they are already parsed
|
|
|
|
@ -82,14 +82,14 @@ void Launcher::GameSettings::validatePaths()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList Launcher::GameSettings::values(const QString &key, const QStringList &defaultValues)
|
|
|
|
|
QStringList Config::GameSettings::values(const QString &key, const QStringList &defaultValues)
|
|
|
|
|
{
|
|
|
|
|
if (!mSettings.values(key).isEmpty())
|
|
|
|
|
return mSettings.values(key);
|
|
|
|
|
return defaultValues;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Launcher::GameSettings::readFile(QTextStream &stream)
|
|
|
|
|
bool Config::GameSettings::readFile(QTextStream &stream)
|
|
|
|
|
{
|
|
|
|
|
QMap<QString, QString> cache;
|
|
|
|
|
QRegExp keyRe("^([^=]+)\\s*=\\s*(.+)$");
|
|
|
|
@ -131,7 +131,7 @@ bool Launcher::GameSettings::readFile(QTextStream &stream)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Launcher::GameSettings::writeFile(QTextStream &stream)
|
|
|
|
|
bool Config::GameSettings::writeFile(QTextStream &stream)
|
|
|
|
|
{
|
|
|
|
|
// Iterate in reverse order to preserve insertion order
|
|
|
|
|
QMapIterator<QString, QString> i(mSettings);
|
|
|
|
@ -170,7 +170,7 @@ bool Launcher::GameSettings::writeFile(QTextStream &stream)
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Launcher::GameSettings::hasMaster()
|
|
|
|
|
bool Config::GameSettings::hasMaster()
|
|
|
|
|
{
|
|
|
|
|
bool result = false;
|
|
|
|
|
QStringList content = mSettings.values(QString("content"));
|