Use the dynamic property instead of testing identifier serialization

This commit is contained in:
Kovid Goyal 2022-09-09 15:39:00 +05:30
parent b123c21010
commit 79fba9dd9a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2517,7 +2517,7 @@ mime_to_uti(const char *mime) {
if (strcmp(mime, "text/plain") == 0) return NSPasteboardTypeString;
if (@available(macOS 11.0, *)) {
UTType *t = [UTType typeWithMIMEType:@(mime)]; // auto-released
if (t != nil && ![t.identifier hasPrefix:@"dyn."]) return t.identifier;
if (t != nil && !t.dynamic) return t.identifier;
}
return [NSString stringWithFormat:@"%@%s", UTI_ROUNDTRIP_PREFIX, mime]; // auto-released
}