dolphin/Source/Core/MacUpdater/AppDelegate.mm

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
962 B
Plaintext
Raw Normal View History

2019-01-18 07:31:14 -07:00
// Copyright 2019 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#import "AppDelegate.h"
#include "UpdaterCommon/UpdaterCommon.h"
2019-01-18 07:31:14 -07:00
#include <Cocoa/Cocoa.h>
#include <string>
2019-01-18 07:31:14 -07:00
#include <vector>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification {
2019-01-18 07:31:14 -07:00
NSArray* arguments = [[NSProcessInfo processInfo] arguments];
__block std::vector<std::string> args;
[arguments
enumerateObjectsUsingBlock:^(NSString* _Nonnull obj, NSUInteger idx, BOOL* _Nonnull stop) {
args.push_back(std::string([obj UTF8String]));
}];
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul);
dispatch_async(queue, ^{
RunUpdater(args);
[NSApp performSelector:@selector(terminate:) withObject:nil afterDelay:0.0];
2019-01-18 07:31:14 -07:00
});
}
- (void)applicationWillTerminate:(NSNotification*)aNotification {
2019-01-18 07:31:14 -07:00
}
@end