X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a24217f0500b95e77eee83fb42887ce8e5083157..f523d7ce03423208d2843ce39f1f0357da5bd987:/src/unix/mimetype.cpp diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 8a91d72f82..e2e68bd09a 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -38,26 +38,26 @@ #if wxUSE_MIMETYPE && wxUSE_FILE && wxUSE_TEXTFILE +#include "wx/unix/mimetype.h" + #ifndef WX_PRECOMP + #include "wx/dynarray.h" #include "wx/string.h" + #include "wx/intl.h" + #include "wx/log.h" + #include "wx/utils.h" #endif -#include "wx/log.h" #include "wx/file.h" -#include "wx/intl.h" -#include "wx/dynarray.h" #include "wx/confbase.h" #include "wx/ffile.h" #include "wx/textfile.h" #include "wx/dir.h" -#include "wx/utils.h" #include "wx/tokenzr.h" #include "wx/iconloc.h" #include "wx/filename.h" -#include "wx/unix/mimetype.h" - #if wxUSE_LIBGNOMEVFS // Not GUI dependent #include "wx/gtk/gnome/gvfs.h" @@ -280,7 +280,7 @@ void wxMimeTypesManagerImpl::LoadGnomeDataFromKeyFile(const wxString& filename, { wxTextFile textfile(filename); #if defined(__WXGTK20__) && wxUSE_UNICODE - if ( !textfile.Open(wxConvUTF8) ) + if ( !textfile.Open(wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_OCTAL)) ) #else if ( !textfile.Open() ) #endif @@ -1434,7 +1434,7 @@ bool wxMimeTypesManagerImpl::WriteToMimeTypes(int index, bool delete_index) nIndex = file.pIndexOf(wxT("#--Netscape")); if (nIndex != wxNOT_FOUND) { - wxASSERT_MSG(false,wxT("Error in .mime.types \nTrying to mix Netscape and Metamail formats\nFile not modiifed")); + wxFAIL_MSG(wxT("Error in .mime.types\nTrying to mix Netscape and Metamail formats\nFile not modified")); return false; } @@ -1501,7 +1501,7 @@ bool wxMimeTypesManagerImpl::WriteToNSMimeTypes(int index, bool delete_index) // metamail entreies if (file.GetLineCount() > 0) { - wxASSERT_MSG(false, wxT(".mime.types File not in Netscape format\nNo entries written to\n.mime.types or to .mailcap")); + wxFAIL_MSG(wxT(".mime.types File not in Netscape format\nNo entries written to\n.mime.types or to .mailcap")); return false; } @@ -2643,6 +2643,8 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) bool wxMimeTypesManagerImpl::Unassociate(wxFileType *ft) { + InitIfNeeded(); + wxArrayString sMimeTypes; ft->GetMimeTypes(sMimeTypes);