Revision: 12365
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12365&view=rev
Author:   hofman
Date:     2008-01-08 09:03:22 -0800 (Tue, 08 Jan 2008)

Log Message:
-----------
Revert last commit, as this is not thread safe and should never be relevant 
anyway. Instead add an assert to check whether this is really true.

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m   2008-01-08 
16:55:04 UTC (rev 12364)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m   2008-01-08 
17:03:22 UTC (rev 12365)
@@ -106,19 +106,16 @@
 - (id)initWithURL:(NSURL *)aURL;
 {    
     NSParameterAssert(nil != [aURL scheme]);
+    NSParameterAssert(NO == [aURL isFileURL] || [FVTextIcon 
canInitWithURL:aURL]); // we should only load local HTML files
     
     // if this is disabled or not an http URL, return a finder icon instead
     if (FVWebIconDisabled || (NO == [[aURL scheme] isEqualToString:@"http"] && 
NO == [aURL isFileURL])) {
         NSZone *zone = [self zone];
         [self release];
-        if ([aURL isFileURL]) {
-            if ([FVTextIcon canInitWithURL:aURL])
-                self = [[FVTextIcon alloc] initWithTextAtURL:aURL];
-            else
-                self = [[FVFinderIcon alloc] initWithFinderIconOfURL:aURL];
-        } else {
-            self = [[FVFinderIcon alloc] initWithURLScheme:[aURL scheme]];
-        }
+        if ([aURL isFileURL])
+            self = [[FVTextIcon allocWithZone:zone] initWithTextAtURL:aURL];
+        else
+            self = [[FVFinderIcon allocWithZone:zone] initWithURLScheme:[aURL 
scheme]];
     }
     else if ((self = [super init])) {
         _httpURL = [aURL copy];
@@ -453,14 +450,10 @@
         [self 
performSelectorOnMainThread:@selector(renderOffscreenOnMainThread) 
withObject:nil waitUntilDone:NO];
     }
     else if (YES == _webviewFailed && nil == _fallbackIcon) {
-        if ([_httpURL isFileURL]) {
-            if ([FVTextIcon canInitWithURL:_httpURL])
-                _fallbackIcon = [[FVTextIcon alloc] 
initWithTextAtURL:_httpURL];
-            else
-                _fallbackIcon = [[FVFinderIcon alloc] 
initWithFinderIconOfURL:_httpURL];
-        } else {
+        if ([_httpURL isFileURL])
+            _fallbackIcon = [[FVTextIcon alloc] initWithTextAtURL:_httpURL];
+        else
             _fallbackIcon = [[FVFinderIcon alloc] initWithURLScheme:[_httpURL 
scheme]];
-        }
     }
     pthread_mutex_unlock(&_mutex);
 }


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

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to