forked from mirror/openmw-tes3mp
Modified config loading function to always read/write from userPath
There is no need for default (global) settings yet
This commit is contained in:
parent
7747c78584
commit
1fc18075ff
1 changed files with 11 additions and 12 deletions
|
@ -188,21 +188,20 @@ void DataFilesPage::setupDataFiles()
|
|||
|
||||
void DataFilesPage::setupConfig()
|
||||
{
|
||||
QFile config("launcher.cfg");
|
||||
QString config = "launcher.cfg";
|
||||
QFile file(config);
|
||||
|
||||
if (config.exists())
|
||||
{
|
||||
qDebug() << "Using config file from current directory";
|
||||
mLauncherConfig = new QSettings("launcher.cfg", QSettings::IniFormat);
|
||||
} else {
|
||||
QString path = QString::fromStdString(Files::getPath(Files::Path_ConfigGlobal,
|
||||
"openmw",
|
||||
"launcher.cfg"));
|
||||
qDebug() << "Using global config file from " << path;
|
||||
mLauncherConfig = new QSettings(path, QSettings::IniFormat);
|
||||
if (!file.exists()) {
|
||||
config = QString::fromStdString(Files::getPath(Files::Path_ConfigUser,
|
||||
"openmw", "launcher.cfg"));
|
||||
}
|
||||
|
||||
config.close();
|
||||
file.setFileName(config); // Just for displaying information
|
||||
qDebug() << "Using config file from " << file.fileName();
|
||||
file.close();
|
||||
|
||||
// Open our config file
|
||||
mLauncherConfig = new QSettings(config, QSettings::IniFormat);
|
||||
|
||||
mLauncherConfig->beginGroup("Profiles");
|
||||
QStringList profiles = mLauncherConfig->childGroups();
|
||||
|
|
Loading…
Reference in a new issue