2
0

Update Google+ integration.

[UPDATED]   Google+ SDK to 1.1.0.
This commit is contained in:
Maarten Billemont
2013-01-31 16:22:37 -05:00
parent cc015ada1b
commit 6c23134e47
74 changed files with 3383 additions and 2012 deletions

View File

@@ -300,41 +300,6 @@ const CFStringRef kCharsToForceEscape = CFSTR("!*'();:@&=+$,/?%#[]");
return result;
}
#pragma mark MIME Types
// Utility routine to convert a file path to the file's MIME type using
// Mac OS X's UTI database
#if !GTL_FOUNDATION_ONLY
+ (NSString *)MIMETypeForFileAtPath:(NSString *)path
defaultMIMEType:(NSString *)defaultType {
NSString *result = defaultType;
// Convert the path to an FSRef
FSRef fileFSRef;
Boolean isDirectory;
OSStatus err = FSPathMakeRef((UInt8 *) [path fileSystemRepresentation],
&fileFSRef, &isDirectory);
if (err == noErr) {
// Get the UTI (content type) for the FSRef
CFStringRef fileUTI;
err = LSCopyItemAttribute(&fileFSRef, kLSRolesAll, kLSItemContentType,
(CFTypeRef *)&fileUTI);
if (err == noErr) {
// Get the MIME type for the UTI
CFStringRef mimeTypeTag;
mimeTypeTag = UTTypeCopyPreferredTagWithClass(fileUTI,
kUTTagClassMIMEType);
if (mimeTypeTag) {
// Convert the CFStringRef to an autoreleased NSString
result = [(id)CFMakeCollectable(mimeTypeTag) autorelease];
}
CFRelease(fileUTI);
}
}
return result;
}
#endif
@end
// isEqual: has the fatal flaw that it doesn't deal well with the receiver