Revision: 12363
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=12363&view=rev
Author: amaxwell
Date: 2008-01-08 08:54:35 -0800 (Tue, 08 Jan 2008)
Log Message:
-----------
URL is already pointing to the target file, so shouldn't need to be resolved
again. Release UTI.
Modified Paths:
--------------
trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m
Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m 2008-01-08
16:53:23 UTC (rev 12362)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m 2008-01-08
16:54:35 UTC (rev 12363)
@@ -268,29 +268,18 @@
OSStatus err = noErr;
CFStringRef theUTI = NULL;
- // convert to an FSRef, to get the UTI of the actual URL
+ // convert to an FSRef; _fileURL is guaranteed not to be an alias or
symlink
const UInt8 *fsPath = (void *)[[_fileURL path] UTF8String];
err = FSPathMakeRef(fsPath, &fileRef, NULL);
// kLSItemContentType returns a CFStringRef, according to the header
if (noErr == err)
err = LSCopyItemAttribute(&fileRef, kLSRolesAll, kLSItemContentType,
(CFTypeRef *)&theUTI);
-
- // For a link/alias, get the target's UTI in order to determine which
concrete subclass to create. Subclasses that are file-based need to check the
URL to see if it should be badged using _shouldDrawBadgeForURL, and then call
_resolvedURLWithURL in order to actually load the file's content.
- // aliases and symlinks are kUTTypeResolvable, so the alias manager should
handle either of them
- if (NULL != theUTI && UTTypeConformsTo(theUTI, kUTTypeResolvable)) {
- Boolean isFolder, wasAliased;
- err = FSResolveAliasFileWithMountFlags(&fileRef, TRUE, &isFolder,
&wasAliased, kARMNoUI);
- // don't change the UTI if it couldn't be resolved; in that case, we
should just show a finder icon
- if (noErr == err) {
- CFRelease(theUTI);
- theUTI = NULL;
- err = LSCopyItemAttribute(&fileRef, kLSRolesAll,
kLSItemContentType, (CFTypeRef *)&theUTI);
- }
- }
+ BOOL isHTML = (NULL != theUTI && UTTypeConformsTo(theUTI, kUTTypeHTML));
+ if (theUTI) CFRelease(theUTI);
- return NULL != theUTI && UTTypeConformsTo(theUTI, kUTTypeHTML);
+ return isHTML;
}
- (void)_loadHTML:(NSMutableDictionary *)HTMLDict {
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