path/file corrections for Darwin/Mac OS X

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2001-10-29 22:26:59 +00:00
parent 334d244877
commit e7e1b01eb5
4 changed files with 38 additions and 43 deletions

View File

@@ -257,7 +257,7 @@ wxString wxFileConfig::GetGlobalDir()
#ifdef __VMS__ // Note if __VMS is defined __UNIX is also defined
strDir = wxT("sys$manager:");
#elif defined(__WXMAC__)
strDir = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ;
strDir = wxMacFindFolder( (short) kOnSystemDisk, kPreferencesFolderType, kDontCreateFolder ) ;
#elif defined( __UNIX__ )
strDir = wxT("/etc/");
#elif defined(__WXPM__)
@@ -368,20 +368,20 @@ wxString wxFileConfig::GetLocalDir()
{
wxString strDir;
#ifndef __WXMAC__
#if defined(__WXMAC__)
// no local dir concept on Mac OS 9
return GetGlobalDir() ;
#else
wxGetHomeDir(&strDir);
#ifdef __UNIX__
#ifdef __VMS
if (strDir.Last() != wxT(']'))
#endif
if (strDir.Last() != wxT('/')) strDir << wxT('/');
#else
# ifdef __UNIX__
# ifdef __VMS
if (strDir.Last() != wxT(']'))
# endif
if (strDir.Last() != wxT('/')) strDir << wxT('/');
# else
if (strDir.Last() != wxT('\\')) strDir << wxT('\\');
#endif
#else
// no local dir concept on mac
return GetGlobalDir() ;
# endif
#endif
return strDir;
@@ -393,10 +393,10 @@ wxString wxFileConfig::GetGlobalFileName(const wxChar *szFile)
str << szFile;
if ( wxStrchr(szFile, wxT('.')) == NULL )
#ifdef __UNIX__
str << wxT(".conf");
#elif defined( __WXMAC__ )
#if defined( __WXMAC__ )
str << " Preferences";
#elif defined( __UNIX__ )
str << wxT(".conf");
#else // Windows
str << wxT(".ini");
#endif // UNIX/Win
@@ -414,7 +414,7 @@ wxString wxFileConfig::GetLocalFileName(const wxChar *szFile)
wxString str = GetLocalDir();
#endif
#if defined( __UNIX__ ) && !defined( __VMS )
#if defined( __UNIX__ ) && !defined( __VMS ) && !defined( __WXMAC__ )
str << wxT('.');
#endif
@@ -425,7 +425,6 @@ wxString wxFileConfig::GetLocalFileName(const wxChar *szFile)
str << wxT(".ini");
#endif
#ifdef __WXMAC__
str << " Preferences";
#endif
@@ -950,7 +949,7 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */)
bool ret = file.Commit();
#if defined(__WXMAC__) && !defined(__UNIX__)
#if defined(__WXMAC__)
if ( ret )
{
FSSpec spec ;
@@ -964,7 +963,7 @@ bool wxFileConfig::Flush(bool /* bCurrentOnly */)
FSpSetFInfo( &spec , &finfo ) ;
}
}
#endif // __WXMAC__ && !__UNIX__
#endif // __WXMAC__
#ifdef __UNIX__
// restore the old umask if we changed it