diff options
| author | Tannin <devnull@localhost> | 2014-09-29 20:35:35 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-09-29 20:35:35 +0200 |
| commit | bfa6c9ab1e2f316c53811de6e311212b8a088591 (patch) | |
| tree | 1903fb7b8758ebacaa91497561ea5277d13f8d2b /src/shared | |
| parent | 7a7c464b18f2977c3a7aa7e80c4041732b19ba26 (diff) | |
- moved the hook-recursion-protection to tls
- some code cleanup and consolidation
- hook.dll will now report all of its own exceptions
- some more logging during startup
- changed the way urls are encoded for download requests
- now displaying (one of the) process name(s) while waiting for a program to end
- bugfix: spawned processes were forced to leave the job
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/directoryentry.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 24868a93..0adf0812 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -72,8 +72,7 @@ public: }
bool exists(const std::wstring &name) {
- std::map<std::wstring, int>::iterator iter = m_OriginsNameMap.find(name);
- return iter != m_OriginsNameMap.end();
+ return m_OriginsNameMap.find(name) != m_OriginsNameMap.end();
}
FilesOrigin &getByID(Index ID) {
@@ -369,16 +368,14 @@ std::wstring FileEntry::getFullPath() const bool ignore = false;
result = m_Parent->getOriginByID(getOrigin(ignore)).getPath(); //base directory for origin
recurseParents(result, m_Parent); // all intermediate directories
- result.append(L"\\").append(m_Name); // the actual filename
- return result;
+ return result + L"\\" + m_Name;
}
std::wstring FileEntry::getRelativePath() const
{
std::wstring result;
recurseParents(result, m_Parent); // all intermediate directories
- result.append(L"\\").append(m_Name); // the actual filename
- return result;
+ return result + L"\\" + m_Name;
}
@@ -446,6 +443,7 @@ void DirectoryEntry::addFromOrigin(const std::wstring &originName, const std::ws 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());
+ buffer.get()[offset] = L'\0';
addFiles(origin, buffer.get(), offset);
}
m_Populated = true;
|
