Skip to content

Instantly share code, notes, and snippets.

@jxpx777
Created February 7, 2010 18:09
Show Gist options
  • Save jxpx777/297567 to your computer and use it in GitHub Desktop.
Save jxpx777/297567 to your computer and use it in GitHub Desktop.
//
// NSMetadataItem+JPQLPreviewItem.m
// Created by Jamie Phelps on 2/6/10.
//
// Licensed under the Don't Be A Dick License
//
@interface NSMetadataItem (JPQLPreviewItem)
-(NSString *)previewItemTitle;
-(NSURL *)previewItemURL;
@end
#import "NSMetadataItem+JPQLPreviewItem.m"
#import <Cocoa/Cocoa.h>
#import <QuickLook/QuickLook.h>
@implementation NSMetadataItem (JPQLPreviewItem)
-(NSString *)previewItemTitle;{
if([self respondsToSelector:@selector(imageTitle)]) { return [self imageTitle]; }
return [self valueForAttribute:@"kMDItemPath"];
}
-(NSURL *)previewItemURL;{
return [NSURL fileURLWithPath:[self valueForAttribute:@"kMDItemPath"]];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment