diff options
author | deva <deva> | 2005-04-26 07:53:37 +0000 |
---|---|---|
committer | deva <deva> | 2005-04-26 07:53:37 +0000 |
commit | 805229c3b5a9b5078a273d175140b42445fd501a (patch) | |
tree | c272ac633cbc6914c585c9d196b4406d4cca2949 /src/mainwindow.cc | |
parent | 3ac7bf67ffca34e84053b2721aba922baf30d660 (diff) |
Made variable argument pushError method
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 19 |
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; } |