mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 08:37:12 +00:00
Gracefully handle content lists that specify duplicate BSAs
Previously, if fed bad data, or a content list predated a BSA being moved to a non-user config file, or possibly in other situations (but not any of the obvious ones as those had other guards), the `selectedArchives` list could be longer than the number of archives available due to duplicate entries. This ensures they're handled like entries specifying no-longer-present archives, and just skips the duplicates. The same would happen elsewhere in similar situations, but those code paths aren't always taken.
This commit is contained in:
parent
cdf7bd74d5
commit
0537b53d21
@ -398,6 +398,9 @@ void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
||||
continue;
|
||||
const auto name = match[0]->text();
|
||||
const auto oldrow = ui.archiveListWidget->row(match[0]);
|
||||
// entries may be duplicated, e.g. if a content list predated a BSA being added to a non-user config file
|
||||
if (oldrow < row)
|
||||
continue;
|
||||
ui.archiveListWidget->takeItem(oldrow);
|
||||
ui.archiveListWidget->insertItem(row, name);
|
||||
ui.archiveListWidget->item(row)->setCheckState(Qt::Checked);
|
||||
|
Loading…
x
Reference in New Issue
Block a user