mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-13 08:44:12 +03:00
Store localStorage in ~/Library/Application\ Support/Atom
This commit is contained in:
parent
7c04a183de
commit
10e5c85a75
@ -12,9 +12,26 @@
|
||||
return application;
|
||||
}
|
||||
|
||||
+ (NSString *)supportDirectory {
|
||||
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES) objectAtIndex:0];
|
||||
NSString *executableName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleExecutable"];
|
||||
NSString *supportDirectory = [cachePath stringByAppendingPathComponent:executableName];
|
||||
|
||||
NSFileManager *fs = [NSFileManager defaultManager];
|
||||
NSError *error;
|
||||
BOOL success = [fs createDirectoryAtPath:supportDirectory withIntermediateDirectories:YES attributes:nil error:&error];
|
||||
if (!success) {
|
||||
NSLog(@"Can't create support directory '%@' because %@", supportDirectory, [error localizedDescription]);
|
||||
supportDirectory = @"";
|
||||
}
|
||||
|
||||
return supportDirectory;
|
||||
}
|
||||
|
||||
+ (CefSettings)createCefSettings {
|
||||
CefSettings settings;
|
||||
CefString(&settings.cache_path) = "";
|
||||
|
||||
CefString(&settings.cache_path) = [[self supportDirectory] UTF8String];
|
||||
CefString(&settings.user_agent) = "";
|
||||
CefString(&settings.log_file) = "";
|
||||
CefString(&settings.javascript_flags) = "";
|
||||
@ -84,7 +101,7 @@
|
||||
- (void)sendEvent:(NSEvent*)event {
|
||||
CefScopedSendingEvent sendingEventScoper;
|
||||
if ([[self mainMenu] performKeyEquivalent:event]) return;
|
||||
|
||||
|
||||
if (_backgroundWindowController && ![self keyWindow] && [event type] == NSKeyDown) {
|
||||
[_backgroundWindowController.window makeKeyWindow];
|
||||
[_backgroundWindowController.window sendEvent:event];
|
||||
@ -95,3 +112,4 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user