X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c68fb912d13e55b5627fdecfa8bb8f80e1ee23b..d9ff0f91fbddae88286567cab74dcfb59c91fc0f:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 643dd14fdf..a4cefd642a 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -199,19 +199,7 @@ wxString wxFileConfig::GetGlobalDir() #elif defined(__WXSTUBS__) wxASSERT_MSG( FALSE, wxT("TODO") ) ; #elif defined(__WXMAC__) - { - short vRefNum ; - long dirID ; - - if ( FindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder, &vRefNum, &dirID) == noErr) - { - FSSpec file ; - if ( FSMakeFSSpec( vRefNum , dirID , "\p" , &file ) == noErr ) - { - strDir = wxMacFSSpec2UnixFilename( &file ) + "/" ; - } - } - } + strDir = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ; #else // Windows wxChar szWinDir[MAX_PATH]; ::GetWindowsDirectory(szWinDir, MAX_PATH); @@ -230,13 +218,14 @@ wxString wxFileConfig::GetLocalDir() #ifndef __WXMAC__ wxGetHomeDir(&strDir); -#ifndef __VMS__ -# ifdef __UNIX__ - if (strDir.Last() != wxT('/')) strDir << wxT('/'); +#ifdef __UNIX__ +#ifdef __VMS + if (strDir.Last() != wxT(']')) +#endif + if (strDir.Last() != wxT('/')) strDir << wxT('/'); #else if (strDir.Last() != wxT('\\')) strDir << wxT('\\'); #endif -#endif #else // no local dir concept on mac return GetGlobalDir() ; @@ -267,12 +256,12 @@ wxString wxFileConfig::GetLocalFileName(const wxChar *szFile) #ifdef __VMS__ // On VMS I saw the problem that the home directory was appended // twice for the configuration file. Does that also happen for other // platforms? - wxString str = wxT( ' ' ); + wxString str = wxT( '.' ); #else wxString str = GetLocalDir(); #endif - #ifdef __UNIX__ + #if defined( __UNIX__ ) && !defined( __VMS ) str << wxT('.'); #endif @@ -808,12 +797,12 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */) bool ret = file.Commit(); -#ifdef __WXMAC__ +#if defined(__WXMAC__) && !defined(__UNIX__) if ( ret ) { FSSpec spec ; - wxUnixFilename2FSSpec( m_strLocalFile , &spec ) ; + wxMacFilename2FSSpec( m_strLocalFile , &spec ) ; FInfo finfo ; if ( FSpGetFInfo( &spec , &finfo ) == noErr ) { @@ -822,7 +811,7 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */) FSpSetFInfo( &spec , &finfo ) ; } } -#endif // __WXMAC__ +#endif // __WXMAC__ && !__UNIX__ #ifdef __UNIX__ // restore the old umask if we changed it