diff --git a/src/Core/OOCacheManager.m b/src/Core/OOCacheManager.m index d819f5a1..e1c24e76 100644 --- a/src/Core/OOCacheManager.m +++ b/src/Core/OOCacheManager.m @@ -324,6 +324,12 @@ static OOCacheManager *sSingleton = nil; ~/GNUstep/Library/Caches/ */ + /* Okay, I fixed the hard-coding of GNUStep - NSSearchPath seems + * to work just fine. Is there any good reason that we don't + * create an org.aegidian.oolite subfolder on GNUStep like Mac + * has? If we did, then we could just use the Mac function on all + * platforms... - CIM: 2014-01-05 */ + NSArray *cachePaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES); NSString *cachePath = [cachePaths objectAtIndex:0]; if (cachePath == nil) diff --git a/src/Core/OOOXZManager.m b/src/Core/OOOXZManager.m index beb86434..597356b7 100644 --- a/src/Core/OOOXZManager.m +++ b/src/Core/OOOXZManager.m @@ -109,6 +109,21 @@ static OOOXZManager *sSingleton = nil; } +/* The install path for OXZs downloaded by + * Oolite. Library/ApplicationSupport seems to be the most appropriate + * location. */ +- (NSString *) installPath +{ + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,NSUserDomainMask,YES); + NSString *appPath = [paths objectAtIndex:0]; + if (appPath != nil) + { + appPath = [appPath stringByAppendingPathComponent:@"org.aegidian.oolite"]; + } + return nil; +} + + - (NSString *) manifestPath { return [[[OOCacheManager sharedCache] cacheDirectoryPathCreatingIfNecessary:YES] stringByAppendingPathComponent:kOOOXZManifestCache];