dolphin/Source/Core/MacUpdater/AppDelegate.mm
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00

41 lines
1 KiB
Text

// Copyright 2019 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#import "AppDelegate.h"
#include "UpdaterCommon/UpdaterCommon.h"
#include <Cocoa/Cocoa.h>
#include <string>
#include <vector>
// Refer to docs/autoupdate_overview.md for a detailed overview of the autoupdate process
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification*)aNotification
{
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];
});
}
- (void)applicationWillTerminate:(NSNotification*)aNotification
{
}
@end