Skip to content

Commit

Permalink
Merge 3a95a3b into fb4cf0b
Browse files Browse the repository at this point in the history
  • Loading branch information
flowln committed Oct 18, 2022
2 parents fb4cf0b + 3a95a3b commit 7f951a0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions launcher/settings/INISettingsObject.cpp
Expand Up @@ -23,14 +23,16 @@ INISettingsObject::INISettingsObject(QStringList paths, QObject *parent)
: SettingsObject(parent)
{
auto first_path = paths.constFirst();
auto path = paths.takeFirst();
while (!QFile::exists(path))
path = paths.takeFirst();
for (auto path : paths) {
if (!QFile::exists(path))
continue;

if (path != first_path && QFile::exists(path)) {
// Copy the fallback to the preferred path.
QFile::copy(path, first_path);
qDebug() << "Copied settings from" << path << "to" << first_path;
if (path != first_path && QFile::exists(path)) {
// Copy the fallback to the preferred path.
QFile::copy(path, first_path);
qDebug() << "Copied settings from" << path << "to" << first_path;
break;
}
}

m_filePath = first_path;
Expand Down

0 comments on commit 7f951a0

Please sign in to comment.