X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cc3dd6fce971ee806f29adee5f8653852425f1cd..8b2bac626c3fb981dad0d3e6d04a9b16744022d6:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index f2118e743e..ef5c6c6d13 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -997,19 +997,23 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */) bool ret = file.Commit(); #if defined(__WXMAC__) - if ( ret ) - { - FSSpec spec ; - - wxMacFilename2FSSpec( m_strLocalFile , &spec ) ; - FInfo finfo ; - if ( FSpGetFInfo( &spec , &finfo ) == noErr ) - { - finfo.fdType = 'TEXT' ; - finfo.fdCreator = 'ttxt' ; - FSpSetFInfo( &spec , &finfo ) ; - } - } + if ( ret ) + { + FSRef fsRef ; + FSCatalogInfo catInfo; + FileInfo *finfo ; + + if ( wxMacPathToFSRef( m_strLocalFile , &fsRef ) == noErr ) + { + if ( FSGetCatalogInfo (&fsRef, kFSCatInfoFinderInfo, &catInfo, NULL, NULL, NULL) == noErr ) + { + finfo = (FileInfo*)&catInfo.finderInfo; + finfo->fileType = 'TEXT' ; + finfo->fileCreator = 'ttxt' ; + FSSetCatalogInfo( &fsRef, kFSCatInfoFinderInfo, &catInfo ) ; + } + } + } #endif // __WXMAC__ #ifdef __UNIX__