From 226993eecee22e3cb39fc30aedfef587cc58330c Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 1 Dec 2014 18:44:37 +0100 Subject: - added error handling when a file can't be deleted from vfs - minor bugfixes --- src/shared/directoryentry.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/shared/directoryentry.h') diff --git a/src/shared/directoryentry.h b/src/shared/directoryentry.h index d588ab02..c06a49a1 100644 --- a/src/shared/directoryentry.h +++ b/src/shared/directoryentry.h @@ -184,7 +184,7 @@ public: size_t size() const { return m_Files.size(); } - void removeFile(FileEntry::Index index); + bool removeFile(FileEntry::Index index); void removeOrigin(FileEntry::Index index, int originID); void removeOriginMulti(std::set indices, int originID, time_t notAfter); @@ -263,7 +263,7 @@ public: void removeFile(FileEntry::Index index); // remove the specified file from the tree. This can be a path leading to a file in a subdirectory - void removeFile(const std::wstring &filePath, int *origin = NULL); + bool removeFile(const std::wstring &filePath, int *origin = NULL); /** * @brief remove the specified directory @@ -271,7 +271,7 @@ public: */ void removeDir(const std::wstring &path); - void remove(const std::wstring &fileName, int *origin) { + bool remove(const std::wstring &fileName, int *origin) { auto iter = m_Files.find(ToLower(fileName)); if (iter != m_Files.end()) { if (origin != NULL) { @@ -281,7 +281,9 @@ public: *origin = entry->getOrigin(ignore); } } - m_FileRegister->removeFile(iter->second); + return m_FileRegister->removeFile(iter->second); + } else { + return false; } } -- cgit v1.3.1