diff options
-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() |