Revision: 24656
          http://sourceforge.net/p/bibdesk/svn/24656
Author:   hofman
Date:     2020-03-03 10:32:54 +0000 (Tue, 03 Mar 2020)
Log Message:
-----------
use iconForFileType: rather than slow iconForFile: for icons in main table

Modified Paths:
--------------
    trunk/bibdesk/BibItem.m

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2020-03-03 07:30:29 UTC (rev 24655)
+++ trunk/bibdesk/BibItem.m     2020-03-03 10:32:54 UTC (rev 24656)
@@ -2698,15 +2698,18 @@
 }
 
 - (NSImage *)imageForURLField:(NSString *)field{
-    
     NSURL *url = [self URLForField:field];
-    if(nil == url)
+    if (nil == url)
         return nil;
     
-    if([field isLocalFileField] && (url = [url fileURLByResolvingAliases]) == 
nil)
+    if ([field isRemoteURLField])
+        return [NSImage imageForURL:url];
+    
+    url = [url fileURLByResolvingAliases];
+    if ([url checkResourceIsReachableAndReturnError:NULL])
+        return [[NSWorkspace sharedWorkspace] iconForFileType:[url 
pathExtension]];
+    else
         return [NSImage missingFileImage];
-    
-    return [NSImage imageForURL:url];
 }
 
 - (NSURL *)URLForField:(NSString *)field{

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

Reply via email to