Revision: 3574
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3574&view=rev
Author:   hofman
Date:     2008-03-28 11:20:15 -0700 (Fri, 28 Mar 2008)

Log Message:
-----------
Only create temporary directory for saving PDF bundle when needed.

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

Modified: trunk/SKDocument.m
===================================================================
--- trunk/SKDocument.m  2008-03-28 17:26:59 UTC (rev 3573)
+++ trunk/SKDocument.m  2008-03-28 18:20:15 UTC (rev 3574)
@@ -328,11 +328,13 @@
         // we move everything that's not ours out of the way, so we can 
preserve version control info
         if ([fm fileExistsAtPath:path isDirectory:&isDir] && isDir) {
             NSSet *ourExtensions = [NSSet setWithObjects:@"pdf", @"skim", 
@"fdf", @"txt", @"text", @"rtf", @"plist", nil];
-            tmpPath = SKUniqueDirectoryCreating(NSTemporaryDirectory(), YES);
             fileEnum = [[fm directoryContentsAtPath:path] objectEnumerator];
             while (file = [fileEnum nextObject]) {
-                if ([ourExtensions containsObject:[[file pathExtension] 
lowercaseString]] == NO)
+                if ([ourExtensions containsObject:[[file pathExtension] 
lowercaseString]] == NO) {
+                    if (tmpPath == nil)
+                        tmpPath = 
SKUniqueDirectoryCreating(NSTemporaryDirectory(), YES);
                     [fm movePath:[path stringByAppendingPathComponent:file] 
toPath:[tmpPath stringByAppendingPathComponent:file] handler:nil];
+                }
             }
         }
         


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to