Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OODockTilePlugIn.m File Reference
+ Include dependency graph for OODockTilePlugIn.m:

Go to the source code of this file.

Macros

#define OOLITE_LEOPARD   1
 
#define kSnapshotsDirRefKey   @"snapshots-directory-reference"
 
#define kSnapshotsDirNameKey   @"snapshots-directory-name"
 

Functions

static NSString * OOLogHandlerGetLogBasePath (void)
 
static NSArray * ResourceManagerRootPaths (void)
 

Macro Definition Documentation

◆ kSnapshotsDirNameKey

#define kSnapshotsDirNameKey   @"snapshots-directory-name"

Definition at line 209 of file OODockTilePlugIn.m.

◆ kSnapshotsDirRefKey

#define kSnapshotsDirRefKey   @"snapshots-directory-reference"

Definition at line 208 of file OODockTilePlugIn.m.

◆ OOLITE_LEOPARD

#define OOLITE_LEOPARD   1

Definition at line 31 of file OODockTilePlugIn.m.

Function Documentation

◆ OOLogHandlerGetLogBasePath()

static NSString * OOLogHandlerGetLogBasePath ( void )
static

Definition at line 305 of file OODockTilePlugIn.m.

306{
307 static NSString *basePath = nil;
308
309 if (basePath == nil)
310 {
311 // ~/Library
312 basePath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0];
313 basePath = [basePath stringByAppendingPathComponent:@"Logs"];
314 basePath = [basePath stringByAppendingPathComponent:@"Oolite"];
315
316 BOOL exists, directory;
317 NSFileManager *fmgr = [NSFileManager defaultManager];
318
319 exists = [fmgr fileExistsAtPath:basePath isDirectory:&directory];
320 if (exists)
321 {
322 if (!directory)
323 {
324 basePath = nil;
325 }
326 }
327 else
328 {
329 if (![fmgr createDirectoryAtPath:basePath withIntermediateDirectories:YES attributes:nil error:NULL])
330 {
331 basePath = nil;
332 }
333 }
334
335 [basePath retain];
336 }
337
338 return basePath;
339}
return nil

◆ ResourceManagerRootPaths()

static NSArray * ResourceManagerRootPaths ( void )
static

Definition at line 342 of file OODockTilePlugIn.m.

343{
344 // Adapted from -[ResourceManager rootPaths].
345 return [NSArray arrayWithObjects:
346 [[[[NSHomeDirectory() stringByAppendingPathComponent:@"Library"]
347 stringByAppendingPathComponent:@"Application Support"]
348 stringByAppendingPathComponent:@"Oolite"]
349 stringByAppendingPathComponent:@"AddOns"],
350 [[[[NSBundle mainBundle] bundlePath]
351 stringByDeletingLastPathComponent]
352 stringByAppendingPathComponent:@"AddOns"],
353 [[NSHomeDirectory()
354 stringByAppendingPathComponent:@".Oolite"]
355 stringByAppendingPathComponent:@"AddOns"],
356 nil];
357}