Revision: 25526 http://sourceforge.net/p/bibdesk/svn/25526 Author: hofman Date: 2021-02-02 10:12:05 +0000 (Tue, 02 Feb 2021) Log Message: ----------- Show MIME type icon for all unsupported MIME types, show network icon on generic doc icon when we don't undertsand the MIME type
Modified Paths: -------------- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMIMEIcon.m trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMIMEIcon.m =================================================================== --- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMIMEIcon.m 2021-02-02 07:30:23 UTC (rev 25525) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVMIMEIcon.m 2021-02-02 10:12:05 UTC (rev 25526) @@ -69,13 +69,8 @@ NSAssert2(pthread_main_np() != 0, @"*** threading violation *** +[%@ %@] requires main thread", self, NSStringFromSelector(_cmd)); if (self = [super init]) { CFTypeRef theUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (CFStringRef)type, NULL); - if (theUTI != NULL) { - _icon = [[[NSWorkspace sharedWorkspace] iconForFileType:(NSString *)theUTI] retain]; - CFRelease(theUTI); - } else { - _icon = nil; - } - // don't return nil; we'll just draw the network icon + _icon = [[[NSWorkspace sharedWorkspace] iconForFileType:(NSString *)theUTI ?: @""] retain]; + if (theUTI) CFRelease(theUTI); } return self; } Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m =================================================================== --- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m 2021-02-02 07:30:23 UTC (rev 25525) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m 2021-02-02 10:12:05 UTC (rev 25526) @@ -725,17 +725,15 @@ [listener ignore]; } } - else if (NULL != theUTI && FALSE == UTTypeConformsTo(theUTI, kUTTypeText)) { + else if (NO == [[sender class] canShowMIMEType:type] || + (NULL != theUTI && FALSE == UTTypeConformsTo(theUTI, kUTTypeText))) { [_icon _webViewReceivedUnsupportedMIMEType:type]; // this triggers webView:didFailProvisionalLoadWithError:forFrame: [listener ignore]; } - else if ([[sender class] canShowMIMEType:type]) { + else { [listener use]; } - else { - [listener ignore]; - } if (theUTI) CFRelease(theUTI); } 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