Commits

Martijn The committed 03a89f5

Changed the preview generator code to return only supported UTIs

  • Participants
  • Parent commits 776e867

Comments (0)

Files changed (1)

NSURLConnectionVCRQuicklook/VCRGetPreview.m

             *mimeType = _mimeType;
         }
         if (utType) {
-            *utType = (__bridge NSString*)UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (__bridge CFStringRef)_mimeType, NULL);
+            CFStringRef supportedTypes[] = {kUTTypeHTML, kUTTypeXML, kUTTypeRTF, kUTTypePlainText, kUTTypeImage, kUTTypePDF, kUTTypeMovie, kUTTypeAudio, NULL};
+            for (NSInteger idx = 0; idx < 9; ++idx) {
+                *utType = (__bridge NSString*)UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (__bridge CFStringRef)_mimeType, supportedTypes[idx]);
+                if (*utType != nil) {
+                    break;
+                }
+            }
         }
         
         return noErr;