X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01aefd229e82820455518e9feab1af5058433a1b..ea8ca011a351c6aaa4009bedbf0cec19a7c57d98:/src/mac/carbon/mimetmac.cpp diff --git a/src/mac/carbon/mimetmac.cpp b/src/mac/carbon/mimetmac.cpp index 5516810999..634c70065c 100644 --- a/src/mac/carbon/mimetmac.cpp +++ b/src/mac/carbon/mimetmac.cpp @@ -26,10 +26,6 @@ // // -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "mimetype.h" -#endif - // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -58,8 +54,10 @@ // other standard headers #include -#include //For mime types +#ifndef __DARWIN__ +#include //For mime types +#endif /* START CODE SAMPLE FROM TECHNOTE 1002 (http://developer.apple.com/technotes/tn/tn1002.html) */ @@ -389,7 +387,7 @@ wxFileTypeImpl::GetPrintCommand(wxString *printCmd, #if defined(__DARWIN__) //on darwin, use launch services -#include "LaunchServices.h" +#include wxString wxFileTypeImpl::GetCommand(const wxString& verb) const { @@ -420,8 +418,9 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const CFRelease(cfurlAppPath); //PHEW! Success! + //Since a filename might have spaces in it, so surround it with quotes if(cfsUnixPath) - return wxMacCFStringHolder(cfsUnixPath).AsString(wxLocale::GetSystemEncoding()); + return wxString(wxT("'")) + wxMacCFStringHolder(cfsUnixPath).AsString(wxLocale::GetSystemEncoding()) + wxString(wxT("'")); } else { @@ -906,7 +905,7 @@ public: bool Exists(CFTypeRef cftKey) const { wxASSERT(IsValid()); - return CFDictionaryContainsKey((CFDictionaryRef)m_cfmdRef, cftKey) == true; + return CFDictionaryContainsKey((CFDictionaryRef)m_cfmdRef, cftKey); } bool IsOk() const {return m_cfmdRef != NULL; } @@ -970,7 +969,7 @@ public: } } - static void PrintOutType(wxString& sMessage, wxString sValue, CFTypeRef cfRef) + static void PrintOutType(wxString& sMessage, const wxString& sValue, CFTypeRef cfRef) { sMessage << wxT(" {"); @@ -1359,9 +1358,9 @@ void wxCFDictionary::MakeValidXML() cfdCurrent.MakeValidXML(); Set(pKeys[i], cfdCurrent); } - else if( ( CFGetTypeID(cfRef) == CFStringGetTypeID() || - CFGetTypeID(cfRef) == CFNumberGetTypeID() || - CFGetTypeID(cfRef) == CFBooleanGetTypeID() ) == false ) + else if ( CFGetTypeID(cfRef) != CFStringGetTypeID() && + CFGetTypeID(cfRef) != CFNumberGetTypeID() && + CFGetTypeID(cfRef) != CFBooleanGetTypeID() ) { Remove(pKeys[i]); --i; @@ -1406,9 +1405,9 @@ void wxCFArray::MakeValidXML() cfdCurrent.MakeValidXML(); Set(i, cfdCurrent); } - else if( ( CFGetTypeID(cfRef) == CFStringGetTypeID() || - CFGetTypeID(cfRef) == CFNumberGetTypeID() || - CFGetTypeID(cfRef) == CFBooleanGetTypeID() ) == false ) + else if ( CFGetTypeID(cfRef) != CFStringGetTypeID() && + CFGetTypeID(cfRef) != CFNumberGetTypeID() && + CFGetTypeID(cfRef) != CFBooleanGetTypeID() ) { Remove(i); --i; @@ -2006,4 +2005,4 @@ wxMimeTypesManagerImpl::Unassociate(wxFileType *pFileType) CFWriteStreamClose(cfwsInfo); */ -#endif //wxUSE_MIMETYPE \ No newline at end of file +#endif //wxUSE_MIMETYPE