diff options
-rw-r--r-- | DomeKey/LicenseHandler.h | 1 | ||||
-rw-r--r-- | DomeKey/LicenseHandler.m | 15 |
2 files changed, 8 insertions, 8 deletions
diff --git a/DomeKey/LicenseHandler.h b/DomeKey/LicenseHandler.h index 4d86923..90d308e 100644 --- a/DomeKey/LicenseHandler.h +++ b/DomeKey/LicenseHandler.h @@ -6,6 +6,7 @@ // Copyright © 2018 tw. All rights reserved. // +#import <AppKit/AppKit.h> #import <Foundation/Foundation.h> #import "AquaticPrime.h" diff --git a/DomeKey/LicenseHandler.m b/DomeKey/LicenseHandler.m index 021c7d4..b18bd77 100644 --- a/DomeKey/LicenseHandler.m +++ b/DomeKey/LicenseHandler.m @@ -53,14 +53,13 @@ static NSString * const LICENSE_FILE_NAME = @"license.plist"; printf("Thank you for registering DomeKey!\n"); } else { - BOOL trashed = [[NSFileManager defaultManager] - trashItemAtURL:[self licensePath] - resultingItemURL:nil - error:&error]; - - if (!trashed) { - eprintf("%s\n", [[error localizedDescription] UTF8String]); - } + [[NSWorkspace sharedWorkspace] + recycleURLs:[NSArray arrayWithObject:[self licensePath]] + completionHandler:^(NSDictionary<NSURL *,NSURL *> *newURLs, NSError *error) { + if (error) { + eprintf("%s\n", [[error localizedDescription] UTF8String]); + } + }]; } // Copy license file into path |