checkin for saving current state

This commit is contained in:
2025-02-14 13:20:42 +01:00
parent ef9cc23093
commit 8db818f6cd
37 changed files with 1063 additions and 131 deletions

View File

@@ -6,9 +6,11 @@
UpdateCommand::UpdateCommand(QString const &command,
Worker *worker,
int nextCommandIndex,
int start_timeout,
int finish_timeout)
: Command(command, start_timeout, finish_timeout) {
: Command(command, start_timeout, finish_timeout)
, m_nextCommandIndex(nextCommandIndex) {
setWorker(worker);
}
@@ -22,10 +24,15 @@ void UpdateCommand::finished(int exitCode, QProcess::ExitStatus exitStatus) {
<< "exitCode" << exitCode
<< "exitStatus" << exitStatus;
QProcess *p = (QProcess *)sender();
QProcess *p = qobject_cast<QProcess *>(sender());
if (p) {
// read all remaining data sent to the process, just in case
m_commandResult += p->readAllStandardOutput();
QString s = p->readAllStandardOutput().trimmed();
if (!s.isEmpty()) {
qCritical() << __func__ << ":" << __LINE__ << s;
m_commandResult += s;
}
qCritical() << __func__ << ":" << __LINE__ << "next command" << m_nextCommandIndex;
disconnect(p, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(readyReadStandardOutput()));
disconnect(p, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(readyReadStandardError()));
@@ -34,10 +41,12 @@ void UpdateCommand::finished(int exitCode, QProcess::ExitStatus exitStatus) {
if (!m_worker->workList().empty()) {
if (exitCode == 0 && exitStatus == QProcess::ExitStatus::NormalExit) {
qCritical() << __func__ << ":" << __LINE__;
if (m_worker->workList().nextExec()) {
m_worker->workList().exec();
}
} else {
qCritical() << __func__ << ":" << __LINE__;
bool execShowStatus = true;
m_worker->workList().exec(execShowStatus);
}