From: <ho...@us...> - 2006-11-30 10:59:14
|
Revision: 8632 http://svn.sourceforge.net/bibdesk/?rev=8632&view=rev Author: hofman Date: 2006-11-30 02:59:13 -0800 (Thu, 30 Nov 2006) Log Message: ----------- Catch TeXify exception when writing xattrs. Modified Paths: -------------- trunk/bibdesk/BibDocument_DataSource.m Modified: trunk/bibdesk/BibDocument_DataSource.m =================================================================== --- trunk/bibdesk/BibDocument_DataSource.m 2006-11-30 10:39:21 UTC (rev 8631) +++ trunk/bibdesk/BibDocument_DataSource.m 2006-11-30 10:59:13 UTC (rev 8632) @@ -468,8 +468,14 @@ [filePaths addObject:path]; NSError *xerror = nil; // we can always write xattrs; this doesn't alter the original file's content in any way, but fails if you have a really long abstract/annote - if([[NSFileManager defaultManager] setExtendedAttributeNamed:OMNI_BUNDLE_IDENTIFIER @".bibtexstring" toValue:[[pub bibTeXString] dataUsingEncoding:NSUTF8StringEncoding] atPath:path options:nil error:&xerror] == NO) - NSLog(@"%@ line %d: adding xattrs failed with error %@", __FILENAMEASNSSTRING__, __LINE__, xerror); + @try{ + if([[NSFileManager defaultManager] setExtendedAttributeNamed:OMNI_BUNDLE_IDENTIFIER @".bibtexstring" toValue:[[pub bibTeXString] dataUsingEncoding:NSUTF8StringEncoding] atPath:path options:nil error:&xerror] == NO) + NSLog(@"%@ line %d: adding xattrs failed with error %@", __FILENAMEASNSSTRING__, __LINE__, xerror); + } + @catch(id exception){ + // this could be a TeXify exception + NSLog(@"%@ line %d: adding xattrs failed with exception %@", __FILENAMEASNSSTRING__, __LINE__, exception); + } // writing the standard PDF metadata alters the original file, so we'll make it a separate preference; this is also really slow if([[OFPreferenceWrapper sharedPreferenceWrapper] boolForKey:BDSKShouldWritePDFMetadata]) [pub addPDFMetadataToFileForLocalURLField:dragColumnId]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |