From: <ho...@us...> - 2006-03-05 08:32:41
|
Revision: 5745 Author: hofman Date: 2006-03-05 00:32:35 -0800 (Sun, 05 Mar 2006) ViewCVS: http://svn.sourceforge.net/bibdesk/?rev=5745&view=rev Log Message: ----------- Replace invalid characters in the spotlight cache filename. Modified Paths: -------------- trunk/bibdesk/BibAppController.m Modified: trunk/bibdesk/BibAppController.m =================================================================== --- trunk/bibdesk/BibAppController.m 2006-03-05 06:44:36 UTC (rev 5744) +++ trunk/bibdesk/BibAppController.m 2006-03-05 08:32:35 UTC (rev 5745) @@ -1492,6 +1492,7 @@ NSString *citeKey; BibItem *anItem; NSDate *dateModified; + NSCharacterSet *invalidFilenameCharSet = [NSCharacterSet characterSetWithCharactersInString:@":/"]; BDAlias *alias = [[BDAlias alloc] initWithPath:docPath]; if(alias == nil){ @@ -1563,7 +1564,8 @@ [metadata setValue:array forKey:(NSString *)kMDItemWhereFroms]; [array release]; - tmpPath = [cachePath stringByAppendingPathComponent:[citeKey stringByAppendingPathExtension:@"bdskcache"]]; + tmpPath = [citeKey stringByReplacingCharactersInSet:invalidFilenameCharSet withString:@"%"]; + tmpPath = [cachePath stringByAppendingPathComponent:[tmpPath stringByAppendingPathExtension:@"bdskcache"]]; // save the plist; we can get an error if these are not plist objects, or the file couldn't be written if([metadata writeToFile:tmpPath atomically:YES] == NO){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |