Add static container types to Info.plist generator stub

CQTexperiment
Christopher Snowhill 2022-01-18 16:57:35 -08:00
parent 9085cf18df
commit f9ace87319
1 changed files with 30 additions and 16 deletions

View File

@ -361,11 +361,27 @@ static PluginController *sharedPluginController = nil;
[stringList addObject:plistHeader];
// These aren't handled by decoders, but as containers
NSArray * staticTypes = @[
@[@"M3U Playlist File", @"m3u.icns", @"m3u", @"m3u8"],
@[@"PLS Playlist File", @"pls.icns", @"pls"],
@[@"RAR Archive of SPC Files", @"vg.icns", @"rsn"],
@[@"7Z Archive of VGM Files", @"vg.icns", @"vgm7z"]
];
NSMutableArray * assocTypes = [[NSMutableArray alloc] init];
[assocTypes addObjectsFromArray:staticTypes];
for (NSString * decoderString in decodersRegistered) {
Class decoder = NSClassFromString(decoderString);
if (decoder && [decoder respondsToSelector:@selector(fileTypeAssociations)]) {
NSArray * types = [decoder fileTypeAssociations];
for (NSArray * type in types) {
[assocTypes addObjectsFromArray:types];
}
}
for (NSArray * type in assocTypes) {
[stringList addObject:@"\t\t<dict>\n\
\t\t\t<key>CFBundleTypeExtensions</key>\n\
\t\t\t<array>\n\
@ -390,8 +406,6 @@ static PluginController *sharedPluginController = nil;
\t\t\t<false/>\n\
\t\t</dict>\n"];
}
}
}
[stringList addObject:plistFooter];