From 0a3c63f76eade4f4655342e4c99d8fea07cf2836 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 6 Jan 2011 03:20:24 +0000 Subject: [PATCH] Monotone-Parent: 63e89008bf0aa0171f79d7bf4570993b929c7c0d Monotone-Revision: abbedeb3c6a9b4649d47fc35a90f1a0d3fe244c5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-01-06T03:20:24 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ OpenChange/SOGoMAPIFSFolder.h | 1 + OpenChange/SOGoMAPIFSFolder.m | 6 +++--- OpenChange/SOGoMAPIFSMessage.m | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c63d43685..2df7c4a48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-01-05 Wolfgang Sourdeau + * OpenChange/SOGoMAPIFSMessage.m (-MAPISave): make use of + "ensureDirectory" on the container folder to avoid errors with + NSDictionary failing to save itself to the filesystem. + + * OpenChange/SOGoMAPIFSFolder.m (-ensureDirectory): method made + public and which ensures that the directory pointed to by the + instances of this class does exist. + * OpenChange/SOGoContactGCSEntry+MAPIStore.m (-setMAPIProperties): take "PidLidEmail1EmailAddress" id as key for the contact email address. diff --git a/OpenChange/SOGoMAPIFSFolder.h b/OpenChange/SOGoMAPIFSFolder.h index 43c836323..ab36dbe58 100644 --- a/OpenChange/SOGoMAPIFSFolder.h +++ b/OpenChange/SOGoMAPIFSFolder.h @@ -43,6 +43,7 @@ - (NSString *) directory; - (SOGoMAPIFSMessage *) newMessage; +- (void) ensureDirectory; @end diff --git a/OpenChange/SOGoMAPIFSFolder.m b/OpenChange/SOGoMAPIFSFolder.m index 5c44d4b1d..eaaf2386c 100644 --- a/OpenChange/SOGoMAPIFSFolder.m +++ b/OpenChange/SOGoMAPIFSFolder.m @@ -133,7 +133,7 @@ static NSString *privateDir = nil; return [SOGoMAPIFSMessage objectWithName: filename inContainer: self]; } -- (void) _ensureDirectorySanity +- (void) ensureDirectory { NSFileManager *fm; NSDictionary *attributes; @@ -169,7 +169,7 @@ static NSString *privateDir = nil; BOOL isDir; if (!directoryIsSane) - [self _ensureDirectorySanity]; + [self ensureDirectory]; fm = [NSFileManager defaultManager]; contents = [fm directoryContentsAtPath: directory]; @@ -208,7 +208,7 @@ static NSString *privateDir = nil; BOOL isDir; if (!directoryIsSane) - [self _ensureDirectorySanity]; + [self ensureDirectory]; fm = [NSFileManager defaultManager]; fullName = [directory stringByAppendingPathComponent: fileName]; diff --git a/OpenChange/SOGoMAPIFSMessage.m b/OpenChange/SOGoMAPIFSMessage.m index 329475bed..19daa6bdb 100644 --- a/OpenChange/SOGoMAPIFSMessage.m +++ b/OpenChange/SOGoMAPIFSMessage.m @@ -74,6 +74,8 @@ [self logWithFormat: @"-MAPISave"]; + [container ensureDirectory]; + filePath = [[container directory] stringByAppendingPathComponent: nameInContainer]; if (![properties writeToFile: filePath atomically: YES])