Changeset 178
- Timestamp:
- 10/08/2008 04:59:01 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/MainFrame.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MainFrame.cpp
r177 r178 41 41 #include <wx/version.h> 42 42 #include <wx/filename.h> 43 #include <wx/stdpaths.h> 43 44 44 45 //include the images for the dice … … 76 77 SetIcon(wxIcon(icon32_xpm)); 77 78 78 /* Check if there is configuration file under old-name and79 * rename it80 */81 wxString home_path = wxFileName::GetHomeDir();82 if (wxFileExists(home_path+wxT("/.OpenYahtzee"))) {83 // we don't won't to overwrite newer files.84 wxRenameFile(home_path+wxT("/.OpenYahtzee"),home_path+wxT("/.openyahtzee"),false);85 }86 87 88 std::string config_file;89 config_file = (home_path.utf8_str());90 79 #ifndef PORTABLE 91 config_file += "/.openyahtzee.new"; 80 wxString config_file = wxStandardPaths::Get().GetUserConfigDir() + wxT("/.openyahtzee"); 81 wxString old_config_file = wxFileName::GetHomeDir() + wxT("/.OpenYahtzee"); 82 //rename old configuration file 83 if (wxFileExists(old_config_file)) { 84 wxRenameFile(old_config_file,config_file,false); 85 } 92 86 #else 93 config_file += "/openyahtzee.dat";87 wxString config_file = wxStandardPaths::Get().GetExecutablePath() + wxT("/openyahtzee.dat"); 94 88 #endif 95 89 96 m_config = new configuration::Configuration(config_file); 90 91 std::string config_file_str; 92 config_file_str = config_file.utf8_str(); 93 m_config = new configuration::Configuration(config_file_str); 97 94 98 95 m_evt_handler = new MainFrameEvtHandler(this);
Note: See TracChangeset
for help on using the changeset viewer.
