#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;
}
}
}
+#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
}
// ----------------------------------------------------------------------------