diff options
author | Teddy Wing | 2018-10-25 20:49:39 +0200 |
---|---|---|
committer | Teddy Wing | 2018-10-25 20:49:39 +0200 |
commit | 6c06b4311ff1e5781d53f777ac00e196038c75e2 (patch) | |
tree | b005e0d1ed2cb3a0cedaac17d5eb5635d7a8c203 /lib | |
parent | b854b50348c566cb1c3fb3f8f76610e90492bae6 (diff) | |
download | DomeKey-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