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:
parent
a70cd31b71
commit
a355327f91
@ -324,6 +324,12 @@ static OOCacheManager *sSingleton = nil;
|
|||||||
~/GNUstep/Library/Caches/
|
~/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);
|
NSArray *cachePaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask,YES);
|
||||||
NSString *cachePath = [cachePaths objectAtIndex:0];
|
NSString *cachePath = [cachePaths objectAtIndex:0];
|
||||||
if (cachePath == nil)
|
if (cachePath == nil)
|
||||||
|
@ -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
|
- (NSString *) manifestPath
|
||||||
{
|
{
|
||||||
return [[[OOCacheManager sharedCache] cacheDirectoryPathCreatingIfNecessary:YES] stringByAppendingPathComponent:kOOOXZManifestCache];
|
return [[[OOCacheManager sharedCache] cacheDirectoryPathCreatingIfNecessary:YES] stringByAppendingPathComponent:kOOOXZManifestCache];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user