Re: Quicklook not working for network volume items
Re: Quicklook not working for network volume items
- Subject: Re: Quicklook not working for network volume items
- From: Chris Paveglio <email@hidden>
- Date: Fri, 07 Oct 2011 08:25:57 -0700 (PDT)
I don't get any error messages at all.
I feel like I am misunderstanding how quicklook works. Previously I had assumed that in general, QL stores a file preview inside of the actual file, like metadata, and calling a QL panel will simply fetch and display the image from inside a file. But I'll guess that I'm wrong, and in any application, the QL generator has to generate a preview "on-the-fly" and display that. So there's not a "static" generated QL image for any file on any drive. Can someone confirm that for me?
"QLThumbnailImageCreate"
I'm looking at the sample project again and seeing this is where it appears a preview is being generated. It's for the "icon" but I can't figure out where the "large" preview would be stored. It appears to only be saving a 48x48 icon. Or does the QL panel some override a small icon preview and do that call transparently?
- (NSImage *)iconImage
{
if (iconImage == nil) {
iconImage= [[[NSWorkspacesharedWorkspace] iconForFile:[resolvedFileURLpath]] retain];
[iconImagesetSize:NSMakeSize(ICON_SIZE, ICON_SIZE)];
if(!downloadIconQueue) {
downloadIconQueue = [[NSOperationQueue alloc] init];
[downloadIconQueuesetMaxConcurrentOperationCount:2];
quickLookOptions= [[NSDictionaryalloc] initWithObjectsAndKeys:
(id)kCFBooleanTrue, (id)kQLThumbnailOptionIconModeKey,
nil];
}
[downloadIconQueueaddOperationWithBlock:^{
CGImageRef quickLookIcon = QLThumbnailImageCreate(NULL, (CFURLRef)resolvedFileURL, CGSizeMake(ICON_SIZE, ICON_SIZE), (CFDictionaryRef)quickLookOptions);
if (quickLookIcon != NULL) {
NSImage* betterIcon = [[NSImage alloc] initWithCGImage:quickLookIcon size:NSMakeSize(ICON_SIZE, ICON_SIZE)];
[selfperformSelectorOnMainThread:@selector(setIconImage:) withObject:betterIcon waitUntilDone:NO];
[betterIcon release];
CFRelease(quickLookIcon);
}
}];
}
returniconImage;
}
----- Original Message -----
From: Norbert M. Doerner <email@hidden>
To: email@hidden
Cc: email@hidden
Sent: Wednesday, October 5, 2011 3:14 AM
Subject: Re: Quicklook not working for network volume items
Chris,
> I am trying to get Quicklook working in an app of mine. I'm not sure all these details are relevant, but better to have more than less info. I have a table that shows the number of files in certain folders on a network volume. In one column is the number of files, another column shows the first couple files names, as a string that was concatenated. My data object for each row has an array that stores NSURL's of all of the files.ÝI want the quicklook to show previews for all the files in the folder.
>
> So far I am successful in storing the NSURL's and to retrieve them. When I bring up the quicklook panel, I can see the number of items, it displays a generic icon of the first file, and I can cycle through to other files, and it displays the name of each file correctly. BUT, the preview panel will not show me a real icon or preview of any file, only the generic blank white page icon. If I override the panel methods:
> - (id <QLPreviewItem>)previewPanel:(QLPreviewPanel *)panel previewItemAtIndex:(NSInteger)index
> and
> - (NSURL *)previewItemURL
>
> to return an NSURL to a file on my hard drive, then the quicklook preview works properly and I see the actual image of the PDF. If I override those methods to use a hard coded NSURL to the same file on a network volume, the generic blank white-document icon shows up.
> So, what am I missing? I don't understand why this works locally but not on a network volume. The Finder shows the network item's quicklook preview properly.
Do you get any error messages in Console.app when you try to display the network file in Quicklook?
I have found that this framework sometimes emits helpful messages if there are problems...
Yours,
--
Norbert M. Doerner
CEO, West-Forest-Systems
In der Trift 13
56459 Langenhahn, Germany
Fon: +49 (2663) 91 70 128 (Central European Time Zone...)
Fax: +49 (2663) 91 70 126
AIM (iChat), Skype: cdfinderceo
Twitter: http://www.twitter.com/cdfinder
Facebook:
http://www.facebook.com/pages/CDFinder-The-Search-Is-Over/173297504827
---------------------------------------------------------------------------------------------------
CDFinder - The Search Is Over! http://www.cdfinder.de/
Catalog and organize your photos, music, videos, disks, data, anything...
NEW: CDFinder 5.7.3 for Mac OS X 10.7 Lion
Also catalogs PDF, RAW, MS Word, Quark XPress, Adobe Illustrator, ...
---------------------------------------------------------------------------------------------------
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden