Made missing data files dialog less scary and added exception handling for esmreader

pull/21/head
Pieter van der Kloet 13 years ago
parent b46a2bfa01
commit 0b517d15c1

@ -222,7 +222,7 @@ void DataFilesPage::setupDataFiles()
QMessageBox msgBox;
msgBox.setWindowTitle("Error detecting Morrowind installation");
msgBox.setIcon(QMessageBox::Critical);
msgBox.setIcon(QMessageBox::Warning);
msgBox.setStandardButtons(QMessageBox::Cancel);
msgBox.setText(tr("<br><b>Could not find the Data Files location</b><br><br> \
The directory containing the Data Files was not found.<br><br> \
@ -279,6 +279,8 @@ void DataFilesPage::setupDataFiles()
const Files::MultiDirCollection &esp = fileCollections.getCollection(".esp");
for (Files::MultiDirCollection::TIter iter(esp.begin()); iter!=esp.end(); ++iter) {
try {
ESMReader fileReader;
QStringList availableMasters; // Will contain all found masters
@ -346,6 +348,11 @@ void DataFilesPage::setupDataFiles()
currentItem->appendRow(child);
}
}
} catch(std::runtime_error &e) {
// An error occurred while reading the .esp
continue;
}
}
readConfig();

Loading…
Cancel
Save