- ft = m_MimeMng.GetFileTypeFromExtension(ext);
- if (ft && (ft -> GetMimeType(&mime))) return mime;
- else return wxEmptyString;
+
+ static bool s_MinimalMimeEnsured = FALSE;
+ if (!s_MinimalMimeEnsured) {
+ static const wxFileTypeInfo fallbacks[] =
+ {
+ wxFileTypeInfo("image/jpeg",
+ "",
+ "",
+ "JPEG image (from fallback)",
+ "jpg", "jpeg", NULL),
+ wxFileTypeInfo("image/gif",
+ "",
+ "",
+ "GIF image (from fallback)",
+ "gif", NULL),
+ wxFileTypeInfo("image/png",
+ "",
+ "",
+ "PNG image (from fallback)",
+ "png", NULL),
+ wxFileTypeInfo("image/bmp",
+ "",
+ "",
+ "windows bitmap image (from fallback)",
+ "bmp", NULL),
+ wxFileTypeInfo("text/html",
+ "",
+ "",
+ "HTML document (from fallback)",
+ "htm", "html", NULL),
+
+ // must terminate the table with this!
+ wxFileTypeInfo()
+ };
+
+ wxTheMimeTypesManager -> AddFallbacks(fallbacks);
+ }
+
+ ft = wxTheMimeTypesManager -> GetFileTypeFromExtension(ext);
+ if ( !ft || !ft -> GetMimeType(&mime) ) {
+ mime = wxEmptyString;
+ }
+
+ delete ft;
+
+ return mime;