Revision: 25421
          http://sourceforge.net/p/bibdesk/svn/25421
Author:   hofman
Date:     2021-01-17 18:33:58 +0000 (Sun, 17 Jan 2021)
Log Message:
-----------
Directly get scheme icon for remote URL when webview icon fails

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m    2021-01-17 
18:24:19 UTC (rev 25420)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m    2021-01-17 
18:33:58 UTC (rev 25421)
@@ -108,7 +108,7 @@
 + (BOOL)canInitWithURL:(NSURL *)aURL withType:(NSString *)type
 {
     // FVFinderIcon can basically handle any type
-    return YES;
+    return [aURL scheme] != nil;
 }
 
 - (id)initWithURL:(NSURL *)aURL drawsLinkBadge:(BOOL)drawsLinkBadge {

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m  2021-01-17 18:24:19 UTC 
(rev 25420)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVIcon.m  2021-01-17 18:33:58 UTC 
(rev 25421)
@@ -152,14 +152,16 @@
     NSParameterAssert(nil != representedURL);
     
     // initWithURLScheme requires a scheme, so there's not much we can do 
without it
-    if ([representedURL isEqual:_missingFileURL] || nil == [representedURL 
scheme]) {
+    if ([representedURL isEqual:_missingFileURL] || nil == representedURL) {
         return (id)[FVFinderIcon newMissing];
     }
     else if (NO == [representedURL isFileURL]) {
+        // FVWebViewIcon may be disabled, and does only support regular 
schemess
+        // return a Finder scheme based icon in that case
         if ([FVWebViewIcon canInitWithURL:representedURL withType:nil])
             return (id)[[FVWebViewIcon alloc] initWithURL:representedURL];
         else if ([FVFinderIcon canInitWithURL:representedURL withType:nil])
-            return (id)[[FVFinderIcon alloc] initWithURL:representedURL];
+            return (id)[FVFinderIcon newWithScheme:[representedURL scheme]];
         else
             return (id)[FVFinderIcon newMissing];
     }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to