Update-object now proper memeber of worker-thread.w

This commit is contained in:
Gerhard Hoffmann 2023-11-07 09:14:49 +01:00
parent 0050ea35d0
commit 1f8b88b2b6
2 changed files with 16 additions and 8 deletions

View File

@ -94,11 +94,11 @@ bool Update::unloadDCPlugin() {
return false;
}
Update::Update(hwinf *hw,
Worker *worker,
Update::Update(Worker *worker,
QString customerRepository,
QString customerNrStr,
QString branchName,
QString plugInDir,
QString pluginName,
QString workingDir,
bool dryRun,
@ -106,7 +106,7 @@ Update::Update(hwinf *hw,
char const *serialInterface,
char const *baudrate)
: QObject(parent)
, m_hw(hw)
, m_hw(loadDCPlugin(QDir(plugInDir), pluginName))
, m_worker(worker)
, m_serialInterface(serialInterface)
, m_baudrate(baudrate)
@ -742,7 +742,12 @@ QStringList Update::getDcSoftAndHardWareVersion() {
}
bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
// always assume that serial line is open
if (!m_hw->sys_areDCdataValid()) { // must deliver 'true', only then are all
// data from hwapi valid
qCritical() << "ERROR!!! DC DATA NOT VALID";
return false;
}
bool res = false;
QList<QString>::const_iterator it;
for (it = filesToWorkOn.cbegin(); it != filesToWorkOn.cend(); ++it) {

View File

@ -21,8 +21,8 @@ class Worker;
class Update : public QObject {
Q_OBJECT
hwinf *m_hw;
Worker *m_worker;
hwinf *m_hw = nullptr;
Worker *m_worker = nullptr;
char const *m_serialInterface;
char const *m_baudrate;
QString m_customerRepository;
@ -44,11 +44,11 @@ public:
static QStringList split(QString line, QChar sep = ',');
explicit Update(hwinf *hw,
Worker *worker,
explicit Update(Worker *worker,
QString customerRepository,
QString customerNrStr,
QString branchName,
QString plugInDir,
QString pluginName,
QString workingDir,
bool dryRun = false,
@ -58,6 +58,9 @@ public:
virtual ~Update() override;
bool doUpdate(int &displayIndex, QStringList const &linesToWorkOn);
hwinf *hw() { return m_hw; }
hwinf const *hw() const { return m_hw; }
//QString customerId() { return m_customerId; }
//QString const customerId() const { return m_customerId; }