Revision: 25320 http://sourceforge.net/p/bibdesk/svn/25320 Author: hofman Date: 2021-01-06 15:59:18 +0000 (Wed, 06 Jan 2021) Log Message: ----------- Don't care about implementing deprecated and unused replacementObjectForPortCoder
Modified Paths: -------------- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m =================================================================== --- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m 2021-01-06 07:30:59 UTC (rev 25319) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m 2021-01-06 15:59:18 UTC (rev 25320) @@ -114,16 +114,6 @@ // we only want to encode the public superclass - (Class)classForCoder { return FVIconClass; } -// we don't implement NSCoding, so always return a distant object (unused) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -- (id)replacementObjectForPortCoder:(NSPortCoder *)encoder -{ - - return [NSDistantObject proxyWithLocal:self connection:[encoder connection]]; -} -#pragma clang diagnostic pop - // these methods are all required - (void)drawInRect:(NSRect)dstRect ofContext:(CGContextRef)context { [self doesNotRecognizeSelector:_cmd]; } - (void)renderOffscreen { [self doesNotRecognizeSelector:_cmd]; } Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m =================================================================== --- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m 2021-01-06 07:30:59 UTC (rev 25319) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPreviewer.m 2021-01-06 15:59:18 UTC (rev 25320) @@ -87,26 +87,26 @@ // everything from here on safely assumes a file URL - OSStatus err = noErr; + // kLSItemContentType returns a CFStringRef, according to the header + CFTypeRef theUTI = NULL; +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 + + if (NO == [aURL getResourceValue:(NSString **)&theUTI forKey:NSURLTypeIdentifierKey error:NULL] && + NO == [aURL checkResourceIsReachableAndReturnError:NULL]) + return NO; + +#else + FSRef fileRef; - - // return nil if we can't resolve the path -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" if (FALSE == CFURLGetFSRef((CFURLRef)aURL, &fileRef)) -#pragma clang diagnostic pop - err = fnfErr; + // we get this for e.g. doi or unrecognized schemes; let FVPreviewer handle those + return NO; - // kLSItemContentType returns a CFStringRef, according to the header - CFTypeRef theUTI = NULL; - if (noErr == err) - err = LSCopyItemAttribute(&fileRef, kLSRolesAll, kLSItemContentType, &theUTI); + LSCopyItemAttribute(&fileRef, kLSRolesAll, kLSItemContentType, &theUTI); [(id)theUTI autorelease]; - - // we get this for e.g. doi or unrecognized schemes; let FVPreviewer handle those - if (fnfErr == err) - return NO; + +#endif if (nil == theUTI || UTTypeEqual(theUTI, kUTTypeData)) { NSAttributedString *string = [[[NSAttributedString alloc] initWithURL:aURL documentAttributes:NULL] autorelease]; @@ -351,27 +351,28 @@ // everything from here on safely assumes a file URL - OSStatus err = noErr; + // kLSItemContentType returns a CFStringRef, according to the header + CFTypeRef theUTI = NULL; + BOOL notFound = NO; - FSRef fileRef; +#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6 - // return nil if we can't resolve the path -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - if (FALSE == CFURLGetFSRef((CFURLRef)representedURL, &fileRef)) -#pragma clang diagnostic pop - err = fnfErr; + if ([representedURL getResourceValue:(NSString **)theUTI forKey:NSURLTypeIdentifierKey error:NULL] == NO) + notFound = NO == [representedURL checkResourceIsReachableAndReturnError:NULL]; +#else - // kLSItemContentType returns a CFStringRef, according to the header - CFTypeRef theUTI = NULL; - if (noErr == err) - err = LSCopyItemAttribute(&fileRef, kLSRolesAll, kLSItemContentType, &theUTI); + FSRef fileRef; + notFound = (FALSE == CFURLGetFSRef((CFURLRef)representedURL, &fileRef)) + if (notFound == NO) + LSCopyItemAttribute(&fileRef, kLSRolesAll, kLSItemContentType, &theUTI); [(id)theUTI autorelease]; +#endif + NSView *theView = nil; // we get this for e.g. doi or unrecognized schemes; let FVIcon handle those - if (fnfErr == err) { + if (notFound) { theView = imageView; [(FVScaledImageView *)theView displayImageAtURL:representedURL]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit