one ConfigFile for all
This commit is contained in:
@@ -24,14 +24,14 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent, ConfigFile *c)
|
||||
: QDialog(parent), myConfig(c)
|
||||
{
|
||||
bool toIntTrue;
|
||||
|
||||
setupUi(this);
|
||||
|
||||
spinBox_port->setValue(QString::fromUtf8(myConfig.readConfigString("ServerPort").c_str()).toInt(&toIntTrue, 10));
|
||||
spinBox_port->setValue(QString::fromUtf8(myConfig->readConfigString("ServerPort").c_str()).toInt(&toIntTrue, 10));
|
||||
|
||||
//Profile Name darf nicht mit einer Zahl beginnen --> XML konform
|
||||
QRegExp rx("[A-Z|a-z]+[A-Z|a-z|\\d]*");
|
||||
@@ -42,7 +42,7 @@ joinNetworkGameDialogImpl::joinNetworkGameDialogImpl(QWidget *parent)
|
||||
|
||||
lineEdit_ipAddress->setFocus();
|
||||
|
||||
myServerProfilesFile = myConfig.readConfigString("DataDir")+"serverprofiles.xml";
|
||||
myServerProfilesFile = myConfig->readConfigString("DataDir")+"serverprofiles.xml";
|
||||
|
||||
//Anlegen wenn noch nicht existiert!
|
||||
QFile serverProfilesfile(QString::fromUtf8(myServerProfilesFile.c_str()));
|
||||
|
||||
@@ -34,9 +34,9 @@ class ConfigFile;
|
||||
class joinNetworkGameDialogImpl: public QDialog, public Ui::joinNetworkGameDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
joinNetworkGameDialogImpl(QWidget *parent = 0);
|
||||
joinNetworkGameDialogImpl(QWidget *parent = 0, ConfigFile *c = 0);
|
||||
|
||||
ConfigFile myConfig;
|
||||
ConfigFile *myConfig;
|
||||
std::string myServerProfilesFile;
|
||||
|
||||
public slots:
|
||||
|
||||
Reference in New Issue
Block a user