wxFileSystem w/o wxUSE_MIMETYPE fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2001-12-07 22:39:35 +00:00
parent d9f54bb0c7
commit 659a606421

View File

@@ -35,10 +35,13 @@
IMPLEMENT_ABSTRACT_CLASS(wxFileSystemHandler, wxObject) IMPLEMENT_ABSTRACT_CLASS(wxFileSystemHandler, wxObject)
#if wxUSE_MIMETYPE
static wxFileTypeInfo *gs_FSMimeFallbacks = NULL; static wxFileTypeInfo *gs_FSMimeFallbacks = NULL;
#endif
wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location) wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location)
{ {
#if wxUSE_MIMETYPE
wxString ext = wxEmptyString, mime = wxEmptyString; wxString ext = wxEmptyString, mime = wxEmptyString;
wxString loc = GetRightLocation(location); wxString loc = GetRightLocation(location);
char c; char c;
@@ -67,6 +70,9 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location)
delete ft; delete ft;
return mime; return mime;
#else
return wxEmptyString;
#endif
} }
@@ -407,6 +413,7 @@ class wxFileSystemModule : public wxModule
{ {
wxFileSystem::AddHandler(new wxLocalFSHandler); wxFileSystem::AddHandler(new wxLocalFSHandler);
#if wxUSE_MIMETYPE
gs_FSMimeFallbacks = new wxFileTypeInfo[6]; gs_FSMimeFallbacks = new wxFileTypeInfo[6];
gs_FSMimeFallbacks[0] = gs_FSMimeFallbacks[0] =
wxFileTypeInfo("image/jpeg", wxFileTypeInfo("image/jpeg",
@@ -441,12 +448,14 @@ class wxFileSystemModule : public wxModule
gs_FSMimeFallbacks[5] = gs_FSMimeFallbacks[5] =
// must terminate the table with this! // must terminate the table with this!
wxFileTypeInfo(); wxFileTypeInfo();
#endif
return TRUE; return TRUE;
} }
virtual void OnExit() virtual void OnExit()
{ {
#if wxUSE_MIMETYPE
delete [] gs_FSMimeFallbacks; delete [] gs_FSMimeFallbacks;
#endif
wxFileSystem::CleanUpHandlers(); wxFileSystem::CleanUpHandlers();
} }
}; };