X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6e7ce6246c2952fd844f6b3f05f25719d82e0584..5f9fd7ea86d211e3681a71c9f70303aa72b5de3c:/src/msw/mimetype.cpp diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index e499d2b960..e78a77cac0 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: common/mimetype.cpp +// Name: msw/mimetype.cpp // Purpose: classes and functions to manage MIME types // Author: Vadim Zeitlin // Modified by: @@ -20,11 +20,8 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/defs.h" -#endif - -#if (wxUSE_FILE && wxUSE_TEXTFILE) || defined(__WXMSW__) +// Doesn't compile in WIN16 mode +#ifndef __WIN16__ #ifndef WX_PRECOMP #include "wx/string.h" @@ -33,9 +30,6 @@ #endif #endif //WX_PRECOMP -// Doesn't compile in WIN16 mode -#ifndef __WIN16__ - #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" @@ -45,12 +39,6 @@ #ifdef __WXMSW__ #include "wx/msw/registry.h" #include "windows.h" -#elif defined(__UNIX__) || defined(__WXPM__) - #include "wx/ffile.h" - #include "wx/textfile.h" - #include "wx/dir.h" - #include "wx/utils.h" - #include "wx/tokenzr.h" #endif // OS #include "wx/msw/mimetype.h" @@ -61,7 +49,6 @@ // in case we're compiling in non-GUI mode class WXDLLEXPORT wxIcon; - // These classes use Windows registry to retrieve the required information. // // Keys used (not all of them are documented, so it might actually stop working @@ -86,9 +73,6 @@ class WXDLLEXPORT wxIcon; // location, uses it, so it isn't likely to change static const wxChar *MIME_DATABASE_KEY = wxT("MIME\\Database\\Content Type\\"); - - - wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const { // suppress possible error messages @@ -251,6 +235,22 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const } } + +bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const +{ + wxString s; + + if (GetMimeType(&s)) + { + mimeTypes.Clear(); + mimeTypes.Add(s); + return TRUE; + } + else + return FALSE; +} + + bool wxFileTypeImpl::GetIcon(wxIcon *icon) const { #if wxUSE_GUI @@ -447,8 +447,5 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) } -#endif - // wxUSE_FILE && wxUSE_TEXTFILE - #endif // __WIN16__