X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/509201463dbd3bce8aff762c664b111a8f2c3412..9e855852c1bc24ddd49b69df5290111022a96093:/src/common/mimetype.cpp diff --git a/src/common/mimetype.cpp b/src/common/mimetype.cpp index 901d85ffb1..2ff0df4d34 100644 --- a/src/common/mimetype.cpp +++ b/src/common/mimetype.cpp @@ -10,34 +10,32 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ - #pragma implementation "mimetype.h" +#pragma implementation "mimetype.h" #endif -// ============================================================================ -// declarations -// ============================================================================ - -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop + #pragma hdrstop #endif -// wxWindows #ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/icon.h" + #include "wx/defs.h" +#endif + +#if (wxUSE_FILE && wxUSE_TEXTFILE) || defined(__WXMSW__) + +#ifndef WX_PRECOMP + #include "wx/string.h" + #include "wx/icon.h" #endif //WX_PRECOMP // Doesn't compile in WIN16 mode #ifndef __WIN16__ #include "wx/log.h" +#include "wx/file.h" #include "wx/intl.h" #include "wx/dynarray.h" #include "wx/confbase.h" @@ -100,14 +98,14 @@ public: bool GetDescription(wxString *desc) const; bool GetOpenCommand(wxString *openCmd, const wxFileType::MessageParameters&) const - { return GetCommand(openCmd, "open"); } + { return GetCommand(openCmd, _T("open")); } bool GetPrintCommand(wxString *printCmd, const wxFileType::MessageParameters&) const - { return GetCommand(printCmd, "print"); } + { return GetCommand(printCmd, _T("print")); } private: // helper function - bool GetCommand(wxString *command, const char *verb) const; + bool GetCommand(wxString *command, const wxChar *verb) const; wxString m_strFileType, m_ext; }; @@ -477,7 +475,7 @@ bool wxMimeTypesManager::IsOfType(const wxString& mimeType, { wxString strSubtype = wildcard.AfterFirst(_T('/')); - if ( strSubtype == _T('*') || + if ( strSubtype == _T("*") || strSubtype.IsSameAs(mimeType.AfterFirst(_T('/')), FALSE) ) { // matches (either exactly or it's a wildcard) @@ -621,7 +619,7 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon) const } wxString strExpPath = wxExpandEnvVars(strFullPath); - int nIndex = atoi(strIndex); + int nIndex = wxAtoi(strIndex); HICON hIcon = ExtractIcon(GetModuleHandle(NULL), strExpPath, nIndex); switch ( (int)hIcon ) { @@ -1341,7 +1339,11 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, return TRUE; } -#endif // OS type +#endif + // OS type + +#endif + // wxUSE_FILE && wxUSE_TEXTFILE #endif // __WIN16__