diff options
| author | Tannin <devnull@localhost> | 2014-11-09 14:01:48 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-11-09 14:01:48 +0100 |
| commit | 1eea3bd90e5e5cc3b05cf9c963533c3630f9ae52 (patch) | |
| tree | a523051c49c33a9b47f955d12c0df5e43564e8df /src/directoryrefresher.cpp | |
| parent | 20db939501958275eb591c7737ffcc3f5f7685bd (diff) | |
- bsa parser will now cancel in case of a read error. Before, when attempting to parse a broken bsa it could take forever and continuously allocate memory
- better error message when bsa parsing fails
- slightly better support for font colors in bbcode converter
- configurator now also uses pyqt5
- bugfix: bsa hashing function converted backslashes to slashes instead of the other way around. hash calculation is still often wrong on folder names...
Diffstat (limited to 'src/directoryrefresher.cpp')
| -rw-r--r-- | src/directoryrefresher.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp index 2186f9a5..24fda501 100644 --- a/src/directoryrefresher.cpp +++ b/src/directoryrefresher.cpp @@ -83,8 +83,12 @@ void DirectoryRefresher::addModBSAToStructure(DirectoryEntry *directoryStructure foreach (const QString &archive, archives) {
QFileInfo fileInfo(archive);
if (m_EnabledArchives.find(fileInfo.fileName()) != m_EnabledArchives.end()) {
- directoryStructure->addFromBSA(ToWString(modName), directoryW,
- ToWString(QDir::toNativeSeparators(fileInfo.absoluteFilePath())), priority);
+ try {
+ directoryStructure->addFromBSA(ToWString(modName), directoryW,
+ ToWString(QDir::toNativeSeparators(fileInfo.absoluteFilePath())), priority);
+ } catch (const std::exception &e) {
+ throw MyException(tr("failed to parse bsa %1: %2").arg(archive, e.what()));
+ }
}
}
}
@@ -143,7 +147,7 @@ void DirectoryRefresher::refresh() try {
addModToStructure(m_DirectoryStructure, iter->modName, i, iter->absolutePath, iter->stealFiles, iter->archives);
} catch (const std::exception &e) {
- emit error(tr("failed to read bsa: %1").arg(e.what()));
+ emit error(tr("failed to read mod (%1): %2").arg(iter->modName, e.what()));
}
emit progress((i * 100) / m_Mods.size() + 1);
}
|
