Revision: 2797
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2797&view=rev
Author:   hofman
Date:     2007-09-01 08:30:08 -0700 (Sat, 01 Sep 2007)

Log Message:
-----------
Set file attributes of files in PDF bundles when saving.

Modified Paths:
--------------
    trunk/SKDocument.m

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2007-09-01 13:30:45 UTC (rev 2796)
+++ trunk/SKDocument.m  2007-09-01 15:30:08 UTC (rev 2797)
@@ -270,7 +270,6 @@
                 NSSet *ourImportantExtensions = [NSSet setWithObjects:@"pdf", 
@"skim", nil];
                 NSEnumerator *fileEnum;
                 NSString *file;
-                BOOL didMove;
                 NSMutableDictionary *attributes = [[fm 
fileAttributesAtPath:path traverseLink:YES] mutableCopy];
                 [attributes addEntriesFromDictionary:[self 
fileAttributesToWriteToURL:absoluteURL ofType:typeName 
forSaveOperation:saveOperation originalContentsURL:[self fileURL] error:NULL]];
                 unsigned long permissions = [[attributes 
objectForKey:NSFilePosixPermissions] unsignedLongValue];
@@ -289,8 +288,10 @@
                 
                 fileEnum = [[fm directoryContentsAtPath:tmpPath] 
objectEnumerator];
                 while (success && (file = [fileEnum nextObject])) {
-                    didMove = [fm movePath:[tmpPath 
stringByAppendingPathComponent:file] toPath:[path 
stringByAppendingPathComponent:file] handler:nil];
-                    if (didMove == NO && [ourImportantExtensions 
containsObject:[[file pathExtension] lowercaseString]])
+                    NSString *filePath = [path 
stringByAppendingPathComponent:file];
+                    if ([fm movePath:[tmpPath 
stringByAppendingPathComponent:file] toPath:filePath handler:nil])
+                        [fm changeFileAttributes:[self 
fileAttributesToWriteToURL:[NSURL fileURLWithPath:filePath] ofType:typeName 
forSaveOperation:saveOperation originalContentsURL:[self fileURL] error:NULL] 
atPath:filePath];
+                    else if ([ourImportantExtensions containsObject:[[file 
pathExtension] lowercaseString]])
                         success = NO;
                 }
                 


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
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to