Check m_hw for nullprt.
This commit is contained in:
		@@ -131,45 +131,20 @@ Update::Update(QString customerRepository,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_sys_areDCDataValid ..."
 | 
					        qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_sys_areDCDataValid ..."
 | 
				
			||||||
                    << m_sys_areDCdataValid;
 | 
					                    << m_sys_areDCdataValid;
 | 
				
			||||||
 | 
					 | 
				
			||||||
#if 0
 | 
					 | 
				
			||||||
        QObject const *obj = m_hw->getAPI();
 | 
					 | 
				
			||||||
        Q_ASSERT(obj != nullptr);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        QDebug critical = qCritical();
 | 
					 | 
				
			||||||
        critical << "connect() to onReportDCDownloadStatus() ...";
 | 
					 | 
				
			||||||
        if (!connect(obj,
 | 
					 | 
				
			||||||
                     SIGNAL(hwapi_reportDCDownloadStatus(QString const&)),
 | 
					 | 
				
			||||||
                     this,
 | 
					 | 
				
			||||||
                     SLOT(onReportDCDownloadStatus(QString const &)))) {
 | 
					 | 
				
			||||||
            critical << "FAILED";
 | 
					 | 
				
			||||||
        } else critical << "DONE";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        critical = qCritical();
 | 
					 | 
				
			||||||
        critical << "connect() to onReportDCDownloadSuccess() ...";
 | 
					 | 
				
			||||||
        if (!connect(obj,
 | 
					 | 
				
			||||||
            SIGNAL(hwapi_reportDCDownloadSuccess(QString const&)), this,
 | 
					 | 
				
			||||||
            SLOT(onReportDCDownloadSuccess(QString const &)))) {
 | 
					 | 
				
			||||||
            critical << "FAILED";
 | 
					 | 
				
			||||||
        } else critical << "DONE";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        critical = qCritical();
 | 
					 | 
				
			||||||
        critical << "connect() to onReportDCDownloadFailure() ...";
 | 
					 | 
				
			||||||
        if (!connect(obj,
 | 
					 | 
				
			||||||
            SIGNAL(hwapi_reportDCDownloadFailure(QString const &)), this,
 | 
					 | 
				
			||||||
            SLOT(onReportDCDownloadFailure(QString const &)))) {
 | 
					 | 
				
			||||||
            critical << "FAILED";
 | 
					 | 
				
			||||||
        } else critical << "DONE";
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Update::~Update() {
 | 
					Update::~Update() {
 | 
				
			||||||
    // unloadDCPlugin();
 | 
					    unloadDCPlugin();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool Update::doUpdate(QStringList const &filesToWorkOn) {
 | 
					bool Update::doUpdate(QStringList const &filesToWorkOn) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!m_hw) {
 | 
				
			||||||
 | 
					        qCritical() << "ERROR!!! m_hw == nullptr";
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int tries = 20;
 | 
					    int tries = 20;
 | 
				
			||||||
    while ((m_sys_areDCdataValid = m_hw->sys_areDCdataValid()) == false) {
 | 
					    while ((m_sys_areDCdataValid = m_hw->sys_areDCdataValid()) == false) {
 | 
				
			||||||
        // must deliver 'true', only then are all data from hwapi valid
 | 
					        // must deliver 'true', only then are all data from hwapi valid
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user