//
//
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "mimetype.h"
-#endif
-
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// other standard headers
#include <ctype.h>
-#include <InternetConfig.h> //For mime types
+#ifndef __DARWIN__
+#include <InternetConfig.h> //For mime types
+#endif
/* START CODE SAMPLE FROM TECHNOTE 1002 (http://developer.apple.com/technotes/tn/tn1002.html) */
#if defined(__DARWIN__)
//on darwin, use launch services
-#include "LaunchServices.h"
+#include <ApplicationServices/ApplicationServices.h>
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
{
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; }
}
}
- static void PrintOutType(wxString& sMessage, wxString sValue, CFTypeRef cfRef)
+ static void PrintOutType(wxString& sMessage, const wxString& sValue, CFTypeRef cfRef)
{
sMessage << wxT(" {");
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;
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;
CFWriteStreamClose(cfwsInfo);
*/
-#endif //wxUSE_MIMETYPE
\ No newline at end of file
+#endif //wxUSE_MIMETYPE