X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/54ff4a701f6c83aad8387a31b652f209681210cb..a3c1786def55bcc233f9606acb1aceee956d184f:/samples/forty/scorefil.cpp diff --git a/samples/forty/scorefil.cpp b/samples/forty/scorefil.cpp index aa53f764fe..348be7cfe7 100644 --- a/samples/forty/scorefil.cpp +++ b/samples/forty/scorefil.cpp @@ -41,7 +41,7 @@ ScoreFile::ScoreFile(const char* appName) { -#ifdef 0 +#if 0 wxString filename; m_configFilename << "/usr/local/share/" << appName << ".scores"; if (access(m_configFilename, F_OK) == 0) @@ -69,11 +69,7 @@ ScoreFile::ScoreFile(const char* appName) } #endif -#ifdef __UNIX__ - m_config = new wxFileConfig( appName, "" ); // only local -#else - m_config = new wxFileConfig( "",appName ); // only global -#endif + m_config = new wxConfig(appName, "wxWindows", appName, "", wxCONFIG_USE_LOCAL_FILE); // only local } ScoreFile::~ScoreFile() @@ -132,7 +128,7 @@ wxString ScoreFile::GetPreviousPlayer() const { wxString result; m_config->SetPath("/General"); - m_config->Read(&result, "LastPlayer"); + m_config->Read("LastPlayer", &result); return result; } @@ -149,10 +145,10 @@ void ScoreFile::ReadPlayersScore( m_config->SetPath("/Players"); m_config->SetPath(player); - if (m_config->Read(&myScore, "Score") && - m_config->Read(&myGames, "Games") && - m_config->Read(&myWins, "Wins") && - m_config->Read(&check, "Check")) + if (m_config->Read("Score", &myScore, 0L) && + m_config->Read("Games", &myGames, 0L) && + m_config->Read("Wins", &myWins, 0L) && + m_config->Read("Check", &check, 0L)) { if (check != CalcCheck(player, myGames, myWins, myScore)) { @@ -179,9 +175,9 @@ void ScoreFile::WritePlayersScore(const char* player, int wins, int games, int s m_config->SetPath("/Players"); m_config->SetPath(player); - m_config->Write("Score", score); - m_config->Write("Games", games); - m_config->Write("Wins", wins); + m_config->Write("Score", (long)score); + m_config->Write("Games", (long)games); + m_config->Write("Wins", (long)wins); m_config->Write("Check", CalcCheck(player, games, wins, score)); } }