this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

LaunchServices: Implement UTTypeCopyParentIdentifiers

+35
+35
src/frameworks/CoreServices/src/LaunchServices/UTType.m
··· 281 281 return retval; 282 282 } 283 283 284 + CFArrayRef 285 + UTTypeCopyParentIdentifiers(CFStringRef inUTI) 286 + { 287 + FMDatabaseQueue* dq = getDatabaseQueue(); 288 + if (!dq) 289 + return NULL; 290 + 291 + __block CFArrayRef retval = NULL; 292 + [dq inDatabase:^(FMDatabase* db) { 293 + FMResultSet* rs = [db executeQuery:@"select id, description from uti where type_identifier = ?", inUTI]; 294 + if ([rs next]) 295 + { 296 + NSNumber* utiId = [NSNumber numberWithInt: [rs intForColumn:@"id"]]; 297 + [rs close]; 298 + 299 + NSMutableArray* conformsTo = [[NSMutableArray alloc] init]; 300 + rs = [db executeQuery:@"select conforms_to from uti_conforms where uti = ?", utiId]; 301 + 302 + while ([rs next]) 303 + [conformsTo addObject: [rs stringForColumnIndex:0]]; 304 + 305 + [rs close]; 306 + 307 + retval = (CFArrayRef)[[NSArray alloc] initWithArray: conformsTo copyItems: YES]; 308 + [conformsTo release]; 309 + } 310 + else 311 + { 312 + [rs close]; 313 + } 314 + }]; 315 + 316 + return retval; 317 + } 318 + 284 319 CFStringRef 285 320 UTCreateStringForOSType(OSType inOSType) 286 321 {