--nowriteaccess first steps

This commit is contained in:
doitux
2007-05-16 09:03:12 +00:00
parent 846c9135bf
commit 58be35a777
@@ -64,29 +64,32 @@ void joinNetworkGameDialogImpl::exec() {
lineEdit_ipAddress->setFocus(); lineEdit_ipAddress->setFocus();
myServerProfilesFile = myConfig->readConfigString("DataDir")+"serverprofiles.xml"; if (myConfig->readConfigInt("CLA_NoWriteAccess") == 0 ) {
//if discwrite-access
myServerProfilesFile = myConfig->readConfigString("DataDir")+"serverprofiles.xml";
//Anlegen wenn noch nicht existiert! //Anlegen wenn noch nicht existiert!
QFile serverProfilesfile(QString::fromUtf8(myServerProfilesFile.c_str())); QFile serverProfilesfile(QString::fromUtf8(myServerProfilesFile.c_str()));
if(!serverProfilesfile.exists()) { if(!serverProfilesfile.exists()) {
TiXmlDocument doc; TiXmlDocument doc;
TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "UTF-8", ""); TiXmlDeclaration * decl = new TiXmlDeclaration( "1.0", "UTF-8", "");
doc.LinkEndChild( decl ); doc.LinkEndChild( decl );
TiXmlElement * root = new TiXmlElement( "PokerTH" ); TiXmlElement * root = new TiXmlElement( "PokerTH" );
doc.LinkEndChild( root ); doc.LinkEndChild( root );
TiXmlElement * profiles = new TiXmlElement( "ServerProfiles" ); TiXmlElement * profiles = new TiXmlElement( "ServerProfiles" );
root->LinkEndChild( profiles ); root->LinkEndChild( profiles );
doc.SaveFile( QString::fromUtf8(myServerProfilesFile.c_str()).toStdString() ); doc.SaveFile( QString::fromUtf8(myServerProfilesFile.c_str()).toStdString() );
}
//Liste Füllen
fillServerProfileList();
} }
//Liste Füllen
fillServerProfileList();
QDialog::exec(); QDialog::exec();
} }