Changeset 170 for trunk/src


Ignore:
Timestamp:
10/03/2008 08:17:22 PM (4 years ago)
Author:
guyru
Message:

code cleanup

Location:
trunk/src
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MainFrame.cpp

    r169 r170  
    3333#include "highscores_dialog.h" 
    3434#include "About.h" 
    35 #include "UtilityFunctions.h" 
    3635#include "configuration.h" 
    3736#include "settings_dialog.h" 
     37#include "../config.h" 
    3838#include <iostream> 
    3939#include <sstream> 
     
    6868#endif 
    6969#define VER_DICE_SPACER 10 
    70  
    71 //default values - settings 
    72 #define DEF_HIGHSCORESIZE 20 
    73 #define OY_VERSION "1.8.0" 
    7470 
    7571const wxEventType wxEVT_ENABLE_ROLL = wxNewEventType(); 
     
    413409        wxString link = wxT("http://openyahtzee.sourceforge.net/download/check-for-updates/"); 
    414410         
    415         link += wxT(OY_VERSION); 
     411        link += wxT(VERSION); 
    416412 
    417413        wxLaunchDefaultBrowser(link); 
     
    13321328        delete m_config; 
    13331329        delete m_evt_handler; 
    1334 } 
     1330 
     1331        for (int i = 0; i<6; i++) { 
     1332                delete bitmap_dice[i]; 
     1333        } 
     1334} 
  • trunk/src/Makefile.am

    r169 r170  
    1414        settings_dialog.h \ 
    1515        ScoreDice.cpp \ 
    16         UtilityFunctions.cpp \ 
    1716        wxDynamicBitmap.cpp \ 
    1817        one.xpm \ 
     
    3635        ObjectsID.h \ 
    3736        ScoreDice.h \ 
    38         UtilityFunctions.h \ 
    3937        wxDynamicBitmap.h 
    4038 
  • trunk/src/configuration.cpp

    r167 r170  
    1919 ***************************************************************************/ 
    2020 
    21 #include <iostream> 
    2221#include <cstdlib> // used in the back-compatibility code 
    2322#include <sstream> 
     
    3736        m_file = file; 
    3837 
    39         cerr<<"loading file: "<<file<<endl; 
    4038        ifstream conf_file (file.c_str()); 
    4139        if (!conf_file.is_open()) { 
    4240                // file couldn't be opened, this is due to missing file or 
    4341                // permission error. 
    44                 cerr<<"Error openning configuration file for reading: "<<m_file<<endl; 
     42                loadDefaultSettings(); 
     43                save(); 
     44                return; 
    4545        } 
    4646         
     
    4949        string header; 
    5050        getline(conf_file,header); 
    51         cerr<<"line: "<<header.substr(0,11)<<endl; 
    5251        if (header.substr(0,11) != "openyahtzee") { 
    5352                // this is probably an old sqllite file import it. 
     
    5958        while(!conf_file.eof()) { 
    6059                getline(conf_file,header); 
    61                 cerr<<"line: "<<header<<endl; 
    6260                if (header == "[settings]") { 
    6361                        parseSettings(&conf_file); 
     
    7371{ 
    7472        loadDefaultSettings(); 
    75         cerr<<"parsing settings"<<endl; 
    7673        string temp_line; 
    7774        size_t pos; // used to loacate the '=' sign 
     
    9188                        return; 
    9289                } 
    93                 cerr<<"key: "<<temp_line.substr(0,pos)<<endl; 
    94                 cerr<<"value: "<<temp_line.substr(pos+1)<<endl; 
    9590                m_settings[temp_line.substr(0,pos)] = temp_line.substr(pos+1); 
    9691        } 
     
    124119                temp_item.date = date+" "+hour; 
    125120                m_highscores.push_back(temp_item); 
    126                 cerr<<score<<" "<<name<<" "<<temp_item.date<<endl; 
    127121 
    128122                // The following two lines read one character forword and 
     
    139133        ofstream conf_file (m_file.c_str()); 
    140134        if (!conf_file.is_open()) { 
    141                 // file couldn't be opened, this is due to missing file or 
    142                 // permission error. 
    143                 cerr<<"Error openning configuration file for writing: "<<m_file<<endl; 
     135                // file couldn't be opened, probably due to permission error 
     136                return; 
    144137        } 
    145138        conf_file<<"openyahtzee="<<VERSION<<endl; 
Note: See TracChangeset for help on using the changeset viewer.