Merge pull request #82 from flowln/i_broke_something_again
This commit is contained in:
commit
2ebaf46095
@ -23,14 +23,16 @@ INISettingsObject::INISettingsObject(QStringList paths, QObject *parent)
|
|||||||
: SettingsObject(parent)
|
: SettingsObject(parent)
|
||||||
{
|
{
|
||||||
auto first_path = paths.constFirst();
|
auto first_path = paths.constFirst();
|
||||||
auto path = paths.takeFirst();
|
for (auto path : paths) {
|
||||||
while (!QFile::exists(path))
|
if (!QFile::exists(path))
|
||||||
path = paths.takeFirst();
|
continue;
|
||||||
|
|
||||||
if (path != first_path && QFile::exists(path)) {
|
if (path != first_path && QFile::exists(path)) {
|
||||||
// Copy the fallback to the preferred path.
|
// Copy the fallback to the preferred path.
|
||||||
QFile::copy(path, first_path);
|
QFile::copy(path, first_path);
|
||||||
qDebug() << "Copied settings from" << path << "to" << first_path;
|
qDebug() << "Copied settings from" << path << "to" << first_path;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_filePath = first_path;
|
m_filePath = first_path;
|
||||||
|
Loading…
Reference in New Issue
Block a user