diff options
author | senator <senator> | 2008-03-18 08:35:08 +0000 |
---|---|---|
committer | senator <senator> | 2008-03-18 08:35:08 +0000 |
commit | 6cbd8761972281325956d6bc2c34850fe09acf91 (patch) | |
tree | a1f9b3f290d8781383c1696706a7ea49575f16a9 /client | |
parent | 6ea6f74408e11e2487bb59c3951c4ab44e1baa59 (diff) |
host and port now taken from pracro.ini
Diffstat (limited to 'client')
-rw-r--r-- | client/sendrecieve.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/client/sendrecieve.cc b/client/sendrecieve.cc index ee7cc6d..914b4af 100644 --- a/client/sendrecieve.cc +++ b/client/sendrecieve.cc @@ -33,6 +33,7 @@ #include <QTcpSocket> #include <QDomDocument> #include <QByteArray> +#include <QSettings> SendRecieve::SendRecieve() : QObject() @@ -42,8 +43,16 @@ SendRecieve::SendRecieve() void SendRecieve::tcpConnect() { - tcpsocket->connectToHost("gargamel.j.auh.dk", 12345); - tcpConnected = TCP_CONNECTING; + QSettings settings("pracro.ini", QSettings::IniFormat); + + settings.beginGroup("server"); + QString host = settings.value("host").toString(); + int port = settings.value("port").toInt(); + settings.endGroup(); + + printf("%s, %d\n", host.toStdString().c_str(), port); + tcpsocket->connectToHost(host, port); + tcpConnected = TCP_CONNECTING; } void SendRecieve::tcpDisconnect() |