Monotone-Parent: 63e89008bf0aa0171f79d7bf4570993b929c7c0d

Monotone-Revision: abbedeb3c6a9b4649d47fc35a90f1a0d3fe244c5

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-01-06T03:20:24
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2011-01-06 03:20:24 +00:00
parent 12e392452c
commit 0a3c63f76e
4 changed files with 14 additions and 3 deletions

View file

@ -1,5 +1,13 @@
2011-01-05 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2011-01-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* 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): * OpenChange/SOGoContactGCSEntry+MAPIStore.m (-setMAPIProperties):
take "PidLidEmail1EmailAddress" id as key for the contact email take "PidLidEmail1EmailAddress" id as key for the contact email
address. address.

View file

@ -43,6 +43,7 @@
- (NSString *) directory; - (NSString *) directory;
- (SOGoMAPIFSMessage *) newMessage; - (SOGoMAPIFSMessage *) newMessage;
- (void) ensureDirectory;
@end @end

View file

@ -133,7 +133,7 @@ static NSString *privateDir = nil;
return [SOGoMAPIFSMessage objectWithName: filename inContainer: self]; return [SOGoMAPIFSMessage objectWithName: filename inContainer: self];
} }
- (void) _ensureDirectorySanity - (void) ensureDirectory
{ {
NSFileManager *fm; NSFileManager *fm;
NSDictionary *attributes; NSDictionary *attributes;
@ -169,7 +169,7 @@ static NSString *privateDir = nil;
BOOL isDir; BOOL isDir;
if (!directoryIsSane) if (!directoryIsSane)
[self _ensureDirectorySanity]; [self ensureDirectory];
fm = [NSFileManager defaultManager]; fm = [NSFileManager defaultManager];
contents = [fm directoryContentsAtPath: directory]; contents = [fm directoryContentsAtPath: directory];
@ -208,7 +208,7 @@ static NSString *privateDir = nil;
BOOL isDir; BOOL isDir;
if (!directoryIsSane) if (!directoryIsSane)
[self _ensureDirectorySanity]; [self ensureDirectory];
fm = [NSFileManager defaultManager]; fm = [NSFileManager defaultManager];
fullName = [directory stringByAppendingPathComponent: fileName]; fullName = [directory stringByAppendingPathComponent: fileName];

View file

@ -74,6 +74,8 @@
[self logWithFormat: @"-MAPISave"]; [self logWithFormat: @"-MAPISave"];
[container ensureDirectory];
filePath = [[container directory] filePath = [[container directory]
stringByAppendingPathComponent: nameInContainer]; stringByAppendingPathComponent: nameInContainer];
if (![properties writeToFile: filePath atomically: YES]) if (![properties writeToFile: filePath atomically: YES])