#elif defined(__WXSTUBS__)
wxASSERT_MSG( FALSE, wxT("TODO") ) ;
#elif defined(__WXMAC__)
- wxASSERT_MSG( FALSE, wxT("TODO") ) ;
+ {
+ 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 ) + "/" ;
+ }
+ }
+ }
#else // Windows
wxChar szWinDir[MAX_PATH];
::GetWindowsDirectory(szWinDir, MAX_PATH);
{
wxString strDir;
+#ifndef __WXMAC__
wxGetHomeDir(&strDir);
#ifdef __UNIX__
#else
if (strDir.Last() != wxT('\\')) strDir << wxT('\\');
#endif
+#else
+ // no local dir concept on mac
+ return GetGlobalDir() ;
+#endif
return strDir;
}
if ( wxStrchr(szFile, wxT('.')) == NULL )
#ifdef __UNIX__
str << wxT(".conf");
+ #elif defined( __WXMAC__ )
+ str << " Preferences";
#else // Windows
str << wxT(".ini");
#endif // UNIX/Win
str << wxT(".ini");
#endif
+
+ #ifdef __WXMAC__
+ str << " Preferences";
+ #endif
return str;
}
// if the path is not absolute, prepend the standard directory to it
// UNLESS wxCONFIG_USE_RELATIVE_PATH style is set
- if ( !(style & wxCONFIG_USE_RELATIVE_PATH) ){
- if ( !m_strLocalFile.IsEmpty() && !wxIsAbsolutePath(m_strLocalFile) )
- {
- wxString strLocal = m_strLocalFile;
- m_strLocalFile = GetLocalDir();
- m_strLocalFile << strLocal;
- }
-
- if ( !m_strGlobalFile.IsEmpty() && !wxIsAbsolutePath(m_strGlobalFile) )
- {
- wxString strGlobal = m_strGlobalFile;
- m_strGlobalFile = GetGlobalDir();
- m_strGlobalFile << strGlobal;
- }
+ if ( !(style & wxCONFIG_USE_RELATIVE_PATH) )
+ {
+ if ( !m_strLocalFile.IsEmpty() && !wxIsAbsolutePath(m_strLocalFile) )
+ {
+ wxString strLocal = m_strLocalFile;
+ m_strLocalFile = GetLocalDir();
+ m_strLocalFile << strLocal;
+ }
+
+ if ( !m_strGlobalFile.IsEmpty() && !wxIsAbsolutePath(m_strGlobalFile) )
+ {
+ wxString strGlobal = m_strGlobalFile;
+ m_strGlobalFile = GetGlobalDir();
+ m_strGlobalFile << strGlobal;
+ }
}
Init();
}
}
+#ifndef __WXMAC__
return file.Commit();
+#else
+ bool ret = file.Commit();
+ if ( ret )
+ {
+ FSSpec spec ;
+
+ wxUnixFilename2FSSpec( m_strLocalFile , &spec ) ;
+ FInfo finfo ;
+ if ( FSpGetFInfo( &spec , &finfo ) == noErr )
+ {
+ finfo.fdType = 'TEXT' ;
+ finfo.fdCreator = 'ttxt' ;
+ FSpSetFInfo( &spec , &finfo ) ;
+ }
+ }
+ return ret ;
+#endif
}
// ----------------------------------------------------------------------------