diff options
| author | Tannin <devnull@localhost> | 2014-05-31 13:43:48 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-05-31 13:43:48 +0200 |
| commit | 1eb783aae348f906056cee17cb65dfd507429901 (patch) | |
| tree | d9e5b93c1d528a2182416d971b27e49cb524532b /src/shared/directoryentry.cpp | |
| parent | 93a19799b86dd6e12a186e84eb43699b318b214d (diff) | |
- added a new mod type that represents files handled externally (i.e. DLCs) as mods in MO
- hashes of file names in bsa files are no longer checked all the time
- author and description is now read from esp files
- rewrote the code that fixes modlists after a rename, should be a bit more robust
- fixes to qt 5 and msvc 2013 compatibility
- started to update the tutorial (not done yet!)
- bugfix: counter for the problems badge wasn't calculated correctly
Diffstat (limited to 'src/shared/directoryentry.cpp')
| -rw-r--r-- | src/shared/directoryentry.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 6311ba25..b7863284 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -443,10 +443,12 @@ FilesOrigin &DirectoryEntry::createOrigin(const std::wstring &originName, const void DirectoryEntry::addFromOrigin(const std::wstring &originName, const std::wstring &directory, int priority)
{
FilesOrigin &origin = createOrigin(originName, directory, priority);
- boost::scoped_array<wchar_t> buffer(new wchar_t[MAXPATH_UNICODE + 1]);
- memset(buffer.get(), L'\0', MAXPATH_UNICODE + 1);
- int offset = _snwprintf(buffer.get(), MAXPATH_UNICODE, L"%ls", directory.c_str());
- addFiles(origin, buffer.get(), offset);
+ if (directory.length() != 0) {
+ boost::scoped_array<wchar_t> buffer(new wchar_t[MAXPATH_UNICODE + 1]);
+ memset(buffer.get(), L'\0', MAXPATH_UNICODE + 1);
+ int offset = _snwprintf(buffer.get(), MAXPATH_UNICODE, L"%ls", directory.c_str());
+ addFiles(origin, buffer.get(), offset);
+ }
m_Populated = true;
}
@@ -461,7 +463,7 @@ void DirectoryEntry::addFromBSA(const std::wstring &originName, std::wstring &di }
BSA::Archive archive;
- BSA::EErrorCode res = archive.read(ToString(fileName, false).c_str());
+ BSA::EErrorCode res = archive.read(ToString(fileName, false).c_str(), false);
if ((res != BSA::ERROR_NONE) && (res != BSA::ERROR_INVALIDHASHES)) {
std::ostringstream stream;
stream << "invalid bsa file: " << ToString(fileName, false) << " errorcode " << res << " - " << ::GetLastError();
|
