X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..0576cd9ebe3430bdf7acf69e1dd1df92273f32ad:/demos/forty/scorefil.cpp diff --git a/demos/forty/scorefil.cpp b/demos/forty/scorefil.cpp index f85ec62988..e49fb6afce 100644 --- a/demos/forty/scorefil.cpp +++ b/demos/forty/scorefil.cpp @@ -33,34 +33,6 @@ ScoreFile::ScoreFile(const wxString& appName) { -#if 0 - wxString filename; - m_configFilename << "/usr/local/share/" << appName << ".scores"; - if (access(m_configFilename, F_OK) == 0) - { - if (access(m_configFilename, R_OK | W_OK) != 0) - { - // file is not r/w - use local file instead - m_configFilename = wxFileConfig::GetLocalFileName(appName); - } - } - else - { - int fd = creat(m_configFilename, 0666); - - if (fd < 0) - { - // failed to create file - use local file instead - m_configFilename = wxFileConfig::GetLocalFileName(appName); - } - else - { - // ensure created file has rw-rw-rw permissions - close(fd); - } - } -#endif - m_config = new wxConfig(appName, _T("wxWidgets"), appName, wxEmptyString, wxCONFIG_USE_LOCAL_FILE); // only local } @@ -68,11 +40,6 @@ ScoreFile::ScoreFile(const wxString& appName) ScoreFile::~ScoreFile() { delete m_config; -#ifdef __WXGTK__ - // ensure score file has rw-rw-rw permissions - // (wxFileConfig sets them to rw-------) - chmod(m_configFilename, 0666); -#endif } @@ -161,7 +128,7 @@ void ScoreFile::ReadPlayersScore( void ScoreFile::WritePlayersScore(const wxString& player, int wins, int games, int score) { - if (player) + if (!player.empty()) { m_config->SetPath(_T("/General")); m_config->Write(_T("LastPlayer"), wxString(player)); // Without wxString tmp, thinks it's bool in VC++