summaryrefslogtreecommitdiff
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r--src/mainwindow.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 9c049ac..d68820b 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -52,19 +52,18 @@
MainWindow::MainWindow( QWidget* parent, const char* name )
: QWidget( parent, name, WStyle_Customize | WStyle_NoBorder )
{
- error = new Error();
- MiavConfig cfg("miav.conf", error);
- video_width = cfg.readInt("video_width");
- video_height = cfg.readInt("video_height");
+ Error *error = config->getErrorObj();
+ video_width = config->readInt("video_width");
+ video_height = config->readInt("video_height");
- int resolution_w = cfg.readInt("pixel_width");
- int resolution_h = cfg.readInt("pixel_height");
+ int resolution_w = config->readInt("pixel_width");
+ int resolution_h = config->readInt("pixel_height");
while(error->hasError()) {
show();
MessageBox(this, TXT_ERROR_TITLE, error->popErrorString().c_str(),
TYPE_OK, ICON_ERROR).exec();
}
- unit = ((float)resolution_w / (float)(cfg.readFloat("screensize") * 3.1f));
+ unit = ((float)resolution_w / (float)(config->readFloat("screensize") * 3.1f));
move(0,0);
resize(resolution_w, resolution_h);
@@ -102,8 +101,8 @@ MainWindow::MainWindow( QWidget* parent, const char* name )
show();
camera = new Camera();
- camera->connect(cfg.readString("server_addr")->c_str(),
- cfg.readInt("server_port"));
+ camera->connect(config->readString("server_addr")->c_str(),
+ config->readInt("server_port"));
cam_error = camera->errorObject();
while(cam_error->hasError()) {
@@ -120,7 +119,7 @@ MainWindow::MainWindow( QWidget* parent, const char* name )
MainWindow::~MainWindow()
{
- if(camera) delete camera;
+ delete camera;
delete btn_cpr;
}