aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTeddy Wing2018-10-25 20:49:39 +0200
committerTeddy Wing2018-10-25 20:49:39 +0200
commit6c06b4311ff1e5781d53f777ac00e196038c75e2 (patch)
treeb005e0d1ed2cb3a0cedaac17d5eb5635d7a8c203 /lib
parentb854b50348c566cb1c3fb3f8f76610e90492bae6 (diff)
downloadDomeKey-6c06b4311ff1e5781d53f777ac00e196038c75e2.tar.bz2
LicenseHandler(addLicense:): Use `NSWorkspace` to move to trash
The `trashItemAtURL:resultingItemURL:error:` method in `NSFileManager` is only available starting from Mac OS X 10.8. Replace this with a more compatible API call. At first I was thinking about using `NSWorkspace` `performFileOperation:source:destination:files:tag:`, since it works starting from 10.0. However, I'd need to remove the `license.plist` path component from the `NSURL` from `licensePath` in order to pass it to the `source:` argument. I found `NSURL` `URLByDeletingLastPathComponent`, which would make perfect sense, except it's only implemented starting in 10.6. At that point, I figured why not use `NSWorkspace` `recycleURLs:completionHandler:`, which exists starting in 10.6, and has a simpler interface than `performFileOperation:source:destination:files:tag:`. Import AppKit in order to be able to use `NSWorkspace`.
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions