- 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);
- }
+ static const wxFileTypeInfo fallbacks[] =
+ {
+ wxFileTypeInfo(wxT("image/jpeg"),
+ wxEmptyString,
+ wxEmptyString,
+ wxT("JPEG image (from fallback)"),
+ wxT("jpg"), wxT("jpeg"), wxT("JPG"), wxT("JPEG"), wxNullPtr),
+ wxFileTypeInfo(wxT("image/gif"),
+ wxEmptyString,
+ wxEmptyString,
+ wxT("GIF image (from fallback)"),
+ wxT("gif"), wxT("GIF"), wxNullPtr),
+ wxFileTypeInfo(wxT("image/png"),
+ wxEmptyString,
+ wxEmptyString,
+ wxT("PNG image (from fallback)"),
+ wxT("png"), wxT("PNG"), wxNullPtr),
+ wxFileTypeInfo(wxT("image/bmp"),
+ wxEmptyString,
+ wxEmptyString,
+ wxT("windows bitmap image (from fallback)"),
+ wxT("bmp"), wxT("BMP"), wxNullPtr),
+ wxFileTypeInfo(wxT("text/html"),
+ wxEmptyString,
+ wxEmptyString,
+ wxT("HTML document (from fallback)"),
+ wxT("htm"), wxT("html"), wxT("HTM"), wxT("HTML"), wxNullPtr),
+ // must terminate the table with this!
+ wxFileTypeInfo()
+ };
+ wxTheMimeTypesManager->AddFallbacks(fallbacks);
+ s_MinimalMimeEnsured = true;
+ }
+
+ wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext);
+ if ( !ft || !ft -> GetMimeType(&mime) )
+ {
+ mime = wxEmptyString;
+ }
+
+ delete ft;