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