From 8c20b1ce79316ccda8dd2c91c66f2388f16c45bf Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 5 Sep 2018 19:57:58 +0200 Subject: DefaultURLHandler: Add `saveDefaultURLHandler` This method is supposed to set CopyMailto as the default application for "mailto" URLs. But it keeps giving me a `-54` error, or `202` status code on the shell. WTF is going on? --- CopyMailto/main.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'CopyMailto/main.m') diff --git a/CopyMailto/main.m b/CopyMailto/main.m index 8dfe2c1..e61f04e 100644 --- a/CopyMailto/main.m +++ b/CopyMailto/main.m @@ -11,6 +11,9 @@ #import "DefaultURLHandler.h" int main(int argc, const char * argv[]) { - [DefaultURLHandler saveDefaultURLHandler]; + if (argc == 2 && strcmp(argv[1], "--set-url-handler") == 0) { + return [DefaultURLHandler setDefaultURLHandler]; + } + return NSApplicationMain(argc, argv); } -- cgit v1.2.3