-wxString wxFileTypeImpl::GetCommand(const wxString& verb) const
-{
- wxASSERT_MSG( m_manager != NULL , wxT("Bad wxFileType") );
-
- if(verb == wxT("open"))
- {
- ICMapEntry entry;
- ICGetMapEntry( (ICInstance) m_manager->m_hIC,
- (Handle) m_manager->m_hDatabase,
- m_lIndex, &entry);
-
- //The entry in the mimetype database only contains the app
- //that's registered - it may not exist... we need to remap the creator
- //type and find the right application
-
- // THIS IS REALLY COMPLICATED :\. There are a lot of conversions going
- // on here.
- Str255 outName;
- FSSpec outSpec;
- if(FindApplication(entry.fileCreator, false, outName, &outSpec) != noErr)
- return wxEmptyString;
-
- Handle outPathHandle;
- short outPathSize;
- OSErr err = FSpGetFullPath(&outSpec, &outPathSize, &outPathHandle);
-
- if(err == noErr)
- {
- char* szPath = *outPathHandle;
- wxString sClassicPath(szPath, wxConvLocal, outPathSize);
-#if defined(__DARWIN__)
- //Classic Path --> Unix (OSX) Path
- CFURLRef finalURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
- wxMacCFStringHolder(sClassicPath, wxLocale::GetSystemEncoding()),
- kCFURLHFSPathStyle,
- false); //false == not a directory
-
- //clean up memory from the classic path handle
- DisposeHandle(outPathHandle);
-
- if(finalURL)