summaryrefslogtreecommitdiff
path: root/client/cprquerydialog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/cprquerydialog.cc')
-rw-r--r--client/cprquerydialog.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/client/cprquerydialog.cc b/client/cprquerydialog.cc
index 0a88b43..fc19015 100644
--- a/client/cprquerydialog.cc
+++ b/client/cprquerydialog.cc
@@ -28,7 +28,8 @@
#include "messagebox.h"
#include "cprquerydialog.h"
-#include "miav_config.h"
+#include "configuration.h"
+#include "info.h"
CPRQueryDialog::CPRQueryDialog(QLabel *lcpr,
QLabel *lname,
@@ -49,9 +50,12 @@ CPRQueryDialog::CPRQueryDialog(QLabel *lcpr,
statusbar = status;
//Read configuration
- CPR_HOST = MIaV::config->readString("cpr_host");
- CPR_PORT = MIaV::config->readInt("cpr_port");
- CPR_TIMEOUT = MIaV::config->readInt("cpr_timeout");
+ if(MIaV::config->get("cpr_host", &cpr_host))
+ MIaV::info->error("Could not read the symbol [cpr_host] from the config file.");
+ if(MIaV::config->get("cpr_port", &cpr_port))
+ MIaV::info->error("Could not read the symbol [cpr_port] from the config file.");
+ if(MIaV::config->get("cpr_timeout", &cpr_timeout))
+ MIaV::info->error("Could not read the symbol [cpr_timeout] from the config file.");
cpr[0] = '\0';
internalCpr[0] = '\0';
@@ -113,7 +117,11 @@ CPRQueryDialog::CPRQueryDialog(QLabel *lcpr,
this->move(175,150);
- listen = new CPRListen(MIaV::config->readInt("cprlisten_port"));
+ int cprlisten_port;
+ if(MIaV::config->get("cprlisten_port", &cprlisten_port))
+ MIaV::info->error("Could not read the symbol [cprlisten_port] from the config file.");
+
+ listen = new CPRListen(cprlisten_port);
listen_timer = new QTimer(this);
connect(listen_timer, SIGNAL(timeout()), SLOT(listen_timeout()));
listen->run();
@@ -137,7 +145,7 @@ CPRQueryDialog::~CPRQueryDialog()
void CPRQueryDialog::listen_timeout()
{
- string newcpr;
+ std::string newcpr;
if(listen->cprChanged()) {
char newcpr_buf[32];
newcpr = listen->getCpr();
@@ -290,8 +298,8 @@ void CPRQueryDialog::verifycpr(char *cpr)
break;
}
} else {
- cprSocket->connectToHost(CPR_HOST->c_str(), CPR_PORT);
- timer->start(CPR_TIMEOUT);
+ cprSocket->connectToHost(cpr_host.c_str(), cpr_port);
+ timer->start(cpr_timeout);
// accept();
}
}