Revision: 2597
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2597&view=rev
Author:   hofman
Date:     2007-07-31 08:25:03 -0700 (Tue, 31 Jul 2007)

Log Message:
-----------
Don't use a static flag to check if the app support directory exists, as there 
are several versions. 

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

Modified: trunk/SKApplicationController.m
===================================================================
--- trunk/SKApplicationController.m     2007-07-31 15:10:22 UTC (rev 2596)
+++ trunk/SKApplicationController.m     2007-07-31 15:25:03 UTC (rev 2597)
@@ -382,15 +382,17 @@
         CFDictionarySetValue(pathDict, (void *)domain, (void *)path);
         
         // the call to FSFindFolder creates the parent hierarchy, but not the 
directory we're looking for
-        static BOOL dirExists = NO;
-        if (dirExists == NO && create) {
-            BOOL pathIsDir;
-            dirExists = [[NSFileManager defaultManager] fileExistsAtPath:path 
isDirectory:&pathIsDir];
-            if (dirExists == NO || pathIsDir == NO)
-                [[NSFileManager defaultManager] createDirectoryAtPath:path 
attributes:nil];
-            // make sure it was created
-            dirExists = [[NSFileManager defaultManager] fileExistsAtPath:path 
isDirectory:&pathIsDir];
-            NSAssert1(dirExists && pathIsDir, @"Unable to create folder %@", 
path);
+        if (create) {
+            BOOL dirExists = [[NSFileManager defaultManager] 
fileExistsAtPath:path];
+            if (dirExists == NO) {
+                BOOL pathIsDir;
+                dirExists = [[NSFileManager defaultManager] 
fileExistsAtPath:path isDirectory:&pathIsDir];
+                if (dirExists == NO || pathIsDir == NO)
+                    [[NSFileManager defaultManager] createDirectoryAtPath:path 
attributes:nil];
+                // make sure it was created
+                dirExists = [[NSFileManager defaultManager] 
fileExistsAtPath:path isDirectory:&pathIsDir];
+                NSAssert1(dirExists && pathIsDir, @"Unable to create folder 
%@", path);
+            }
         }
     }
     


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

Reply via email to