aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/maildir/format/kmailMaildirFormat.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2009-12-08 10:03:34 +0000
committerVincent Richard <[email protected]>2009-12-08 10:03:34 +0000
commita3bf37fb4f758469b7b68ad7dcca170913fcd912 (patch)
tree9004b6aca2e4e749212f959011417d52f21c5cb9 /src/net/maildir/format/kmailMaildirFormat.cpp
parentInitialize multi-threading for GNUTLS/GCrypt (thanks to Bartek Szurgot). (diff)
downloadvmime-a3bf37fb4f758469b7b68ad7dcca170913fcd912.tar.gz
vmime-a3bf37fb4f758469b7b68ad7dcca170913fcd912.zip
Fixed not exception-safe constructor, which could lead to possible memory leak (thanks to Bartek Szurgot). Get rid of const-ness on factories.
Diffstat (limited to 'src/net/maildir/format/kmailMaildirFormat.cpp')
-rw-r--r--src/net/maildir/format/kmailMaildirFormat.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/maildir/format/kmailMaildirFormat.cpp b/src/net/maildir/format/kmailMaildirFormat.cpp
index 5fb75feb..a21d1061 100644
--- a/src/net/maildir/format/kmailMaildirFormat.cpp
+++ b/src/net/maildir/format/kmailMaildirFormat.cpp
@@ -49,7 +49,7 @@ const string kmailMaildirFormat::getName() const
void kmailMaildirFormat::createFolder(const folder::path& path)
{
- utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+ ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
if (!fsf->isValidPath(folderPathToFileSystemPath(path, ROOT_DIRECTORY)))
throw exceptions::invalid_folder_name();
@@ -75,7 +75,7 @@ void kmailMaildirFormat::createFolder(const folder::path& path)
void kmailMaildirFormat::destroyFolder(const folder::path& path)
{
// Delete 'folder' and '.folder.directory' directories
- utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+ ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
maildirUtils::recursiveFSDelete(fsf->create
(folderPathToFileSystemPath(path, ROOT_DIRECTORY))); // root
@@ -87,7 +87,7 @@ void kmailMaildirFormat::destroyFolder(const folder::path& path)
bool kmailMaildirFormat::folderExists(const folder::path& path) const
{
- utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+ ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
ref <utility::file> rootDir = fsf->create
(folderPathToFileSystemPath(path, ROOT_DIRECTORY));
@@ -177,7 +177,7 @@ const std::vector <folder::path> kmailMaildirFormat::listFolders
void kmailMaildirFormat::listFoldersImpl
(std::vector <folder::path>& list, const folder::path& root, const bool recursive) const
{
- utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+ ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
ref <utility::file> rootDir = fsf->create(folderPathToFileSystemPath(root,
root.isEmpty() ? ROOT_DIRECTORY : CONTAINER_DIRECTORY));
@@ -226,7 +226,7 @@ bool kmailMaildirFormat::isSubfolderDirectory(const utility::file& file)
void kmailMaildirFormat::renameFolder(const folder::path& oldPath, const folder::path& newPath)
{
- utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+ ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
ref <utility::file> rootDir = fsf->create
(folderPathToFileSystemPath(oldPath, ROOT_DIRECTORY));
@@ -277,7 +277,7 @@ void kmailMaildirFormat::renameFolder(const folder::path& oldPath, const folder:
bool kmailMaildirFormat::folderHasSubfolders(const folder::path& path) const
{
- utility::fileSystemFactory* fsf = platform::getHandler()->getFileSystemFactory();
+ ref <utility::fileSystemFactory> fsf = platform::getHandler()->getFileSystemFactory();
ref <utility::file> rootDir = fsf->create
(folderPathToFileSystemPath(path, CONTAINER_DIRECTORY));