summaryrefslogtreecommitdiff
path: root/client/sendrecieve.cc
diff options
context:
space:
mode:
authorsenator <senator>2008-03-18 08:35:08 +0000
committersenator <senator>2008-03-18 08:35:08 +0000
commit6cbd8761972281325956d6bc2c34850fe09acf91 (patch)
treea1f9b3f290d8781383c1696706a7ea49575f16a9 /client/sendrecieve.cc
parent6ea6f74408e11e2487bb59c3951c4ab44e1baa59 (diff)
host and port now taken from pracro.ini
Diffstat (limited to 'client/sendrecieve.cc')
-rw-r--r--client/sendrecieve.cc13
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()