Revision: 3186 http://skim-app.svn.sourceforge.net/skim-app/?rev=3186&view=rev Author: hofman Date: 2007-11-09 13:45:51 -0800 (Fri, 09 Nov 2007)
Log Message: ----------- Remove auto-saved skim notes backup when there are no notes rather than saving an empty array. Modified Paths: -------------- trunk/SKDocument.m Modified: trunk/SKDocument.m =================================================================== --- trunk/SKDocument.m 2007-11-09 19:46:36 UTC (rev 3185) +++ trunk/SKDocument.m 2007-11-09 21:45:51 UTC (rev 3186) @@ -269,13 +269,15 @@ if (canMove) { NSString *tmpPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]; - if ([self writeToURL:[NSURL fileURLWithPath:tmpPath] ofType:SKNotesDocumentType error:NULL]) { + if ([[self notes] count] == 0 || [self writeToURL:[NSURL fileURLWithPath:tmpPath] ofType:SKNotesDocumentType error:NULL]) { if (fileExists) canMove = [fm removeFileAtPath:notesPath handler:nil]; - if (canMove) - [fm movePath:tmpPath toPath:notesPath handler:nil]; - else - [fm removeFileAtPath:tmpPath handler:nil]; + if ([[self notes] count]) { + if (canMove) + [fm movePath:tmpPath toPath:notesPath handler:nil]; + else + [fm removeFileAtPath:tmpPath handler:nil]; + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit