Revision: 12283
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12283&view=rev
Author:   amaxwell
Date:     2008-01-05 11:07:09 -0800 (Sat, 05 Jan 2008)

Log Message:
-----------
Create fallback icon at init time and draw that instead of a placeholder.

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-05 
18:57:59 UTC (rev 12282)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVWebViewIcon.m   2008-01-05 
19:07:09 UTC (rev 12283)
@@ -88,7 +88,8 @@
         const char *name = [[aURL absoluteString] UTF8String];
         _diskCacheName = NSZoneMalloc([self zone], sizeof(char) * 
(strlen(name) + 1));
         strcpy(_diskCacheName, name);
-        
+        _fallbackIcon = [[FVFinderIcon alloc] initWithURLScheme:[_httpURL 
scheme]];
+
         NSInteger rc = pthread_mutex_init(&_mutex, NULL);
         if (rc)
             perror("pthread_mutex_init");
@@ -396,11 +397,9 @@
         [self 
performSelectorOnMainThread:@selector(renderOffscreenOnMainThread) 
withObject:nil waitUntilDone:NO];
     }
     else {
-        // Unreachable or failed to load.  Load a Finder icon and set the 
webview failure bit; we won't try again.
+        // Unreachable or failed to load.  Set the webview failure bit; we 
won't try again.
         _webviewFailed = YES;
         _isRendering = NO;
-        if (nil == _fallbackIcon)
-            _fallbackIcon = [[FVFinderIcon alloc] initWithURLScheme:[_httpURL 
scheme]];
         [_fallbackIcon renderOffscreen];
     }
     pthread_mutex_unlock(&_mutex);
@@ -434,8 +433,6 @@
             CGContextDrawImage(context, drawRect, _fullImageRef);
         else if (_thumbnailRef)
             CGContextDrawImage(context, drawRect, _thumbnailRef);
-        else if (NO == _webviewFailed || nil == _fallbackIcon)
-            [self _drawPlaceholderInRect:dstRect inCGContext:context];
         else 
             [_fallbackIcon drawInRect:dstRect inCGContext:context];
         


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to