Revert r13468 for now.

This commit is contained in:
Mitchell Livingston
2012-09-06 03:21:03 +00:00
parent 4935b91e3a
commit 9e7e64fe04
12 changed files with 230 additions and 40 deletions

View File

@@ -20,6 +20,7 @@ NSString * generateIconData(NSString * fileExtension, NSUInteger width, NSMutabl
[renderedIcon unlockFocus];
NSData * iconData = [renderedIcon TIFFRepresentation];
[renderedIcon release];
NSDictionary * imgProps = @{
(NSString *)kQLPreviewPropertyMIMETypeKey : @"image/png",
@@ -42,7 +43,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
//try to parse the torrent file
tr_info inf;
tr_ctor * ctor = tr_ctorNew(NULL);
tr_ctorSetMetainfoFromFile(ctor, [[(__bridge NSURL *)url path] UTF8String]);
tr_ctorSetMetainfoFromFile(ctor, [[(NSURL *)url path] UTF8String]);
const int err = tr_torrentParse(ctor, &inf);
tr_ctorFree(ctor);
if (err)
@@ -168,7 +169,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
(NSString *)kQLPreviewPropertyMIMETypeKey : @"text/html",
(NSString *)kQLPreviewPropertyAttachmentsKey : allImgProps };
QLPreviewRequestSetDataRepresentation(preview, (__bridge CFDataRef)[htmlString dataUsingEncoding: NSUTF8StringEncoding], kUTTypeHTML, (__bridge CFDictionaryRef)props);
QLPreviewRequestSetDataRepresentation(preview, (CFDataRef)[htmlString dataUsingEncoding: NSUTF8StringEncoding], kUTTypeHTML, (CFDictionaryRef)props);
return noErr;
}