[sword-svn] r3412 - trunk/bindings/objc/src/services

mdbergmann at crosswire.org mdbergmann at crosswire.org
Tue Mar 1 14:41:32 MST 2016


Author: mdbergmann
Date: 2016-03-01 14:41:32 -0700 (Tue, 01 Mar 2016)
New Revision: 3412

Modified:
   trunk/bindings/objc/src/services/Configuration.h
   trunk/bindings/objc/src/services/Configuration.m
   trunk/bindings/objc/src/services/OSXConfiguration.h
   trunk/bindings/objc/src/services/OSXConfiguration.m
Log:
adapted file path for sandbox environment.

Modified: trunk/bindings/objc/src/services/Configuration.h
===================================================================
--- trunk/bindings/objc/src/services/Configuration.h	2016-02-25 09:43:52 UTC (rev 3411)
+++ trunk/bindings/objc/src/services/Configuration.h	2016-03-01 21:41:32 UTC (rev 3412)
@@ -20,7 +20,6 @@
 - (NSString *)osVersion;
 - (NSString *)bundleVersion;
 - (NSString *)defaultModulePath;
-- (NSString *)defaultAppSupportPath;
 - (NSString *)tempFolder;
 - (NSString *)logFile;
 
@@ -36,7 +35,6 @@
 - (NSString *)osVersion;
 - (NSString *)bundleVersion;
 - (NSString *)defaultModulePath;
-- (NSString *)defaultAppSupportPath;
 - (NSString *)tempFolder;
 - (NSString *)logFile;
 

Modified: trunk/bindings/objc/src/services/Configuration.m
===================================================================
--- trunk/bindings/objc/src/services/Configuration.m	2016-02-25 09:43:52 UTC (rev 3411)
+++ trunk/bindings/objc/src/services/Configuration.m	2016-03-01 21:41:32 UTC (rev 3412)
@@ -38,7 +38,6 @@
 - (NSString *)osVersion {return [impl osVersion];}
 - (NSString *)bundleVersion {return [impl bundleVersion];}
 - (NSString *)defaultModulePath {return [impl defaultModulePath];}
-- (NSString *)defaultAppSupportPath {return [impl defaultAppSupportPath];}
 - (NSString *)tempFolder {return [impl tempFolder];}
 - (NSString *)logFile {return [impl logFile];}
 

Modified: trunk/bindings/objc/src/services/OSXConfiguration.h
===================================================================
--- trunk/bindings/objc/src/services/OSXConfiguration.h	2016-02-25 09:43:52 UTC (rev 3411)
+++ trunk/bindings/objc/src/services/OSXConfiguration.h	2016-03-01 21:41:32 UTC (rev 3412)
@@ -15,7 +15,6 @@
 - (NSString *)osVersion;
 - (NSString *)bundleVersion;
 - (NSString *)defaultModulePath;
-- (NSString *)defaultAppSupportPath;
 - (NSString *)tempFolder;
 - (NSString *)logFile;
 

Modified: trunk/bindings/objc/src/services/OSXConfiguration.m
===================================================================
--- trunk/bindings/objc/src/services/OSXConfiguration.m	2016-02-25 09:43:52 UTC (rev 3411)
+++ trunk/bindings/objc/src/services/OSXConfiguration.m	2016-03-01 21:41:32 UTC (rev 3412)
@@ -20,19 +20,27 @@
 }
 
 - (NSString *)defaultModulePath {
-    return [@"~/Library/Application Support/Sword" stringByExpandingTildeInPath];
+    NSArray *urls = [[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask];
+    if(urls.count > 0) {
+        return [[(NSURL *)urls[0] path] stringByAppendingPathComponent:@"Sword"];
+    }
+    return nil;
 }
 
-- (NSString *)defaultAppSupportPath {
-    return [@"~/Library/Application Support/MacSword" stringByExpandingTildeInPath];
-}
-
 - (NSString *)tempFolder {
-    return [@"~/Library/Caches/ObjCSword" stringByExpandingTildeInPath];
+    NSArray *urls = [[NSFileManager defaultManager] URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask];
+    if(urls.count > 0) {
+        return [[(NSURL *)urls[0] path] stringByAppendingPathComponent:@"ObjCSword"];
+    }
+    return nil;
 }
 
 - (NSString *)logFile {
-    return [@"~/Library/Logs/ObjCSword.log" stringByExpandingTildeInPath];
+    NSArray *urls = [[NSFileManager defaultManager] URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask];
+    if(urls.count > 0) {
+        return [[[(NSURL *)urls[0] path] stringByAppendingPathComponent:@"Logs"] stringByAppendingPathComponent:@"ObjCSword.log"];
+    }
+    return nil;
 }
 
 @end




More information about the sword-cvs mailing list