Skip to content

Commit

Permalink
Merge pull request #1430 from pjrobertson/uti
Browse files Browse the repository at this point in the history
Fixes for UTI file types fixes #1428, #1427
  • Loading branch information
skurfer committed Mar 20, 2013
2 parents f70add9 + 11f300a commit 531c563
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Quicksilver/Code-QuickStepCore/QSObject_FileHandling.m
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ - (NSDictionary *)infoRecord {
return nil;
}

NSString *uti = QSUTIForExtensionOrType((NSString *)record.extension, record.filetype);
NSString *uti = QSUTIWithLSInfoRec(path, &record);
NSString *extension = [(NSString *)record.extension copy];

/* local or network volume? does it support Trash? */
Expand Down
4 changes: 3 additions & 1 deletion Quicksilver/Code-QuickStepFoundation/QSUTI.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@
return itemUTI;
}


// WARNING: This does not necessarily return the correct UTI. QSUTIWithLSInfoRec() is more reliable
NSString *QSUTIForExtensionOrType(NSString *extension, OSType filetype) {
NSString *itemUTI = nil;
// NSLog(@"type %@ %@", extension, NSFileTypeForHFSTypeCode(filetype));

if (extension != nil) {
itemUTI = (NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)extension, NULL);
} else {
Expand Down

0 comments on commit 531c563

Please sign in to comment.