mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 13:09:40 +00:00
Read profile files from LauncherSettings in load order.
This commit is contained in:
parent
ad5d884761
commit
a62e15d93d
2 changed files with 16 additions and 6 deletions
|
@ -94,20 +94,28 @@ bool Launcher::DataFilesPage::loadSettings()
|
||||||
if (!currentProfile.isEmpty())
|
if (!currentProfile.isEmpty())
|
||||||
addProfile(currentProfile, true);
|
addProfile(currentProfile, true);
|
||||||
|
|
||||||
QStringList files = mLauncherSettings.values(QString("Profiles/") + currentProfile + QString("/content"), Qt::MatchExactly);
|
mSelector->setProfileContent(filesInProfile(currentProfile, pathIterator));
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList Launcher::DataFilesPage::filesInProfile(const QString& profileName, PathIterator& pathIterator)
|
||||||
|
{
|
||||||
|
QStringList files = mLauncherSettings.values(QString("Profiles/") + profileName + QString("/content"), Qt::MatchExactly);
|
||||||
QStringList filepaths;
|
QStringList filepaths;
|
||||||
|
|
||||||
foreach (const QString &file, files)
|
// mLauncherSettings.values() returns the files in reverse load order
|
||||||
|
QListIterator<QString> i(files);
|
||||||
|
i.toBack();
|
||||||
|
while (i.hasPrevious())
|
||||||
{
|
{
|
||||||
QString filepath = pathIterator.findFirstPath (file);
|
QString filepath = pathIterator.findFirstPath(i.previous());
|
||||||
|
|
||||||
if (!filepath.isEmpty())
|
if (!filepath.isEmpty())
|
||||||
filepaths << filepath;
|
filepaths << filepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
mSelector->setProfileContent (filepaths);
|
return filepaths;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::DataFilesPage::saveSettings(const QString &profile)
|
void Launcher::DataFilesPage::saveSettings(const QString &profile)
|
||||||
|
|
|
@ -134,6 +134,8 @@ namespace Launcher
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QStringList filesInProfile(const QString& profileName, PathIterator& pathIterator);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue