buggy->fixed!!!

This commit is contained in:
doitux
2007-05-05 20:38:43 +00:00
parent 649418abe9
commit 363377b6a6
2 changed files with 15 additions and 7 deletions
+13 -5
View File
@@ -113,8 +113,8 @@ ConfigFile::ConfigFile(bool configFirstStart)
//Prüfen ob Configfile existiert --> sonst anlegen //Prüfen ob Configfile existiert --> sonst anlegen
TiXmlDocument doc(configFileName); TiXmlDocument doc(configFileName);
if(!doc.LoadFile()){ if(!doc.LoadFile()){
CONFIGSTATE = Inexistens; configState = nonexisting;
updateConfig(CONFIGSTATE); updateConfig(configState);
} }
else { else {
//Prüfen ob die Revision stimmt ansonsten löschen und neue anlegen //Prüfen ob die Revision stimmt ansonsten löschen und neue anlegen
@@ -123,8 +123,8 @@ ConfigFile::ConfigFile(bool configFirstStart)
TiXmlElement* conf = docHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).FirstChild( "ConfigRevision" ).ToElement(); TiXmlElement* conf = docHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).FirstChild( "ConfigRevision" ).ToElement();
if ( conf ) { conf->QueryIntAttribute("value", &temp ); } if ( conf ) { conf->QueryIntAttribute("value", &temp ); }
if (temp < configRev) { /*löschen()*/ if (temp < configRev) { /*löschen()*/
CONFIGSTATE = Old; configState = old;
updateConfig(CONFIGSTATE) ; updateConfig(configState) ;
} }
} }
} }
@@ -135,10 +135,18 @@ ConfigFile::~ConfigFile()
{ {
} }
void ConfigFile::updateConfig(CONFIGSTATE) { void ConfigFile::updateConfig(CONFIGSTATE myConfigState) {
QtToolsInterface *myQtToolsInterface = new QtToolsWrapper; QtToolsInterface *myQtToolsInterface = new QtToolsWrapper;
if(myConfigState == old) {
configFileName += "config.xml";
TiXmlDocument doc(configFileName);
TiXmlHandle docHandle( &doc );
TiXmlElement* conf = docHandle.FirstChild( "PokerTH" ).FirstChild( "Configuration" ).FirstChild( "ConfigRevision" ).ToElement();
}
//Anlegen! //Anlegen!
TiXmlDocument doc; TiXmlDocument doc;
TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "UTF-8", ""); TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "UTF-8", "");
+2 -2
View File
@@ -23,7 +23,7 @@
#include "tinyxml.h" #include "tinyxml.h"
#include <string> #include <string>
enum CONFIGSTATE { Inexistens, Old }; enum CONFIGSTATE { nonexisting, old };
class ConfigFile{ class ConfigFile{
public: public:
@@ -46,7 +46,7 @@ private:
std::string dataDir; std::string dataDir;
int configRev; int configRev;
CONFIGSTATE configState;
}; };
#endif #endif