mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-03 12:47:31 +01:00
Add function for getting the correct config directory on mac.
This commit is contained in:
parent
6406216918
commit
d17703d39a
@ -22,6 +22,7 @@ void CheckForUpdates();
|
||||
|
||||
QString GetBundlePath();
|
||||
QString GetResourcesPath();
|
||||
QString GetApplicationSupportPath();
|
||||
|
||||
} // namespace mac
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSBundle.h>
|
||||
#import <Foundation/NSPathUtilities.h>
|
||||
#import <Foundation/NSTimer.h>
|
||||
#import <Foundation/NSURL.h>
|
||||
#import <AppKit/NSNibDeclarations.h>
|
||||
@ -201,4 +202,16 @@ QString GetResourcesPath() {
|
||||
return bundle_path + "/Contents/Resources";
|
||||
}
|
||||
|
||||
QString GetApplicationSupportPath() {
|
||||
NSArray* paths = NSSearchPathForDirectoriesInDomains(
|
||||
NSApplicationSupportDirectory,
|
||||
NSUserDomainMask,
|
||||
YES);
|
||||
if ([paths count] > 0) {
|
||||
NSString* user_path = [paths objectAtIndex:0];
|
||||
return QString::fromUtf8([user_path UTF8String]);
|
||||
}
|
||||
return "~/Library/Application Support";
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
|
Loading…
x
Reference in New Issue
Block a user