[macos] refactoring

This commit is contained in:
maxkadushkin
2024-04-03 22:19:08 +03:00
parent 7fb593bebd
commit e10d331c70

View File

@ -92,12 +92,13 @@
// }];
NSArray * arguments = [[NSProcessInfo processInfo] arguments];
NSArray * keysCreateNew{@[@"word",@"cell",@"slide",@"form"]};
for (NSString * arg in arguments) {
if ( [arg hasPrefix:@"--new:"] || [arg hasPrefix:@"--new="] ) {
NSString * param = [arg substringFromIndex:6];
NSLog(@"input arg new: %@", param);
if ( [@[@"word",@"cell",@"slide",@"form"] containsObject:param] ) {
if ( [keysCreateNew containsObject:param] ) {
[[NSNotificationCenter defaultCenter] postNotificationName:CEFEventNameCreateTab
object:nil
userInfo:@{ @"action" : @(ASCTabActionCreateLocalFile),