Fix deprecation warning regarding NSOKButton on 10.10+.

This commit is contained in:
Josh Petrie
2015-05-15 20:00:58 -07:00
parent 34192eeed9
commit 91bdf6c87c
2 changed files with 9 additions and 0 deletions
+5
View File
@@ -1095,7 +1095,12 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
#else
NSInteger result = [panel runModalForDirectory:dir file:nil types:nil];
#endif
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10)
if (NSModalResponseOK == result) {
#else
if (NSOKButton == result) {
#endif
// NOTE: -[NSOpenPanel filenames] is deprecated on 10.7 so use
// -[NSOpenPanel URLs] instead. The downside is that we have to check
// that each URL is really a path first.
+4
View File
@@ -888,7 +888,11 @@ static BOOL isUnsafeMessage(int msgid);
context:(void *)context
{
NSString *path = nil;
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10)
if (code == NSModalResponseOK) {
#else
if (code == NSOKButton) {
#endif
NSURL *url = [panel URL];
if ([url isFileURL])
path = [url path];