Tidy up GNUstep cache folder selection

Select a sensible location for downloaded OXZs but don't do anything with it yet.
This commit is contained in:
cim 2014-01-05 21:25:18 +00:00
parent a70cd31b71
commit a355327f91
2 changed files with 21 additions and 0 deletions

View File

@ -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)

View File

@ -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];