Modified config loading function to always read/write from userPath

There is no need for default (global) settings yet
pull/21/head
Pieter van der Kloet 14 years ago
parent 7747c78584
commit 1fc18075ff

@ -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…
Cancel
Save