ref #29 Fixing inialization conctructor main class worker.

This commit is contained in:
IgorekLoschinin 2021-05-13 21:11:41 +03:00
parent 53a30a2dd2
commit 58b1032099
2 changed files with 12 additions and 11 deletions

View File

@ -7,6 +7,7 @@
#include "config.h"
#include "configparser.h"
#include "signer.h"
#include "worker.h"
#include <quasarapp.h>
@ -14,24 +15,24 @@
namespace CopyrighFixer {
Worker::Worker() {
conf_ = new Config;
confParser_ = new ConfigParser;
subscriber_ = new Signer;
_conf = new Config;
_confParser = new ConfigParser;
_subscriber = new Signer;
}
Worker::~Worker() {
delete conf_;
delete confParser_;
delete subscriber_;
delete _conf;
delete _confParser;
delete _subscriber;
}
bool Worker::run() {
if (!confParser_->parseOptions(*conf_)) {
if (!_confParser->parseOptions(*_conf)) {
return false;
}
if (!subscriber_->checkSign(*conf_)) {
if (!_subscriber->checkSign(*_conf)) {
return false;
}

View File

@ -38,9 +38,9 @@ public:
void printHelp() const;
protected:
Config *conf_ = nullptr;
ConfigParser *confParser_ = nullptr;
Signer *subscriber_ = nullptr;
Config *_conf = nullptr;
ConfigParser *_confParser = nullptr;
Signer *_subscriber = nullptr;
};